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


C++ GetStringFromConfig函数代码示例

本文整理汇总了C++中GetStringFromConfig函数的典型用法代码示例。如果您正苦于以下问题:C++ GetStringFromConfig函数的具体用法?C++ GetStringFromConfig怎么用?C++ GetStringFromConfig使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: _LIT

/**
  @return - ETrue if enum was resolved to integral value, else EFalse
  @param - aSectName Enum file section to be read
  @param - aKeyName  Key/Enum to be read
  @param - aResult   Updated enum's integral value
  */
TBool CAppfwkDscStoreTestStepBase::GetEnumFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TInt& aResult)
	{
	_LIT(KEnumFileNotSet, "EnumFile");
	__ASSERT_ALWAYS(iEnumData, User::Panic(KEnumFileNotSet, KErrNotFound));
	
	TBool readResult = EFalse;
	TPtrC enumString;
	
	readResult = GetStringFromConfig(aSectName, aKeyName, enumString);
	
	if (readResult)
		{
		readResult = iEnumData->FindVar(KEnums, enumString, aResult);
		}
	else
		{
		_LIT(KEnumKeyNotfound, "EnumKey %S not found");
		WARN_PRINTF2(KEnumKeyNotfound, &aKeyName);
		}
	
	return readResult;
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:28,代码来源:tdscstore_step_base.cpp

示例2: while

void CDataWrapperBase::InitialiseL()
	{
	CDataWrapper::InitialiseL();

	TBuf<KMaxTestExecuteCommandLength>	tempStore;
	TPtrC		fileName;
	TBool		moreData=ETrue;
	TBool		index=0;
	while ( moreData )
		{
		tempStore.Format(KFile(), ++index);
		moreData=GetStringFromConfig(KIncludeSection, tempStore, fileName);
		
		if (moreData)
			{
			CIniData*	iniData=CIniData::NewL(fileName);
			CleanupStack::PushL(iniData);
			iInclude.Append(iniData);
			CleanupStack::Pop(iniData);
			}
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:22,代码来源:DataWrapperBase.cpp

示例3: INFO_PRINTF1

/**
 *
 * Test step Preamble.
 *
 * @xxxx
 * 
 */
enum TVerdict CTestStepPlayerAllocFailOpenDesc::DoTestStepPreambleL(void)
	{
	 enum TVerdict verdict;
	 // this installs the scheduler
	 verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();

	// Printing to the console and log file
	INFO_PRINTF1(_L("MM-MMF-ACLNT-U-0105-CP"));
	INFO_PRINTF1(_L("this is Alloc failure test of CMdaAudioPlayerUtility::OpenDesL"));

	iError = KErrNone; //KErrTimedOut;

	if(!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName7"), iFileName))
		{
		//INFO_PRINTF2(_L("file name %s not found..."), fileptr);
		return EInconclusive;
		}

	// load the contents of an audio file to a Descriptor
	TInt fSize;

	iFs.Connect();
	if ( iFile.Open(iFs, iFileName, EFileRead) != KErrNone )
		return EInconclusive;
	iFile.Size(fSize);
	// load the sound from the file to a Descriptor
	iBuf = HBufC8::NewL( fSize );
	TPtr8 buf = iBuf->Des();
	iFile.Read(buf);

	iFile.Close();
	iFs.Close();

	// create a CMdaAudioPlayerUtility
	if ( (iPlayer = CMMFMdaAudioPlayerUtility::NewL(*this)) == NULL )
		verdict = EInconclusive;

	return verdict;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:46,代码来源:TestStepPlayerAllocFailOpenDesc.cpp

示例4: DoTestStepPreambleL

/**
 *
 * Test step Preamble.
 *
 * @xxxx
 * 
 */
enum TVerdict CTestStepRecorderSendCustomCommandAsync::DoTestStepPreambleL(void)
	{
	enum TVerdict verdict;
	// this installs the scheduler
	verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();
	if (verdict != EPass)
		return verdict;

	if(!GetStringFromConfig(_L("SectionOne"), _L("AudioFNameTestController"), iFileName))
		{
		 //INFO_PRINTF2(_L("file name %s not found..."), fileptr);
		 return EInconclusive;
		}
		
	iAsyncObserver = new (ELeave) CAsyncObserver;

	// Printing to the console and log file
	INFO_PRINTF1(iTestStepName);
	INFO_PRINTF1(_L("this test is a test of CMMFMdaAudioRecorderUtility::CustomCommandAsync()"));

	return verdict;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:29,代码来源:TESTSTEPRecorderVARIOUS.cpp

示例5: _LIT

/*
   This function performs operations based on sequence specified in the ini file
   @param  None
   @return None
*/
void CTestRControlChannel::SequenceOperationsL()
	{
	_LIT(KInfoLogFile, "CTestRControlChannel::SequenceOperationsL().... \n");
	INFO_PRINTF1(KInfoLogFile);
	RArray<TPtrC> sequenceList;
	CleanupClosePushL(sequenceList);
	TPtrC listOfSequences;
	_LIT(KListOfSequences, "listofsequences");
	GetStringFromConfig(ConfigSection(), KListOfSequences, listOfSequences);

	TokenizeStringL(listOfSequences, sequenceList);
	TInt numOperations = sequenceList.Count();

	for(TInt i(0); i < numOperations; i++)
		{
//		SetCurrentSection(sequenceList[i]);
		PerformDesiredOperationsL(sequenceList[i]);
		}
	CleanupStack::PopAndDestroy(); 
	_LIT(KInfoLogFile1, "CTestRControlChannel::SequenceOperationsL() End.... \n");
	INFO_PRINTF1(KInfoLogFile1);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:27,代码来源:testrcontrolchannel.cpp

示例6: GetStringFromConfig

TInt CEsockTest29::OpenSockets()
// Func to open the sockets
	{
	iSockServ.Connect();
	GetStringFromConfig(KSection29, KTestSocketType, iProtocol);
	TInt err = OpenDummySocket();
	if(err != KErrNone)	
		{
		return err;
		}
	if( iProtocol.Compare(KUdp) == 0 )
		{
		err = OpenTestUdpSocket();
		INFO_PRINTF1( _L("UDP Test Socket Opened") );
		}
	else
		{
		err = OpenTestTcpSocket();	
		INFO_PRINTF1( _L("TCP Test Socket Opened") );	
		}
	return err;
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:22,代码来源:EsockTestSection29.cpp

示例7: GetStringFromConfig

/** Compare the various character sets
@test
*/		
void CTestHtmlToCrtConverterBufferStep::ComparisonForVariousCharsetsL()
	{
	// Get different character sets from the ini file
	TPtrC	sourceData;
	GetStringFromConfig(ConfigSection(), KSourceText, sourceData);
	
	HBufC8*	tempSource = HBufC8::NewLC(sourceData.Length());
	tempSource->Des().Copy(sourceData);
	TPtr8	source(tempSource->Des());
	
	// Compare the source text with the text converted by the characterset converter
	if ( DoComparisonL(source) == 0 )
		{
		INFO_PRINTF1(KInfoComparisionSuccessful);
		}
	else
		{
		ERR_PRINTF1(KErrInComparison);
		SetTestStepResult(EFail);
		}
	CleanupStack::PopAndDestroy(tempSource);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:25,代码来源:TestHtmlToCrtConverterBufferStep.cpp

示例8: INFO_PRINTF1

/**
 *
 * Test step Preamble.
 *
 * @xxxx
 * 
 */
enum TVerdict CTestStepRecorderPlayEOF::DoTestStepPreambleL(void)
	{
	 enum TVerdict verdict;
	 // this installs the scheduler
	 verdict = CTestStepUnitMMFAudClient::DoTestStepPreambleL();

	// Printing to the console and log file
	INFO_PRINTF1(iTestStepName);
	INFO_PRINTF1(_L("this is a test of CMdaAudioRecorderUtility..."));
	INFO_PRINTF1(_L("Play a clip from the middle to EOF, then set the position to the clip's"));
	INFO_PRINTF1(_L("duration, call play and then immediately read the position and check it's"));
	INFO_PRINTF1(_L("not longer than the file's duration"));

	if(!GetStringFromConfig(_L("SectionOne"), _L("AudioPlayFName2"), iFileName))
		{
		INFO_PRINTF2(_L("file name %S not found..."), &iFileName);
		return EInconclusive;
		}

	// create the Recorder utility
	if ( (iRecorder = CMMFMdaAudioRecorderUtility::NewL(*this)) == NULL )
		return EInconclusive;

	iRecorder->OpenFileL( iFileName );
	CActiveScheduler::Start(); 

	if (iRecorder == NULL ||
		iError != KErrNone ||
		iRecorder->State() != CMdaAudioRecorderUtility::EOpen)
		return EInconclusive;
	
	// initialize a callback timer
	TRAPD(err, iTimer = CCallbackTimer::NewL(*this));
	if (err != KErrNone)
		return EInconclusive;
	CActiveScheduler::Add(iTimer);

	return verdict;
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:46,代码来源:TestStepRecorderPosPlay.cpp

示例9: SetAction

/**
Test SetAction()
*/
void CT_InquirySockAddrData::DoCmdSetAction(const TDesC& aSection)
	{
	TBool	foundParameter=EFalse;
	TPtrC	flagName;
	TInt	flagValue=0;
	if (GetStringFromConfig(aSection, KFlag(), flagName) )
		{
		foundParameter=ETrue;
		if (CT_BTUtil::GetIntValue(flagName, flagValue))
			{
			INFO_PRINTF3(_L("The flag to set: %S , its value: %d" ), &flagName, flagValue);
			
			INFO_PRINTF1(_L("TInquirySockAddr SetAction Call"));
			iData->SetAction(KHostResInquiry | KHostResName);
			}
		}
	
	if ( !foundParameter )
		{
		ERR_PRINTF2(KLogMissingParameter, &KFlag());
		SetBlockResult(EFail);		
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:26,代码来源:T_InquirySockAddrData.cpp

示例10: DestroyData

/** Creates an instance of CT_DataLinkedTypefaceSpecification class */
void CT_DataLinkedTypefaceSpecification::DoCmdNewL(const TDesC& aSection)
	{
	// cleanup if any
	DestroyData();

	// call new operator
	TPtrC name;
	if (!GetStringFromConfig(aSection, KFldTypefaceName, name))
		{
		ERR_PRINTF2(KLogMissingParameter, &KFldTypefaceName);
		SetBlockResult(EFail);
		}
	else
		{
		INFO_PRINTF1(_L("execute CLinkedTypefaceSpecification::NewLC"));
		TRAPD(err, iSpec = CLinkedTypefaceSpecification::NewLC(name); CleanupStack::Pop(iSpec));
		if (err != KErrNone)
			{
			ERR_PRINTF2(KLogError, err);
			SetError(err);
			}
		}
	}
开发者ID:fedor4ever,项目名称:default,代码行数:24,代码来源:T_DataLinkedTypefaceSpecification.cpp

示例11: GetFontSpecFromConfig

TBool CDataWrapperBase::GetFontSpecFromConfig(const TDesC& aSectName,const TDesC& aKeyName,TFontSpec& aResult)
	{
	TBuf<KMaxTestExecuteCommandLength>	tempStore;


	TPtrC	name;
	tempStore.Format(KFormatEntryField, &aKeyName, &KTagFontSpecName);
	TBool	ret=GetStringFromConfig(aSectName, tempStore, name);

	TInt	height;
	tempStore.Format(KFormatEntryField, &aKeyName, &KTagFontSpecHeight);
	if ( !GetIntFromConfig(aSectName, tempStore, height) )
		{
		ret=EFalse;
		}

	if ( ret )
		{
		aResult=TFontSpec(name, height);
		}

	return ret;
	}
开发者ID:fedor4ever,项目名称:default,代码行数:23,代码来源:DataWrapperBase.cpp

示例12: _LIT

TVerdict CTimeZoneOffsetCheck::doTestStepPreambleL()
	{	
	_LIT(KLocationTag,"City");
	_LIT(KOldOffsetTag, "OldOffset");
	_LIT(KNewOffsetTag, "NewOffset");
	
	TPtrC ptr;
	
	// read the time zone by name 
	GetStringFromConfig(ConfigSection(), KLocationTag, ptr);
	iLocation.Copy(ptr);
	
	// read the expected offsets 
	TInt offsetInMins;
	GetIntFromConfig(ConfigSection(), KOldOffsetTag, offsetInMins);
	iOldOffset = offsetInMins;
	
	offsetInMins = 0;
	GetIntFromConfig(ConfigSection(), KNewOffsetTag, offsetInMins);
	iNewOffset = offsetInMins;
	
	return TestStepResult();
	}	
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:23,代码来源:TimeZoneOffsetCheck.cpp

示例13: DestroyData

void CT_DataSdpAgent::DoCmdNewL(const TDesC& aSection)
	{
	DestroyData();
	TPtrC	tBTDevAddrName;
	TBool	foundParameter=EFalse;	
	INFO_PRINTF1(_L("CSdpAgent NewL call"));
	if( GetStringFromConfig(aSection, KTBTDevAddr(), tBTDevAddrName))
		{
		foundParameter=ETrue;			
		CT_BTDevAddrData* tBTDevAddrData=static_cast<CT_BTDevAddrData*>(GetDataWrapperL(tBTDevAddrName));
		const TBTDevAddr* btDevAddr = tBTDevAddrData->GetAddress();
		TRAPD(err, iSdpAgent = CSdpAgent::NewL(*this, *btDevAddr));
		if(err != KErrNone)
			{
			ERR_PRINTF2(_L("CSdpAgent NewL failed with error %d"), err);
			SetError(err);
			}
   		}
   	TInt	intBtDevAddr=0;	
	if( GetIntFromConfig(aSection, KIntDevAddr(), intBtDevAddr))
		{
		foundParameter=ETrue;			
		const TBTDevAddr btDevAddr(intBtDevAddr);
		TRAPD(err, iSdpAgent = CSdpAgent::NewL(*this, btDevAddr));
		if(err != KErrNone)
			{
			ERR_PRINTF2(_L("CSdpAgent NewL failed with error %d"), err);
			SetError(err);
			}
   		}  	
   		
	if( !foundParameter )
		{
		ERR_PRINTF2(_L("Missing parameter %S"), &KIntDevAddr());
		SetBlockResult(EFail);
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:37,代码来源:T_DataSdpAgent.cpp

示例14: _LIT

/**
 * Updates the specified number of contact items from the database
 */
void CTestContactViewCRUDOperationsStep::UpdateContactEntriesL()
	{
	_LIT(KNumOfContactsToBeUpdated, "NumOfContactsToBeUpdated");
	TInt numOfContactToBeUpdated;
	GetIntFromConfig(ConfigSection(), KNumOfContactsToBeUpdated, numOfContactToBeUpdated);

	TPtrC deleteContactInGroups;
	_LIT(KDeleteContactInGroups, "grouplist");
	GetStringFromConfig(ConfigSection(), KDeleteContactInGroups, deleteContactInGroups);


	if(deleteContactInGroups != KNullDesC)
		{
		UpdateContactsInGroupL(numOfContactToBeUpdated, deleteContactInGroups);
		}
	else
		{
		CCntFilter* filter = CCntFilter::NewL();
		CleanupStack::PushL(filter);
		filter->SetContactFilterTypeCard(ETrue);
		DatabaseReference().FilterDatabaseL(*filter);

		for(TInt i = 0; i < numOfContactToBeUpdated; ++i)
			{
			TContactItemId contactItemId = (*filter->iIds)[i];
			CContactItem* contactItem = DatabaseReference().ReadContactL(contactItemId);
			CleanupStack::PushL(contactItem);
			UpdateFieldsL(*contactItem);
			CContactItem* updatedContactItem = DatabaseReference().UpdateContactLC(contactItemId, contactItem);
			CleanupStack::PopAndDestroy(updatedContactItem);
			CleanupStack::PopAndDestroy(contactItem);
			}

		CleanupStack::PopAndDestroy(filter);
		}
	}
开发者ID:Esclapion,项目名称:qt-mobility,代码行数:39,代码来源:testcontactviewcrudoperationsstep.cpp

示例15: GetStringFromConfig

void CTestCalIndexFileAddEntryStep::GetEntryInfoFromConfigL(RPointerArray<CConfigTestEntryInfo>& aEntriesInfo, TInt& aNumEntries, TBool aPerformCrudOps)
	{
	// first get the default entries from the file
	CTestCalIndexFileStepBase::GetEntryInfoFromConfigL(aEntriesInfo, aNumEntries, aPerformCrudOps);
	
	if (aPerformCrudOps)
		{
		// now add the new entry info to the list
		TPtrC entryString;
		TBool readRes = EFalse;
		readRes = GetStringFromConfig(ConfigSection(), KAddEntry, entryString);
		if (!readRes)
			{
			INFO_PRINTF1(_L("Error in CTestCalIndexFileAddEntryStep::GetEntryInfoFromConfigL - entrytoadd not found in config file"));
			User::Leave(KErrNotFound);
			}
		CConfigTestEntryInfo* inf = new(ELeave)CConfigTestEntryInfo();
		CleanupStack::PushL(inf);
		ParseEntryStringL(*inf, entryString);
		aEntriesInfo.Append(inf);
		CleanupStack::Pop(inf); // now held in array
		aNumEntries++;
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:24,代码来源:TestCalIndexFileAddEntryStep.cpp


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