本文整理汇总了C++中TResourceReader::ReadInt16方法的典型用法代码示例。如果您正苦于以下问题:C++ TResourceReader::ReadInt16方法的具体用法?C++ TResourceReader::ReadInt16怎么用?C++ TResourceReader::ReadInt16使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TResourceReader
的用法示例。
在下文中一共展示了TResourceReader::ReadInt16方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConstructFromResourceL
EXPORT_C void CEikHotKeyTable::ConstructFromResourceL(TInt aResourceId)
{
TResourceReader reader;
CCoeEnv::Static()->CreateResourceReaderLC(reader,aResourceId);
iNumberPlain=reader.ReadInt16();
if (iNumberPlain)
{
const SEikHotKey* ptr=(const SEikHotKey*)reader.Ptr();
reader.Advance(iNumberPlain*sizeof(SEikHotKey));
AppendL(ptr,iNumberPlain);
}
iNumberCtrl=reader.ReadInt16();
if (iNumberCtrl)
{
const SEikHotKey* ptr=(const SEikHotKey*)reader.Ptr();
reader.Advance(iNumberCtrl*sizeof(SEikHotKey));
AppendL(ptr,iNumberCtrl);
}
iNumberShiftCtrl=reader.ReadInt16();
if (iNumberShiftCtrl)
{
const SEikHotKey* ptr=(const SEikHotKey*)reader.Ptr();
reader.Advance(iNumberShiftCtrl*sizeof(SEikHotKey));
AppendL(ptr,iNumberShiftCtrl);
}
CleanupStack::PopAndDestroy();
}
示例2: TestEHKEYConstructFromResourceL
// -----------------------------------------------------------------------------
// CTestSDKCFD::TestEHKEYConstructFromResourceL
// -----------------------------------------------------------------------------
//
TInt CTestSDKEIKHKEYT::TestEHKEYConstructFromResourceL( CStifItemParser& /*aItem*/ )
{
CEikHotKeyTable* hotkeytableptr = new( ELeave ) CEikHotKeyTable;
CleanupStack::PushL( hotkeytableptr );
hotkeytableptr->ConstructFromResourceL( R_TEST_HOTKEYS );
TResourceReader reader;
CCoeEnv::Static()->CreateResourceReaderLC(reader,R_TEST_HOTKEYS);
TInt numberPlain( KZero );
numberPlain = reader.ReadInt16();
if( numberPlain )
{
const SEikHotKey* ptr=(const SEikHotKey*)reader.Ptr();
reader.Advance(numberPlain*sizeof(SEikHotKey));
TBool flag(EFalse);
TInt keycode( KZero );
TInt commandId( KZero );
TInt modifires( KZero );
commandId = ptr->iCommandId;
flag = hotkeytableptr->HotKeyFromCommandId( commandId, keycode, modifires );
STIF_ASSERT_TRUE( flag );
}
TInt numberCtrl( KZero );
numberCtrl = reader.ReadInt16();
if( numberCtrl )
{
const SEikHotKey* ptr=(const SEikHotKey*)reader.Ptr();
reader.Advance(numberCtrl*sizeof(SEikHotKey));
TBool flag(EFalse);
TInt keycode( KZero );
TInt commandId( KZero );
TInt modifires(EModifierCtrl);
commandId = ptr->iCommandId;
flag = hotkeytableptr->HotKeyFromCommandId( commandId, keycode, modifires );
STIF_ASSERT_TRUE( flag );
}
TInt numberShiftCtrl( KZero );
numberShiftCtrl = reader.ReadInt16();
if( numberShiftCtrl )
{
const SEikHotKey* ptr=(const SEikHotKey*)reader.Ptr();
reader.Advance(numberShiftCtrl*sizeof(SEikHotKey));
TBool flag(EFalse);
TInt keycode( KZero );
TInt commandId( KZero );
TInt modifires(EModifierShift|EModifierCtrl);
commandId = ptr->iCommandId;
flag = hotkeytableptr->HotKeyFromCommandId( commandId, keycode, modifires );
STIF_ASSERT_TRUE( flag );
}
CleanupStack::PopAndDestroy( KTwo );//reader, hotkeytableptr
return KErrNone;
}
示例3: AppendFromResourceL
EXPORT_C void CAknIconArray::AppendFromResourceL(TResourceReader& aReader)
{
TInt type = aReader.ReadInt16();
switch (type)
{
case EAknIconArraySimple:
break; // go to the actual reader
case EAknIconArrayComplex:
{
TInt count_a = aReader.ReadInt16();
while(count_a-- > 0)
{
// recursive algorithm.
AppendFromResourceL(aReader);
}
}
return;
default:
aReader.Rewind(2);
};
// this reads AKN_ICON_ARRAY *except* the type field!
HBufC* bmpName = GetBmpNameLC(aReader);
TInt count = aReader.ReadInt16();
SetReserveL(Count() + count);
while (count-- > 0)
{
TInt32 iconId = aReader.ReadInt32();
TInt32 maskId = aReader.ReadInt32();
CFbsBitmap* bitmap;
CFbsBitmap* mask;
AknIconUtils::CreateIconLC( bitmap, mask, *bmpName, iconId, maskId );
CGulIcon* icon = CGulIcon::NewL(bitmap, mask);
CleanupStack::Pop(2); // mask, bitmap
// Following AppendL call cannot leave due to lack of memory because
// of SetReserveL above. This is why there is no need to push icon
// on the cleanup stack.
AppendL(icon);
}
CleanupStack::PopAndDestroy(); // bmpName
}
示例4: CreateStandardEntriesFromResourceFileL
/**
* CreateStandardEntriesFromResourceFileL()
* @param None:
*
* Will read messaging resource file and create entries.
*/
void CMsvIndexContext::CreateStandardEntriesFromResourceFileL(TUint aDriveId)
{
// Read initial entries from resources
TResourceReader reader;
reader.SetBuffer(iBuf);
const TInt numberOfEntries = reader.ReadInt16();
for (TInt index=0; index < numberOfEntries; ++index)
{
TMsvEntry newEntry;
// Values from resource file
newEntry.iId = MaskTMsvId(aDriveId, reader.ReadInt32());
newEntry.iParentId = reader.ReadInt32();
newEntry.iServiceId = reader.ReadInt32();
newEntry.iType.iUid = reader.ReadInt32();
newEntry.iMtm.iUid = reader.ReadInt32();
newEntry.iData = reader.ReadInt32();
newEntry.iDescription.Set(reader.ReadTPtrC());
newEntry.iDetails.Set(reader.ReadTPtrC());
newEntry.iDate.UniversalTime();
newEntry.iSize=0;
// Create the new entry.
// This is required to create associated service directory.
User::LeaveIfError(iServer.AddEntry(this, newEntry, KMsvServerId, EFalse));
}
}
示例5: GetSystemDrivesL
// ---------------------------------------------------------------------------
// CAknMemorySelectionDialogMultiDrive::GetSystemDrivesL
// ---------------------------------------------------------------------------
//
void CAknMemorySelectionDialogMultiDrive::GetSystemDrivesL( TInt aUserDefinedId )
{
TInt locations = 0;
TResourceReader reader;
if( aUserDefinedId )
{
iCoeEnv->CreateResourceReaderLC( reader, aUserDefinedId );
reader.ReadTPtrC(); //Rede title
reader.ReadTPtrC(); // Read left softkey text.
reader.ReadTPtrC(); // Read right softkey text.
locations = reader.ReadInt16();
if ( locations > 0 )
{
// Read user defined data into model
iModel->ReadUserDefinedDataL( reader, locations );
}
CleanupStack::PopAndDestroy(); // reader
}
//Update root path and default folder arrays.
iModel->UpdateDataArraysL();
// Updates items in listbox.
iModel->UpdateItemsL();
}
示例6:
/**
Static private utility used by exported inline functions to read from resource file.
@param aResourceId
@param aEnv May be Null
@param aSize Specifies integer size: EResourceInt8, EResourceInt16, EResourceInt32
@return Integer value read from resource. May be 8, 16 or 32 bit value.
*/
EXPORT_C TInt32 EikResourceUtils::ReadResourceIntL(TInt aResourceId,CEikonEnv* aEnv,TResourceTypeInt aSize)
//
// Read a resource specifying a number
//
{
if (aEnv==NULL)
aEnv=CEikonEnv::Static();
__ASSERT_DEBUG(aEnv!=NULL,Panic(EEikPanicResourceNonEnvironment));
TResourceReader reader;
aEnv->CreateResourceReaderLC(reader,aResourceId);
TInt32 value=0;
switch(aSize)
{
case EResourceInt8:
value=reader.ReadInt8();
break;
case EResourceInt16:
value=reader.ReadInt16();
break;
case EResourceInt32:
value=reader.ReadInt32();
break;
default:
Panic(EEikPanicResourceInvalidNumberType);
}
CleanupStack::PopAndDestroy(); // resource reader
return(value);
}
示例7: ConstructFromResourceL
EXPORT_C void CEikTextListBox::ConstructFromResourceL(TResourceReader& aReader)
{
_AKNTRACE_FUNC_ENTER;
RestoreCommonListBoxPropertiesL(aReader);
iRequiredCellCharWidth = aReader.ReadInt16();
TInt array_id = aReader.ReadInt32();
if (array_id)
{
CDesCArray* desArray = iCoeEnv->ReadDesCArrayResourceL(array_id);
CleanupStack::PushL(desArray);
iModel = new(ELeave) CTextListBoxModel;
((CTextListBoxModel*)iModel)->ConstructL(desArray);
CleanupStack::Pop();
}
else
{
iModel = new(ELeave) CTextListBoxModel;
((CTextListBoxModel*)iModel)->ConstructL();
}
CreateItemDrawerL();
((CTextListItemDrawer*)iItemDrawer)->SetCellWidthInChars(iRequiredCellCharWidth);
CreateViewL();
UpdateViewColors();
UpdateItemDrawerColors();
_AKNTRACE_FUNC_EXIT;
}
示例8: ReadFromResource
void TAknNoteResData::ReadFromResource(TResourceReader& aResReader)
{
iResId = aResReader.ReadInt32();
iTimeout = STATIC_CAST(CAknNoteDialog::TTimeout, aResReader.ReadInt32());
iTone = STATIC_CAST(CAknNoteDialog::TTone, aResReader.ReadInt16());
iText = aResReader.ReadTPtrC();
}
示例9: ConstructFromResourceL
// -----------------------------------------------------------------------------
// CPIMLocalizationData::ConstructFromResourceL
// -----------------------------------------------------------------------------
//
void CPIMLocalizationData::ConstructFromResourceL(
RResourceFile& aResourceFile,
TResourceReader& aReader)
{
TInt listCount(aReader.ReadInt16());
__ASSERT_DEBUG(listCount > iSubType,
User::Panic(KPIMPanicCategory, EPIMPanicGeneral));
// Find the correct resource structure for the requested sub-type. If
// the list type is incorrect the reader skips the incorrect resource
// structure and tries the next one until no lists can be processed.
for (TInt i(1); i <= listCount; i++)
{
TInt listType(aReader.ReadInt8());
if (listType == iSubType)
{
ReadListInfoFromResourceL(aResourceFile, aReader);
break;
}
else if (i < listCount)
{
// Advance in resource file since this wasn't the list which
// was requested. Currently there are three LLINK:s to skip
aReader.Advance(sizeof(TInt32) * KPIMNumListResourceLinks);
}
}
}
示例10: LoadHwStateRotationsL
// -----------------------------------------------------------------------------
// CAknKeyRotatorImpl::LoadHwStateRotationsL
// Reads the HW states from the AknPriv.rsc to an array.
// -----------------------------------------------------------------------------
//
void CAknKeyRotatorImpl::LoadHwStateRotationsL()
{
// Find the language specific resource file and then load it.
RResourceFile resourceFile;
RFs fsSession;
User::LeaveIfError( fsSession.Connect() );
CleanupClosePushL( fsSession );
TFileName resourceFileName (KAknPrivRscFilePath);
BaflUtils::NearestLanguageFile( fsSession, resourceFileName );
resourceFile.OpenL(fsSession, resourceFileName);
CleanupClosePushL( resourceFile );
resourceFile.ConfirmSignatureL(0);
// Read resources to a buffer. The resource definition for the target and
// emulator are a bit different.
HBufC8* res;
#ifdef __WINS__
res = resourceFile.AllocReadLC( R_AKNPRIV_HARDWARE_STATE_SCREEN_MAP_EMUL );
#else
res = resourceFile.AllocReadLC( R_AKNPRIV_HARDWARE_STATE_SCREEN_MAP );
#endif
TResourceReader reader;
reader.SetBuffer(res);
// Read the entires. We are only interrested about the hwRotation.
TInt count = reader.ReadInt16();
for (TInt ii=0; ii<count; ii++)
{
/*TInt state =*/ reader.ReadInt16(); // Assumption (state == ii)
/*TInt width =*/ reader.ReadInt16();
/*TInt height =*/ reader.ReadInt16();
CFbsBitGc::TGraphicsOrientation hwRotation =
static_cast<CFbsBitGc::TGraphicsOrientation>(reader.ReadInt16());
/*CFbsBitGc::TGraphicsOrientation altRotation =*/
static_cast<CFbsBitGc::TGraphicsOrientation>(reader.ReadInt16());
User::LeaveIfError( iHwRotations.Append( hwRotation ) );
}
CleanupStack::PopAndDestroy(res);
CleanupStack::PopAndDestroy(&resourceFile); // resourceFile.Close();
CleanupStack::PopAndDestroy(&fsSession); // fsSession.Close();
}
示例11: PopulateColorArrayL
EXPORT_C void ResourceUtils::PopulateColorArrayL(CColorArray& aColors,TResourceReader& aReader)
/** Populates an array of logical colours using a pre-initialised resource
reader from an array of CTRL_COLOR resources.
@param aColors On return, contains the colour array read from the resource.
@param aReader Resource reader to use to read the colour array. */
{ // static
const TInt count=aReader.ReadInt16();
for (TInt ii=0;ii<count;ii++)
{
TInt logicalColor=aReader.ReadInt16();
TInt red=aReader.ReadUint8();
TInt green=aReader.ReadUint8();
TRgb color(red,green,aReader.ReadUint8());
aColors.AddL(logicalColor,color);
}
}
示例12: CreateIndiciesL
void CLogServDatabaseMarshall::CreateIndiciesL()
{
// Get the array size
TResourceReader reader;
iResourceInterface.CreateResourceReaderLC(reader, R_LOG_INDEXES);
const TInt indexes = reader.ReadInt16();
// Read in the array
for(TInt c1 = 0; c1 < indexes; c1++)
{
const TPtrC name(reader.ReadTPtrC());
const TPtrC table(reader.ReadTPtrC());
// Get the number of keys
const TInt keys = reader.ReadInt16();
CDbKey* key = CDbKey::NewLC();
for(TInt c2 = 0; c2 < keys; c2++)
{
TPtrC col = reader.ReadTPtrC();
TUint order = reader.ReadUint16();
TInt len = reader.ReadInt16();
// Add the key
key->AddL(TDbKeyCol(col, len, (TDbKeyCol::TOrder)order));
}
// Make key unique if required
if (reader.ReadInt8())
key->MakeUnique();
// Set comparison
const TDbTextComparison comparison = static_cast<TDbTextComparison>(reader.ReadInt8());
key->SetComparison(comparison);
// Create the index
User::LeaveIfError(iDatabase.CreateIndex(name, table, *key));
CleanupStack::PopAndDestroy(key);
}
CleanupStack::PopAndDestroy(); // reader
}
示例13: ReadListInfoFromResourceL
// -----------------------------------------------------------------------------
// CPIMLocalizationData::ReadListInfoFromResourceL
// -----------------------------------------------------------------------------
//
void CPIMLocalizationData::ReadListInfoFromResourceL(
RResourceFile& aResourceFile,
TResourceReader& aReader)
{
TInt32 listNameLabelId(aReader.ReadInt32());
TInt32 fieldsId(aReader.ReadInt32());
TInt32 attrsId(aReader.ReadInt32());
// Read label from resource
aReader.SetBuffer(aResourceFile.AllocReadLC(listNameLabelId));
iListName = aReader.ReadHBufCL();
// Resource buffer is not needed anymore
CleanupStack::PopAndDestroy(); // AllocReadLC()
// Read fields from resource. Fields must be specified in the resource
// file since empty lists are not allowed.
aReader.SetBuffer(aResourceFile.AllocReadLC(fieldsId));
TInt count(aReader.ReadInt16());
for (TInt i(0); i < count; i++)
{
CPIMLabelProvider* provider = CPIMLabelProvider::NewLC(aReader);
iFields.AppendL(provider);
CleanupStack::Pop(provider);
}
// Resource buffer is not needed anymore
CleanupStack::PopAndDestroy(); // AllocReadLC()
// Read attributes from resource. Do nothing if attributes not specified
if (attrsId != 0)
{
// Create buffer to the attributes lists
aReader.SetBuffer(aResourceFile.AllocReadLC(attrsId));
count = aReader.ReadInt16();
for (TInt i(0); i < count; i++)
{
CPIMLabelProvider* provider = CPIMLabelProvider::NewLC(aReader);
iAttributes.AppendL(provider);
CleanupStack::Pop(provider);
}
// Resource buffer is not needed anymore
CleanupStack::PopAndDestroy(); // AllocReadLC()
}
}
示例14: ConstructFromResourceL
EXPORT_C void CAknAnimationData::ConstructFromResourceL(TInt aResourceId)
{
ConstructL();
TResourceReader reader;
CEikonEnv::Static()->CreateResourceReaderLC(reader, aResourceId);
iFlags = (TUint16)reader.ReadInt16();
iInterval = reader.ReadInt32();
TInt sections = reader.ReadInt16();
TResourceReader sectionReader;
for (TInt sectionCount=0; sectionCount<sections; sectionCount++)
{
CEikonEnv::Static()->CreateResourceReaderLC(sectionReader, reader.ReadInt32());
TInt animSteps = sectionReader.ReadInt16();
for (TInt stepCount=0; stepCount<animSteps; stepCount++)
{
ReadAnimStepL(sectionReader);
}
CleanupStack::PopAndDestroy(); //sectionReader
if (WaitBetweenSections())
{
// Append a wait step between each loaded section
TAnimStep drawStep;
drawStep.SetType(EAnimWaitUntilComplete);
AppendL(drawStep);
iDrawStepsPerAnimStep->AppendL(1);
}
}
if (WaitForeverAtEnd())
{
// Append a wait-forever step at end of animation
// (Wait-forever is set by a wait step with zero steps)
TAnimStep drawStep;
drawStep.SetType(EAnimWait);
(drawStep.WaitStep())->iSteps = 0;
AppendL(drawStep);
iDrawStepsPerAnimStep->AppendL(1);
}
CleanupStack::PopAndDestroy(); //reader
}
示例15: TestFlPtEdL
/**
@SYMTestCaseID SYSLIB-BAFL-CT-0435
@SYMTestCaseDesc Tests for TResourceReader::ReadInt16(),TResourceReader::ReadInt64() function
@SYMTestPriority High
@SYMTestActions Attempt for reading FLPTED resource
@SYMTestExpectedResults Tests must not fail
@SYMREQ REQ0000
*/
void TRsReadTester::TestFlPtEdL()
{
test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0435 Test reading FLPTED resource "));
TResourceReader reader;
CreateResourceReaderLC(reader,SYS_FLPTED_ONE);
test(reader.ReadInt16()==18);
TReal little=reader.ReadReal64();
test(little==0.0);
TReal big=reader.ReadReal64();
test(big>9.89e99);
test(big<9.91e99);
CleanupStack::PopAndDestroy(1);
}