void
SVGMotionSMILAnimationFunction::RebuildPathAndVerticesFromPathAttr()
{
  const nsAString& pathSpec = GetAttr(nsGkAtoms::path)->GetStringValue();
  mPathSourceType = ePathSourceType_PathAttr;

  // Generate Path from |path| attr
  SVGPathData path;
  nsSVGPathDataParser pathParser(pathSpec, &path);

  // We ignore any failure returned from Parse() since the SVG spec says to
  // accept all segments up to the first invalid token. Instead we must
  // explicitly check that the parse produces at least one path segment (if
  // the path data doesn't begin with a valid "M", then it's invalid).
  pathParser.Parse();
  if (!path.Length()) {
    return;
  }

  mPath = path.ToPathForLengthOrPositionMeasuring();
  bool ok = path.GetDistancesFromOriginToEndsOfVisibleSegments(&mPathVertices);
  if (!ok || !mPathVertices.Length()) {
    mPath = nullptr;
  }
}
void CMTPFSEnumerator::AddFileEntryForOtherDpL(const TDesC& aPath, TUint32 &aHandle, TMTPFormatCode format, TUint32 aDPId, const TEntry& /*aEntry*/, TUint32 aStorageId, TUint32 aParentHandle, TUint16 aSubFormatCode/* = 0*/)
{
    OstTraceFunctionEntry0( CMTPFSENUMERATOR_ADDFILEENTRYFOROTHERDPL_ENTRY );
#ifdef OST_TRACE_COMPILER_IN_USE
    TBuf8<KMaxFileName> tmp;
    tmp.Copy(aPath);

    OstTraceExt1( TRACE_NORMAL, CMTPFSENUMERATOR_ADDFILEENTRYFOROTHERDPL, "%S", tmp );
#endif // OST_TRACE_COMPILER_IN_USE

    TParsePtrC pathParser(aPath);
    TPtrC name(pathParser.Name());

    aHandle = KMTPHandleNone;

    iObject->SetUint(CMTPObjectMetaData::EDataProviderId, aDPId);
    iObject->SetUint(CMTPObjectMetaData::EFormatCode, format);
    iObject->SetUint(CMTPObjectMetaData::EStorageId, aStorageId);
    iObject->SetDesCL(CMTPObjectMetaData::ESuid, aPath);
    iObject->SetUint(CMTPObjectMetaData::EFormatSubCode, aSubFormatCode);
    iObject->SetUint(CMTPObjectMetaData::EParentHandle, aParentHandle);
    iObject->SetUint(CMTPObjectMetaData::ENonConsumable, EMTPConsumable);
    iObject->SetDesCL(CMTPObjectMetaData::EName, name);
    iFramework.ObjectMgr().InsertObjectL(*iObject);
    OstTraceFunctionExit0( CMTPFSENUMERATOR_ADDFILEENTRYFOROTHERDPL_EXIT );
}
/**
Add a file entry to the object store
@param aEntry    The file Entry to be added
@param aPath    The full path name of the entry
@return MTP object handle, or KMTPHandleNone if entry was not accepted
*/
void CMTPFSEnumerator::AddEntryL(const TDesC& aPath, TUint32 &aHandle, TMTPFormatCode format, TUint32 aDPId, const TEntry& aEntry, TUint32 aStorageId, TUint32 aParentHandle)
{
    OstTraceFunctionEntry0( CMTPFSENUMERATOR_ADDENTRYL_ENTRY );
#ifdef OST_TRACE_COMPILER_IN_USE
    TBuf8<KMaxFileName> tmp;
    tmp.Copy(aPath);

    OstTraceExt1( TRACE_NORMAL, CMTPFSENUMERATOR_ADDENTRYL, "entry: %s", tmp );
#endif // OST_TRACE_COMPILER_IN_USE

    TUint16 assoc;
    TPtrC name;
    if (format == EMTPFormatCodeAssociation)
    {
        assoc = EMTPAssociationTypeGenericFolder;
        TParsePtrC pathParser(aPath.Left(aPath.Length() - 1)); // Ignore the trailing "\".
        name.Set(aEntry.iName);
    }
    else
    {
        assoc = EMTPAssociationTypeUndefined;
        TParsePtrC pathParser(aPath);
        name.Set(pathParser.Name());
    }

    //if(iExclusionMgr.IsFormatValid(format))
    {
        aHandle = KMTPHandleNone;

        iObject->SetUint(CMTPObjectMetaData::EDataProviderId, aDPId);
        iObject->SetUint(CMTPObjectMetaData::EFormatCode, format);
        iObject->SetUint(CMTPObjectMetaData::EStorageId, aStorageId);
        iObject->SetDesCL(CMTPObjectMetaData::ESuid, aPath);
        iObject->SetUint(CMTPObjectMetaData::EFormatSubCode, assoc);
        iObject->SetUint(CMTPObjectMetaData::EParentHandle, aParentHandle);
        iObject->SetUint(CMTPObjectMetaData::ENonConsumable, EMTPConsumable);
        iObject->SetDesCL(CMTPObjectMetaData::EName, name);
        iFramework.ObjectMgr().InsertObjectL(*iObject);
        aHandle = iObject->Uint(CMTPObjectMetaData::EHandle);

    }
    OstTraceFunctionExit0( CMTPFSENUMERATOR_ADDENTRYL_EXIT );
}
// -----------------------------------------------------------------------------
// CHttpCacheStreamHandler::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CHttpCacheStreamHandler::ConstructL(
    const TDesC& aDirectory,
    TInt aCriticalLevel)
    {
    iActiveEntries = new( ELeave )CArrayPtrFlat<CHttpCacheEntry>( KHttpCacheActiveCount );
    // get drive letter for sysutil
    TParsePtrC pathParser( aDirectory );
    iDrive = pathParser.Drive();
    iCriticalLevel = aCriticalLevel;
    }
void CHttpCacheManager::GetCriticalDriveLevelsL( CRepository& aRepository, const TDesC& aCacheFolder, TInt& aCriticalLevel )
    {
    // get drive letter for sysutil
    TParsePtrC pathParser( aCacheFolder );
    TDriveUnit drive = pathParser.Drive();

    // get critical level
    // RAM drive can have different critical level
    TVolumeInfo vinfo;
    User::LeaveIfError(CCoeEnv::Static()->FsSession().Volume(vinfo, drive));
    //
    User::LeaveIfError(aRepository.Get((vinfo.iDrive.iType == EMediaRam ? KRamDiskCriticalLevel : KDiskCriticalThreshold), aCriticalLevel));
    }
TMPXGeneralCategory CMmMtpDpMetadataAccessWrapper::ContainerCategoryL( const TDesC& aFullFileName )
    {
    PRINT1( _L( "MM MTP => CMmMtpDpMetadataAccessWrapper::ContainerCategoryL aFullFileName = %S" ), &aFullFileName );

    TMPXGeneralCategory category = EMPXNoCategory;
    TParsePtrC pathParser( aFullFileName );
    TPtrC ext( pathParser.Ext() );

    if ( ext.Length() <= 0 )
        category = EMPXOther;
    else if ( ext.CompareF( KTxtExtensionO4A ) == 0
        || ext.CompareF( KTxtExtensionM4A ) == 0 )
        category = EMPXSong;
    else if ( ext.CompareF( KTxtExtensionO4V ) == 0 )
        category = EMPXVideo;
    else
        {
        HBufC8* mimetype = NULL;

        if ( ext.CompareF( KTxtExtensionMP4 ) == 0
            || ext.CompareF( KTxtExtension3GP ) == 0
            || ext.CompareF( KTxtExtension3G2 ) == 0 )
            mimetype = MmMtpDpUtility::Mp4MimeTypeL( aFullFileName );
        else if ( ext.CompareF( KTxtExtensionODF ) == 0 )
            mimetype = MmMtpDpUtility::OdfMimeTypeL( aFullFileName );
        else if ( ext.CompareF( KTxtExtensionASF ) == 0 )
            mimetype = MmMtpDpUtility::AsfMimeTypeL( aFullFileName );
        if ( mimetype != NULL )
            {
            TMmMtpSubFormatCode subFormatCode =
                MmMtpDpUtility::SubFormatCodeFromMime( *mimetype );

            if ( subFormatCode == EMTPSubFormatCodeVideo )
                category = EMPXVideo;
            else if( subFormatCode == EMTPSubFormatCodeAudio )
                category = EMPXSong;
            else
                category = EMPXOther;
            }
        }

    PRINT1( _L( "MM MTP <= CMmMtpDpMetadataAccessWrapper::ContainerCategoryL, category = %d" ), category );
    return category;
    }