当前位置: 首页>>代码示例>>C++>>正文


C++ TFileName::AllocL方法代码示例

本文整理汇总了C++中TFileName::AllocL方法的典型用法代码示例。如果您正苦于以下问题:C++ TFileName::AllocL方法的具体用法?C++ TFileName::AllocL怎么用?C++ TFileName::AllocL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TFileName的用法示例。


在下文中一共展示了TFileName::AllocL方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: InternalizeL

// -----------------------------------------------------------------------------
// CProfileExtraTonesImpl::InternalizeL
//
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CProfileExtraTonesImpl::InternalizeL( CRepository& aCenRep,
        TInt aProfileId )
{
    delete iIMMessageAlertTone;
    iIMMessageAlertTone = NULL;

    TFileName toneFile;

    // IM Message alert tone
    User::LeaveIfError(
        aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngImTone,
                     aProfileId ), toneFile ) );
    iIMMessageAlertTone = toneFile.AllocL();

    delete iEmailAlertTone;
    iEmailAlertTone = NULL;

    // E-mail alert tone
    User::LeaveIfError(
        aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngEmailTone,
                     aProfileId ), toneFile ) );
    iEmailAlertTone = toneFile.AllocL();

    delete iVideoCallRingingTone;
    iVideoCallRingingTone = NULL;

    // Video call ringing tone
    User::LeaveIfError(
        aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngVideoCallTone,
                     aProfileId ), toneFile ) );
    iVideoCallRingingTone = toneFile.AllocL();

    delete iReminderTone;
    iReminderTone = NULL;

    // Reminder tone
    User::LeaveIfError(
        aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngReminderTone,
                     aProfileId ), toneFile ) );
    iReminderTone = toneFile.AllocL();

    delete iClockAlarmTone;
    iClockAlarmTone = NULL;

    // Clock alarm tone
    User::LeaveIfError(
        aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngClockAlarmTone,
                     aProfileId ), toneFile ) );
    iClockAlarmTone = toneFile.AllocL();
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:56,代码来源:CProfileExtraTonesImpl.cpp

示例2: SetDownloadPathL

EXPORT_C void CSTPreferences::SetDownloadPathL(TFileName& aDownloadPath)
{
	delete iDownloadPath;
	iDownloadPath = 0;
	iDownloadPath = aDownloadPath.AllocL();
	NotifyObserversL(ESettingDownloadPath);
}
开发者ID:Nokia700,项目名称:SymTorrent,代码行数:7,代码来源:STPreferences.cpp

示例3: SetFileNameL

// -----------------------------------------------------------------------------
// CHttpCacheEntry::SetFileNameL
//
// -----------------------------------------------------------------------------
//
void CHttpCacheEntry::SetFileNameL( const TFileName& aFileName )
    {
    delete iFileName;
    iFileName = NULL;

    iFileName = aFileName.AllocL();
    }
开发者ID:gvsurenderreddy,项目名称:symbiandump-mw4,代码行数:12,代码来源:HttpCacheEntry.cpp

示例4: attachmentList

// UniBioMessageDataPlugin::attachmentList()
// @see header
//---------------------------------------------------------------
UniMessageInfoList UniBioMessageDataPlugin::attachmentList()
{
    RFile file;
    QT_TRAP_THROWING(file = d_ptr->attachmentL());

    if(attachmentCount() == 0)
    {
        file.Close();
        return QList<UniMessageInfo*> ();
    }
     
    UniMessageInfoList attlist;

    QString path;
    QString mimetype;
    int size = 0;

    TFileName fullName;
    qt_symbian_throwIfError(file.FullName(fullName));
    qt_symbian_throwIfError(file.Size(size));

    path = XQConversions::s60DescToQString(*fullName.AllocL());

    UniMessageInfo *msgobj = new UniMessageInfo(path, size, mimetype);
    attlist << msgobj;
    file.Close();
    return attlist;
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:31,代码来源:unibiomessagedataplugin.cpp

示例5: ConstructL

void CTestAgentContent::ConstructL(const TDesC& aURI, TContentShareMode aShareMode)
	{
	TFileName dummyFileName;
	TTestAgentAttributes::GetDummyFileName(aURI, dummyFileName);
	
	iURI = dummyFileName.AllocL();

	TUint mode = EFileStream | EFileRead;

	if(aShareMode == EContentShareReadWrite)
		{
		mode |= EFileShareReadersOrWriters;
		}
	else if (aShareMode == EContentShareExclusive)
		{
		mode |= EFileShareExclusive;
		}
	else
		{
		mode |= EFileShareReadersOnly;
		}

	// open underlying file handle
	User::LeaveIfError(iFs.Connect());
	User::LeaveIfError(iFile.Open(iFs, *iURI, mode));

	// Create DRM file objects
	iTestFile = CTestAgentFile::NewL(iFile);
	iTestDrmContent = CTestAgentDrmContent::NewL(iFile);
	
	// reset file pointer back to the beginning of the file
	TInt pos = 0;
	iFile.Seek(ESeekStart,pos);
	iShareMode = aShareMode;
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:35,代码来源:testagentcontent.cpp

示例6: ReadFileL

void CPolicyNormalizer::ReadFileL( TFileName aPath )
    {
    RFs fss;
    User::LeaveIfError(fss.Connect());
    CleanupClosePushL(fss);
     
    if(iPath)
        {
        delete iPath;
        iPath = NULL;
        }
        
    iPath = aPath.AllocL();
    
    TFileName iFileName(aPath);
    RFile  xmlFile;
    TInt err = xmlFile.Open(fss , iFileName, EFileRead );
    
    if(err == KErrNone)
        {
        TInt size;
        xmlFile.Size(size);

        HBufC8 *iBuf=HBufC8::NewL(size);

        TPtr8 buf8ptr(iBuf->Des());
        xmlFile.Read(buf8ptr,size);
        xmlFile.Close();

        TInt leaveCode(KErrNone);
        TRAP leaveCode, ParseL(buf8ptr) );
        leaveCode = 0; // not used currently
        delete iBuf;
        iBuf = NULL;
        }
开发者ID:gvsurenderreddy,项目名称:symbiandump-mw4,代码行数:35,代码来源:PolicyNormalizer.cpp

示例7: ConstructL

// -----------------------------------------------------------------------------
// CSisxUIStartupFile::ConstructL
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CSisxUIStartupFile::ConstructL( const TUid& aUid )
    {
    User::LeaveIfError( iFileSession.Connect() );

    TUidName uidStr = aUid.Name();
    TFileName tmp;
    
    iFileSession.PrivatePath( tmp );    
    tmp.Insert( 0, TParsePtrC( PathInfo::PhoneMemoryRootPath() ).Drive() );
    tmp.Append( KImportDir );      
    tmp.AppendFormat( KNewFileFormat, &uidStr ); 
    iNewFile = tmp.AllocL();
    tmp.Zero();
        
    iFileSession.PrivatePath( tmp );
    tmp.Insert( 0, TParsePtrC( PathInfo::PhoneMemoryRootPath() ).Drive() );
    tmp.Append( KPrivateFileDir );    
    iFileSession.MkDir( tmp );    
    tmp.AppendFormat( KPrivateFileFormat, &uidStr );
    iPrivateFile = tmp.AllocL();
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:26,代码来源:SisxUIStartupFile.cpp

示例8: SetDefaultParentObjectL

/**
Get a default parent object, ff the request does not specify a parent object, 
*/
void CMTPImageDpCopyObject::SetDefaultParentObjectL()
    {
    OstTraceFunctionEntry0( CMTPIMAGEDPCOPYOBJECT_SETDEFAULTPARENTOBJECTL_ENTRY );
    TDriveNumber drive(static_cast<TDriveNumber>(iFramework.StorageMgr().DriveNumber(iStorageId)));
    LEAVEIFERROR(drive,
            OstTraceExt2( TRACE_ERROR, CMTPIMAGEDPCOPYOBJECT_SETDEFAULTPARENTOBJECTL, "No driver number for %d! error code %d",iStorageId, munged_err));
    TChar driveLetter;
    iFramework.Fs().DriveToChar(drive, driveLetter);
    TFileName driveBuf;
    driveBuf.Append(driveLetter);
    driveBuf = BaflUtils::RootFolderPath(driveBuf.Left(1));
    delete iDest;
    iDest = NULL;
    iDest = driveBuf.AllocL();
    iNewParentHandle = KMTPHandleNoParent;
    OstTraceFunctionExit0( CMTPIMAGEDPCOPYOBJECT_SETDEFAULTPARENTOBJECTL_EXIT );
    }
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:20,代码来源:cmtpimagedpcopyobject.cpp

示例9: MountL

void CSVPHostMountCB::MountL(TBool /*aForceMount*/)
	{
        DP(_L("** (SVPHOSTMNT) CSVPHostMountCB::MountL()"));

	TInt err = iDevice.Open();
	User::LeaveIfError(err);

	TFileName driveName;
	TInt d=Drive().DriveNumber();
	iSize=HOST_SVP_DRIVE_SIZE;
	User::LeaveIfError(GetVolume(d,driveName,iUniqueID));
	HBufC* pN=driveName.AllocL();
	DP(_L("** (SVPHOSTMNT) ->SetVolumeName()"));
	SetVolumeName(pN);
	DP(_L("** (SVPHOSTMNT) <-SetVolumeName()"));

	}
开发者ID:SymbianSource,项目名称:oss.FCL.interim.QEMU,代码行数:17,代码来源:svphostmnt.cpp

示例10: ReFreshHandlersL

/*
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
*/
void CEcomHandler::ReFreshHandlersL()
{		
	iHandlers.ResetAndDestroy();

	RImplInfoPtrArray infoArray;
	REComSession::ListImplementationsL(KUidYTaskHandUID, infoArray);

	TFileName CurrName;

	for ( TInt i = 0; i < infoArray.Count(); i++ )
	{
		CurrName.Zero();		
		CurrName.Copy(infoArray[i]->DisplayName());
		CurrName.TrimAll();
		
		TInt YStart = infoArray[i]->OpaqueData().Find(KtxStrtYTools);
		TInt YEnd 	= infoArray[i]->OpaqueData().Find(KtxEnddYTools);
		if(YStart != KErrNotFound
		&& YEnd != KErrNotFound)
		{	
			YStart = YStart + KtxStrtYTools().Length();
			YEnd = (YEnd - YStart);
			if(YEnd > 0 )
			{
				if(CurrName.Length() && CheckVersionL(infoArray[i]->OpaqueData().Mid(YStart,YEnd)))
				{
					CHandlerItem* newItem = new(ELeave)CHandlerItem();
					CleanupStack::PushL(newItem);
				
					newItem->iUid = infoArray[i]->ImplementationUid();	
					newItem->iName = CurrName.AllocL();
				
					newItem->iServerName = ParseInfoL(infoArray[i]->OpaqueData().Mid(YStart,YEnd),KtxStrtSERVER,KtxEnddSERVER);
					newItem->iIconfile = ParseInfoL(infoArray[i]->OpaqueData().Mid(YStart,YEnd),KtxStrtICONFILE,KtxEnddICONFILE);
				
					CleanupStack::Pop(newItem);
					
					iHandlers.Append(newItem);
				}
			}
		}
	}
	
	infoArray.ResetAndDestroy();
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:49,代码来源:Ecom_Handler.cpp

示例11: DatabaseLocateL

void CLogServDatabaseMarshall::DatabaseLocateL()
	{
	// Get drive for database
	TDriveUnit driveUnit(static_cast<TInt>(RFs::GetSystemDrive()));
	TDriveName name(driveUnit.Name());
	
	TFileName path;
	iFsSession.PrivatePath(path);
	
	// Ensure database path exists
	TParse parse;
	User::LeaveIfError(parse.Set(path, &name, NULL));
	path = parse.FullName();
	
	TInt error = iFsSession.MkDirAll(path);
	if	(error != KErrAlreadyExists)
		User::LeaveIfError(error);
	
	path += KLogDatabaseName;
	iDatabaseName = path.AllocL();
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:21,代码来源:LogServDatabaseMarshall.cpp

示例12: MountL

void CRemoteMountCB::MountL(TBool /*aForceMount*/)
//
// Mount a media. Only allowed to leave with KErrNoMemory,KErrNotReady,KErrCorrupt,KErrUnknown.
//
	{
//	TInt64 s,f;
	TFileName driveName;
	TInt d=Drive().DriveNumber();
//	TInt driveNum=d;
	if (MapDrive(driveName,d))
		RFs::CharToDrive(driveName[0],d);
	//User::LeaveIfError(GetMediaSize(d,s,f));
	//if (driveNum==EDriveZ)
//		iSize=4*1048576;
//	else
		//iSize=s;
	iSize=4*1024*16;
	User::LeaveIfError(GetVolume(d,driveName,iUniqueID));
	HBufC* pN=driveName.AllocL();
	SetVolumeName(pN);
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:21,代码来源:t_remmnt.cpp

示例13: InternalizeL

// -----------------------------------------------------------------------------
// CProfilePttSettingsImpl::InternalizeL
//
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CProfilePttSettingsImpl::InternalizeL( CRepository& aCenRep,
                                            TInt aProfileId )
    {
    delete iPttRingingTone;
    iPttRingingTone = NULL;

    TFileName toneFile;

    // PTT ringing tone
    User::LeaveIfError(
            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngPttTone,
            aProfileId ), toneFile ) );
    iPttRingingTone = toneFile.AllocL();

    // PTT status
    TInt status( 0 );
    User::LeaveIfError(
            aCenRep.Get( ProfileEngUtils::ResolveKey( KProEngPttStatus,
            aProfileId ), status ) );
    iPttStatus = TProfilePttStatus( status );
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:27,代码来源:CProfilePttSettingsImpl.cpp

示例14: GetValuesFromStoreL

/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CMainContainer::GetValuesFromStoreL(void)
{	
	iKeyArray.ResetAndDestroy();

	TFindFile AufFolder(CCoeEnv::Static()->FsSession());
	if(KErrNone == AufFolder.FindByDir(KtxKeySettingsFile, KNullDesC))
	{
		CDictionaryFileStore* MyDStore = CDictionaryFileStore::OpenLC(CCoeEnv::Static()->FsSession(),AufFolder.File(), TUid::Uid(0x102013AD));
	
		TFileName hljBuffer;
		TUint32 TmpValue(0);
				
		CKeyCapcap* ittem1 = new(ELeave)CKeyCapcap();
		iKeyArray.Append(ittem1);
		StringLoader::Load(ittem1->iLabel,R_STR_GREENBUTTON);
		
		GetValuesL(MyDStore,0x0011,TmpValue);
							
		if(TmpValue > 50)
			ittem1->iEnabled = ETrue;
		else// if(TmpValue > 10)
			ittem1->iEnabled = EFalse;
		
		GetValuesL(MyDStore,0x0012,hljBuffer);
		ittem1->iNunmber = hljBuffer.AllocL();

		GetValuesL(MyDStore,0x0013,hljBuffer);
		ittem1->iName = hljBuffer.AllocL();
		
		TmpValue = 0;
		GetValuesL(MyDStore,0x0014,TmpValue);
									
		if(TmpValue > 3599){
			TmpValue = 3599;
		}
		
		ittem1->iDelay = TmpValue;
		
		CKeyCapcap* ittem2 = new(ELeave)CKeyCapcap();
		iKeyArray.Append(ittem2);
		StringLoader::Load(ittem2->iLabel,R_STR_REDBUTTON);
		
		GetValuesL(MyDStore,0x0021,TmpValue);
							
		if(TmpValue > 50)
			ittem2->iEnabled = ETrue;
		else// if(TmpValue > 10)
			ittem2->iEnabled = EFalse;
		
		GetValuesL(MyDStore,0x0022,hljBuffer);
		ittem2->iNunmber = hljBuffer.AllocL();

		GetValuesL(MyDStore,0x0023,hljBuffer);
		ittem2->iName = hljBuffer.AllocL();
				
		TmpValue = 0;
		GetValuesL(MyDStore,0x0024,TmpValue);
											
		if(TmpValue > 3599){
			TmpValue = 3599;
		}
				
		ittem2->iDelay = TmpValue;
		
		CKeyCapcap* ittem3 = new(ELeave)CKeyCapcap();
		iKeyArray.Append(ittem3);
		StringLoader::Load(ittem3->iLabel,R_STR_OFFBUTTON);
		
		GetValuesL(MyDStore,0x0031,TmpValue);
							
		if(TmpValue > 50)
			ittem3->iEnabled = ETrue;
		else// if(TmpValue > 10)
			ittem3->iEnabled = EFalse;
		
		GetValuesL(MyDStore,0x0032,hljBuffer);
		ittem3->iNunmber = hljBuffer.AllocL();

		GetValuesL(MyDStore,0x0033,hljBuffer);
		ittem3->iName = hljBuffer.AllocL();		
	
		TmpValue = 0;
		GetValuesL(MyDStore,0x0034,TmpValue);
											
		if(TmpValue > 3599){
			TmpValue = 3599;
		}
				
		ittem3->iDelay = TmpValue;		
		
		CKeyCapcap* ittem4 = new(ELeave)CKeyCapcap();
		iKeyArray.Append(ittem4);
		StringLoader::Load(ittem4->iLabel,R_STR_CAMERABUTTON);
		
		GetValuesL(MyDStore,0x0041,TmpValue);
							
//.........这里部分代码省略.........
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:101,代码来源:Main_Container.cpp


注:本文中的TFileName::AllocL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。