本文整理汇总了C++中TResourceReader::ReadDesCArrayL方法的典型用法代码示例。如果您正苦于以下问题:C++ TResourceReader::ReadDesCArrayL方法的具体用法?C++ TResourceReader::ReadDesCArrayL怎么用?C++ TResourceReader::ReadDesCArrayL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TResourceReader
的用法示例。
在下文中一共展示了TResourceReader::ReadDesCArrayL方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadDesCArrayLC
// ----------------------------------------------------------------------------
// Read array of descriptors, leave on cleanup stack
// ----------------------------------------------------------------------------
//
EXPORT_C CDesCArrayFlat* CMPXResource::ReadDesCArrayLC(TInt aResourceId)
{
//MPX_DEBUG1("CMPXResource::ReadDesCArrayLC");
TResourceReader resReader;
HBufC8* readBuffer = iResourceFile.AllocReadLC(aResourceId);
resReader.SetBuffer(readBuffer);
CDesCArrayFlat* descArray = resReader.ReadDesCArrayL();
CleanupStack::PopAndDestroy(readBuffer);
//MPX_DEBUG1("CMPXResource::ReadDesCArrayLC End");
CleanupStack::PushL(descArray);
return descArray;
}
示例2: TestArrayL
/**
@SYMTestCaseID SYSLIB-BAFL-CT-0434
@SYMTestCaseDesc Tests for TResourceReader::ReadDesCArrayL() function
@SYMTestPriority Medium
@SYMTestActions Attempt to read an array resource
@SYMTestExpectedResults Tests must not fail
@SYMREQ REQ0000
*/
void TRsReadTester::TestArrayL()
{
test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0434 Test reading ARRAY resource "));
TResourceReader reader;
CreateResourceReaderLC(reader,SYS_ARRAY_ONE);
CDesCArray* desArray=reader.ReadDesCArrayL();
CleanupStack::PopAndDestroy();
test(desArray->Count()==5);
test((*desArray)[0]==_L("Esc"));
test((*desArray)[1]==_L("Enter"));
test((*desArray)[2]==_L("Tab"));
test((*desArray)[3]==_L("Del"));
test((*desArray)[4]==_L("Space"));
delete(desArray);
}
示例3: ConstructL
// Second-phase constructor
void CPalettes::ConstructL(TInt aNameResource, TInt aDataResource) {
// Read palette names
TResourceReader reader;
CCoeEnv::Static()->CreateResourceReaderLC(reader, aNameResource);
iPaletteNames = reader.ReadDesCArrayL();
iNumPalettes = iPaletteNames->Count();
CleanupStack::PopAndDestroy(); // reader
// Read palette data
iPaletteData = new (ELeave) TUint8[KPaletteBytes*iNumPalettes];
CCoeEnv::Static()->CreateResourceReaderLC(reader, aDataResource);
TInt count = reader.ReadInt16();
if ( count != iNumPalettes ) {
User::Panic(KPanic, EPalettePanicBadResource);
}
reader.Read(iPaletteData, KPaletteBytes*iNumPalettes);
CleanupStack::PopAndDestroy(); // reader
}
示例4: ConstructL
void CMTPProxyDpConfigMgr::ConstructL()
{
OstTraceFunctionEntry0( CMTPPROXYDPCONFIGMGR_CONSTRUCTL_ENTRY );
TUint32 resourceId = iFramework.DataProviderConfig().UintValue(MMTPDataProviderConfig::EOpaqueResource);
// Reading from resource file mtpproxydp_config.rss
RResourceFile resourceFile;
CleanupClosePushL(resourceFile);
resourceFile.OpenL(iFramework.Fs(), iFramework.DataProviderConfig().DesCValue(MMTPDataProviderConfig::EResourceFileName));
TResourceReader resourceReader;
HBufC8* buffer = resourceFile.AllocReadLC(resourceId);
resourceReader.SetBuffer(buffer);
FileMappingStruct st;
const TInt numberOfEntries=resourceReader.ReadInt16();
for(TInt count =0;count<numberOfEntries ; count++)
{
st.iDpUid=resourceReader.ReadInt32();
st.iFileArray = resourceReader.ReadDesCArrayL();
InsertToMappingStruct(st);
}
CleanupStack::PopAndDestroy(2, &resourceFile);
OstTraceFunctionExit0( CMTPPROXYDPCONFIGMGR_CONSTRUCTL_EXIT );
}