本文整理汇总了C++中TResourceReader::Ptr方法的典型用法代码示例。如果您正苦于以下问题:C++ TResourceReader::Ptr方法的具体用法?C++ TResourceReader::Ptr怎么用?C++ TResourceReader::Ptr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TResourceReader
的用法示例。
在下文中一共展示了TResourceReader::Ptr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}