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


C++ TParse::Set方法代码示例

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


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

示例1: AddResourceFileL

// -----------------------------------------------------------------------------
// CSecModUIModel::AddResourceFileL()
// -----------------------------------------------------------------------------
//
void CSecModUIModel::AddResourceFileL()
  {
  LOG_ENTERFN("CSecModUIModel::AddResourceFileL()");
    // Resource file loading
  RFs& fs = iEikEnv->FsSession();

  TFileName fileName;

  TParse parse;
  // secmodui.rsc
    parse.Set(KResourceFile, &KDC_RESOURCE_FILES_DIR, NULL);

  fileName = parse.FullName();

  BaflUtils::NearestLanguageFile( fs, fileName );
  iResourceFileOffset = iEikEnv->AddResourceFileL( fileName );

  // CertManUI.rsc
  parse.Set(KResourceFile2, &KDC_RESOURCE_FILES_DIR, NULL);
    fileName = parse.FullName();
    BaflUtils::NearestLanguageFile( fs, fileName );
    iResourceFileOffset2 = iEikEnv->AddResourceFileL( fileName );

  // CTSecDlg.rsc
  parse.Set(KResourceFile3, &KDC_RESOURCE_FILES_DIR, NULL);
    fileName = parse.FullName();
    BaflUtils::NearestLanguageFile( fs, fileName );
    iResourceFileOffset3 = iEikEnv->AddResourceFileL( fileName );

  LOG_LEAVEFN("CSecModUIModel::AddResourceFileL()");
  }
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:35,代码来源:SecModUIModel.cpp

示例2: DataFile

LOCAL_C TParse DataFile()
#endif
{
#ifdef _DRM_TESTING
    TRAP_IGNORE( WriteL(_L8("DataFile")) );
#endif

    TParse p;

#ifndef RD_MULTIPLE_DRIVE

    p.Set(KDbFileLocation,NULL,NULL);

#else //RD_MULTIPLE_DRIVE

    TInt driveNumber( -1 );
    TChar driveLetter;
    DriveInfo::GetDefaultDrive( DriveInfo::EDefaultSystem, driveNumber );

    aFs.DriveToChar( driveNumber, driveLetter );

    TFileName dbFile;
    dbFile.Format( KDbFileLoc, (TUint)driveLetter );

    p.Set(dbFile,NULL,NULL);

#endif

    return p;
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:30,代码来源:DcfRepSrv.cpp

示例3: DataFileL

// -----------------------------------------------------------------------------
// DataFileL
// return data filename as a TParse
// -----------------------------------------------------------------------------
//
LOCAL_C TParse DataFileL(RFs& aFs)
    {
    TBuf<256> path;
    TParse p;
    User::LeaveIfError(aFs.PrivatePath(path));

#ifndef RD_MULTIPLE_DRIVE

    p.Set(KHelperServerDataStorage,&path,NULL);

#else //RD_MULTIPLE_DRIVE

    TInt driveNumber( -1 );
    TChar driveLetter;
    DriveInfo::GetDefaultDrive( DriveInfo::EDefaultSystem, driveNumber );
    aFs.DriveToChar( driveNumber, driveLetter );

    TFileName helperServerDataStorage;
    helperServerDataStorage.Format(
                    KHelperServerDataStorage, (TUint)driveLetter );

    p.Set( helperServerDataStorage, &path, NULL );

#endif

    return p;
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:32,代码来源:DRMHelperServer.cpp

示例4: ThreadTestL

void ThreadTestL(TInt aThread)
	{
	RFs fs;
	User::LeaveIfError(fs.Connect());
	CleanupClosePushL(fs);

	TDriveUnit drive(static_cast<TUint>(RFs::GetSystemDrive()));	
	TParse testIniFile;
	testIniFile.Set(drive.Name(), &KTestIniFile, NULL);
	
	TIniData data;
	CDictionaryStore* dict=CDictionaryFileStore::OpenLC(fs,testIniFile.FullName(),KTestUid);
	data.LoadL(*dict);
	CleanupStack::PopAndDestroy(); // dict

	TParse threadTestPath;
	threadTestPath.Set(drive.Name(), &KThreadTestPath, NULL);
	
	TFileName name;
	name.Format(threadTestPath.FullName(),aThread);
	dict=CDictionaryFileStore::OpenLC(fs,name,KTestUid);
	data.SaveL(*dict);
	dict->CommitL();
	CleanupStack::PopAndDestroy();
	TReal x=0.501;
	for (TInt ii=0;ii<1000;++ii)
		x=4.0*x*(1.0-x);
	dict=CDictionaryFileStore::OpenLC(fs,name,KTestUid);
	data.LoadL(*dict);
	CleanupStack::PopAndDestroy();	// dict
	fs.Delete(name);
	CleanupStack::PopAndDestroy();	// fs
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:33,代码来源:t_stordictfs.cpp

示例5: ScanDirectory

void CStateDownload::ScanDirectory(RFs& aFs, const TDesC& aDir, const TDesC& aWild, CDesCArray* aFilesArray)
	{
	TParse parse;
	parse.Set(aWild, &aDir, NULL);
	TPtrC spec(parse.FullName());
	 
	TFindFile FindFile(aFs);
	CDir* dir;
	 
	if (FindFile.FindWildByPath(parse.FullName(), NULL, dir) == KErrNone)
		{
	    CleanupStack::PushL(dir);
	 
	    TInt count=dir->Count();
	    for(TInt i = 0; i < count; i++)
	    	{
	        parse.Set((*dir)[i].iName, &spec, NULL);
	        TEntry entry;
	        if(aFs.Entry(parse.FullName(),entry) == KErrNone)
	        	{
	        	if(!entry.IsDir())
	        		{
	        		//InsertIsqL raises a KErrAlreadyExists (-11) when inserting a duplicate
	        		TRAPD(err,aFilesArray->InsertIsqL(parse.FullName())); 
	        		}
	        	}
	        }
	    CleanupStack::PopAndDestroy(dir);
	    }
	}
开发者ID:BwRy,项目名称:core-symbian,代码行数:30,代码来源:StateDownload.cpp

示例6: ScanDirL

LOCAL_C void ScanDirL(RFs& aFs, const TDesC& aDir)
	{
	User::After(1000000);

	TParse parse;
	parse.Set(_L("t_*.exe"), &aDir, NULL);
	TPtrC spec(parse.FullName());

	test.Start(parse.DriveAndPath());
	TFindFile find(aFs);
	CDir* dir;
	
	if (!find.FindWildByPath(parse.FullName(), NULL, dir))
		{
		CleanupStack::PushL(dir);

		for(int i = 0; i < dir->Count(); i++)
			{
			parse.Set((*dir)[i].iName, &spec, NULL);

			if (i == 0)
				test.Start(parse.FullName());
			else
				test.Next(parse.FullName());

			LaunchAndWaitL(parse.FullName());
			}

		CleanupStack::PopAndDestroy(); // dir
		}
	test.End();
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:32,代码来源:AUTORUN.CPP

示例7: ConstructL

// ----------------------------------------------------------------------------
// Symbian 2nd phase constructor can leave.
// ----------------------------------------------------------------------------
//
void CWrtHarvester::ConstructL()
    {
    User::LeaveIfError( iApaSession.Connect() );
    iWidgetUIListener = CWrtHarvesterPSNotifier::NewL( this, EWidgetUIState );
    iWidgetRegListener = CWrtHarvesterPSNotifier::NewL( this, EWidgetRegAltered );
    
    User::LeaveIfError( iFs.Connect() );
    iWidgetUsbListener = CWrtUsbHandler::NewL( this, iFs );
    
    iWidgetUsbListener->Start();
    SetMSMode(0);
    
    TFileName resourceFileName;  
    TParse parse;    
    Dll::FileName (resourceFileName);           
    parse.Set(KResourceFileName, &resourceFileName, NULL); 
    resourceFileName = parse.FullName(); 
          
    CCoeEnv* coeEnv = CCoeEnv::Static(); 
    BaflUtils::NearestLanguageFile(coeEnv->FsSession(), resourceFileName); 
       
    if ( !BaflUtils::FileExists( coeEnv->FsSession(), resourceFileName ) )
        { 
        // Use resource file on the Z drive instead  
        parse.Set( KResourceDir, &KDC_RESOURCE_FILES_DIR, NULL ); 
        resourceFileName = parse.FullName();  
        BaflUtils::NearestLanguageFile( coeEnv->FsSession(),resourceFileName );            
        } 
    iResourceFileOffset = coeEnv->AddResourceFileL(resourceFileName);
    }
开发者ID:gvsurenderreddy,项目名称:symbiandump-mw4,代码行数:34,代码来源:wrtharvester.cpp

示例8: TestInstallL

LOCAL_C void TestInstallL(TInt aDrive)
	{
	// Clear the BIF folders
	theUtils->ClearBifFoldersL();

	// Create BIF database
	CBIODatabase* db = CBIODatabase::NewLC(theUtils->FileSession());

	// Create observer
	CBifObserver* obs = new(ELeave)CBifObserver;
	CleanupStack::PushL(obs);

	CBifChangeObserver* change = CBifChangeObserver::NewL(*obs, theUtils->FileSession());
	CleanupStack::PushL(change);
	change->Start();

	// Check the test BIO isn't installed
	test(!theUtils->BifInstalledL(*db, KTestBif));
	test(!obs->iFlag);

	// Short delay to check that the observer isn't fired
	CTestTimer* timer = CTestTimer::NewL();
	timer->After(10000000);
	CActiveScheduler::Start();
	delete timer;

	// Check the test BIO still isn't installed
	test(!theUtils->BifInstalledL(*db, KTestBif));
	test(!obs->iFlag);

	// Get the name of the drive
	TDriveUnit unit(aDrive);
	TPtrC drive(unit.Name());

	TParse src;
	TParse dst;

	// Copy the bif file
	theUtils->FindFileL(src, KTestDir, KTestBif1Src);
	User::LeaveIfError(dst.Set(drive, &KBifDir, &KTestBifDst));
	theUtils->FileSession().MkDirAll(dst.FullName());
	User::LeaveIfError(BaflUtils::CopyFile(theUtils->FileSession(), src.FullName(), dst.FullName()));

	// Copy the Mbm file
	theUtils->FindFileL(src, KTestDir, KTestMbm1Src);
	User::LeaveIfError(dst.Set(drive, &KBifDir, &KTestMbmDst));
	theUtils->FileSession().MkDirAll(dst.FullName());
	User::LeaveIfError(BaflUtils::CopyFile(theUtils->FileSession(), src.FullName(), dst.FullName()));

	// Wait for the notification to come through
	CActiveScheduler::Start();
	test(obs->iFlag);
	test(obs->iBioUid == KTestBif);
	test(obs->iEvent == MBifChangeObserver::EBifAdded);

	CleanupStack::PopAndDestroy(3); // change, obs, db
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:57,代码来源:t_bio_observer.cpp

示例9: GetAppPath

 TFileName CMobileOfficeAppUi::GetAppPath()
{
      TParse parse;
    //On WINS the application is on the z drive
    #ifdef __WINSCW__
      TFileName appfullname = Application()->AppFullName();
      parse.Set(_L("c:"), &appfullname, NULL);
    #else
      parse.Set( Application()->AppFullName(), NULL, NULL);
    #endif
      return ( parse.DriveAndPath() ); //Base
}
开发者ID:bohwaz,项目名称:officereader,代码行数:12,代码来源:MobileOfficeAppUi.cpp

示例10: ConstructL

// ---------------------------------------------------------------------------
//  CNSmlDmFotaAdapterDb::ConstructL()
//  Second phase constructor.
// ---------------------------------------------------------------------------
// 
void CNSmlDmFotaAdapterDb::ConstructL()
    {
    _DBG_FILE("CNSmlDmFotaAdapterDb::ConstructL(): begin");
    
    User::LeaveIfError( iFsSession.Connect() );
    User::LeaveIfError( iRdbSession.Connect() );
    iFsSession.SetSessionToPrivate( KNSmlFotaAdapterDbDrive );

    TParse name;

#ifdef SYMBIAN_SECURE_DBMS
	name.Set( KNSmlFotaAdapterDbName(), NULL, NULL );
#else
    name.Set( KNSmlFotaAdapterDbName(), KNSmlDatabasesNonSecurePath, NULL );
#endif

	TInt err = iDatabase.Open( iRdbSession,
	                           name.FullName(),
	                           KNSmlDBMSSecureMDHostOneID );
    if ( err == KErrNotFound )
        {
        CreateDatabaseL( name.FullName() );
        err = iDatabase.Open( iRdbSession,
                              name.FullName(),
                              KNSmlDBMSSecureMDHostOneID );
        User::LeaveIfError( err );
        }
    else
        {
        
        if ( ( err == KErrEof ) || ( err == KErrCorrupt ) || 
             ( err == KErrArgument ) )
            {
            // something seriously wrong with the db, delete it and try 
            // to create new
            iRdbSession.DeleteDatabase( name.FullName(),
                                        KNSmlDMHostOnePolicyUID );
            CreateDatabaseL( name.FullName() );
            err = iDatabase.Open( iRdbSession,
                                  name.FullName(),
                                  KNSmlDBMSSecureMDHostOneID );
            }
        
        User::LeaveIfError( err );
        }

    User::LeaveIfError( iFwObjectTable.Open( iDatabase,
                                             KNSmlTableFwMgmtObject ) );
    iColSet = iFwObjectTable.ColSetL();
    
    _DBG_FILE("CNSmlDmFotaAdapterDb::ConstructL(): end");
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:57,代码来源:nsmldmfotaadapterdb.cpp

示例11: setup

void CT_MruStep::setup()
	{
#if defined(__EPOC32__)
	// if we're on the rack create the directories we need
	TFullName filePath=_L("c:\\docs\\tstapp.doc");
	TFullName tempPath=_L("c:\\system\\temp\\");
	TParse parser;
	parser.Set(filePath,NULL,NULL);
	iFs.MkDirAll(parser.DriveAndPath());
	parser.Set(tempPath,NULL,NULL);
	iFs.MkDirAll(parser.DriveAndPath());
#endif
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:13,代码来源:T_MRUStep.CPP

示例12: DoChangeDriveL

void CMsvIndexContext::DoChangeDriveL(TUint aNewDriveIndex, TBool aIsRemovePartial, TDriveNumber& aNewDriveNumber)
	{
	iObserverStatus = NULL;
	TMsvPreferredDrive driveEntry;
	CMsvPreferredDriveList::GetDriveList()->DriveInfoL(aNewDriveIndex, driveEntry);

	aNewDriveNumber = driveEntry.driveNum;
	if(EMsvMessageStoreUnavailableStatus == driveEntry.status)
		{
		// Create the database and all standard table.
		CMsvDBAdapter::CreateDBL(driveEntry.driveNum);
		
		// Update the drive status.
		CMsvPreferredDriveList::GetDriveList()->UpdateDriveStatusL(aNewDriveIndex, EMsvMessageStoreAvailableStatus);
		
		TParse parse;
		TPtrC drive(TDriveUnit(driveEntry.driveNum).Name());
		parse.Set(KMsvDefaultIndexFile2(), &drive, NULL);
		iMessageFolder = parse.DriveAndPath();
		
		ResetAndCreateNewMailStoreL();
		iRunMailInit = ETrue;
			
		// Perform ChangeDrive operation.
		iIndexAdapter->ChangeDriveL(aNewDriveIndex, aIsRemovePartial);
		
		// Read initial entries from resources
		CreateStandardEntriesFromResourceFileL(KCurrentDriveId);
		iIndexAdapter->SetLocalServiceComplete();
		}
	else
		{
		// Update the message folder local variable.
		TParse parse;
		TPtrC drive(TDriveUnit(driveEntry.driveNum).Name());
		parse.Set(KMsvDefaultIndexFile2(), &drive, NULL);
		iMessageFolder = parse.DriveAndPath();
		
		ResetAndCreateNewMailStoreL(EFalse);
		// Perform ChangeDrive operation.
		iIndexAdapter->ChangeDriveL(aNewDriveIndex, aIsRemovePartial);			
		iRunMailInit = EFalse;
		}
	
	// Create service directories in new drive.
	TRAP_IGNORE(DoCreateServiceDirsL(KCurrentDriveId));
	
	TRAP_IGNORE(LocalizeStandardFoldersL());
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:49,代码来源:indexcontext.cpp

示例13: CreateFlogger

EXPORT_C
#if defined (_DEBUG)
/**
Function to create log file
@param aFileName The descriptor that holds the name of the log file to be created.
@param aShowDate If set to 1, the date of creation of the log file is recorded.
@param aShowTime If set to 1, the time of creation of the log file is recorded.
*/
void THttpLogger::CreateFlogger(const TDesC& aFileName, TInt aShowDate, TInt aShowTime)
//
//	Create log file in directory KLogsdir\KWapLogsDirName - Note: ingore Drive and Path of aFilename
	{
	if(!iLogger)
		{
		iLogger = new RFileLogger;
		}

	if(iLogger)
		{
		TInt error = iLogger->Connect();
		if(error == KErrNone)
			{
			TParse p;
			p.Set(aFileName, NULL, NULL);
			iLogger->CreateLog(KHttpLogsDirName, p.NameAndExt(), EFileLoggingModeOverwrite);
			iLogger->SetDateAndTime(aShowDate, aShowTime);
			iLogger->Write(KTestHeader);
			}
		else
			User::InfoPrint(_L("Flogger connect failed"));
		}
	else
		User::InfoPrint(_L("Flogger create failed"));
	}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:34,代码来源:httplogger.cpp

示例14: GetTitleL

// ---------------------------------------------------------
// CNSmlDsProvisioningAdapter::GetTitleL
// ---------------------------------------------------------
void CNSmlDsProvisioningAdapter::GetTitleL()
	{
	if( iTitle == 0 )
		{
		RFs	fs;
		User::LeaveIfError( fs.Connect() );
		CleanupClosePushL( fs );

		TFileName fileName;
		TParse parse;
		parse.Set( KNSmlDsPovisioningDirAndResource, &KDC_RESOURCE_FILES_DIR, NULL );
		fileName = parse.FullName();

		RResourceFile resourceFile;
		BaflUtils::NearestLanguageFile( fs, fileName );
		resourceFile.OpenL( fs, fileName );
		CleanupClosePushL( resourceFile );

		HBufC8* dataBuffer = resourceFile.AllocReadLC( R_SYNC_PROVISIONING_TITLE );
			
		TResourceReader reader;
		reader.SetBuffer( dataBuffer ); 
		iTitle = reader.ReadHBufC16L(); 
		CleanupStack::PopAndDestroy( 3 ); //fs, resourcefile, databuffer
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:29,代码来源:NSmlDsProvisioningAdapter.cpp

示例15: DirectFileL

/**
@SYMTestCaseID          SYSLIB-STORE-CT-3350
@SYMTestCaseDesc	    Direct file store verification test
@SYMTestPriority 	    High
@SYMTestActions  	    Open a corrupted direct store file
@SYMTestExpectedResults the function called leaves with KErrNotSupported
@SYMDEF                 DEF100757
*/
LOCAL_C void DirectFileL()
	{
	Test.Next(_L(" @SYMTestCaseID:SYSLIB-STORE-CT-3350 Creating Direct File Store "));
	TDriveUnit drive(static_cast<TUint>(RFs::GetSystemDrive()));	
	TParse parse;
	parse.Set(drive.Name(), &KTestDirectFileName, NULL);
	
	// create a direct file store
	TheStore=CDirectFileStore::ReplaceLC(TheFs,parse.FullName(),EFileWrite);
	TheStore->SetTypeL(TheStore->Layout());
	TInt8 val=100;
	TStreamId id=TheSink.CreateL(*TheStore);
	TheSink<<val;
	TheSink.Close();
	TheStore->SetRootL(id);
	TheStore->CommitL();
	CleanupStack::PopAndDestroy(TheStore);

	// corrupt the store file
	RFile file;

	User::LeaveIfError(file.Open(TheFs,parse.FullName(),EFileWrite));
	CleanupClosePushL(file);
	User::LeaveIfError(file.Write(KTestJunkData,sizeof(TCheckedUid)));
	CleanupStack::PopAndDestroy(&file);

	// the CDirectFileStore::OpenLC should leave if passed the corrupted store file name
	TheStore = NULL;
	TRAPD(r, \
			{\
			TheStore=CDirectFileStore::OpenLC(TheFs,parse.FullName(),EFileRead);\
			CleanupStack::PopAndDestroy(TheStore); \
			}\
		);
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:42,代码来源:t_storverify.cpp


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