本文整理汇总了C++中TResourceReader::ReadInt8方法的典型用法代码示例。如果您正苦于以下问题:C++ TResourceReader::ReadInt8方法的具体用法?C++ TResourceReader::ReadInt8怎么用?C++ TResourceReader::ReadInt8使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TResourceReader
的用法示例。
在下文中一共展示了TResourceReader::ReadInt8方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/**
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);
}
示例2: 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);
}
}
}
示例3: 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
}
示例4:
EXPORT_C TInt32 ResourceUtils::ReadResourceIntL(TResourceReader& aReader,TResourceTypeInt aSize)
//
// Read a resource specifying a number
//
{
TInt32 value=0;
switch(aSize)
{
case EResourceInt8:
value=aReader.ReadInt8();
break;
case EResourceInt16:
value=aReader.ReadInt16();
break;
case EResourceInt32:
value=aReader.ReadInt32();
break;
default:
Panic(EEgulPanicResourceInvalidNumberType);
}
return(value);
}
示例5: ConstructFromResourceL
void CAnimateFramesCtl::ConstructFromResourceL(TResourceReader& aReader)
{
iBitmapAnimData->SetFrameInterval(aReader.ReadInt16());
iBitmapAnimData->SetPlayMode((CBitmapAnimClientData::TPlayMode)aReader.ReadInt16());
iBitmapAnimData->SetFlash(aReader.ReadInt8());
TFileName ptr(aReader.ReadTPtrC()); // filename
if (!ptr.Length())
ptr = KTBmpAnimMBMFilePath;//vm iEikonEnv->EikAppUi()->Application()->BitmapStoreName();
// Start reading the data frames
TInt listFrameLink=aReader.ReadInt32();
if (listFrameLink)
{
TResourceReader framesReader;
iCoeEnv->CreateResourceReaderLC(framesReader, listFrameLink);
const TInt count=framesReader.ReadInt16();
CBitmapFrameData* frameData = NULL;
for (TInt ii=0;ii<count;++ii)
{
//read the frame data from resource
frameData = ReadFrameDataFromResourceL(framesReader, ptr);
CleanupStack::PushL(frameData);
iBitmapAnimData->AppendFrameL(frameData);
CleanupStack::Pop(); // frameData
}
CleanupStack::PopAndDestroy();
}
TInt backgroundLink=aReader.ReadInt32();
if (backgroundLink > 0)
{
TResourceReader backgroundReader;
iCoeEnv->CreateResourceReaderLC(backgroundReader, backgroundLink);
//read the frame data from resource
CBitmapFrameData* backgroundData = ReadFrameDataFromResourceL(backgroundReader, ptr);
CleanupStack::PushL(backgroundData);
iBitmapAnimData->SetBackgroundFrame(backgroundData);
CleanupStack::Pop(); // backgroundData
CleanupStack::PopAndDestroy(); // backgroundReader
}
}
示例6: ConstructL
// Complete the construction of the
// CResData object using the supplied
// reource reader representing the resource data.
// The structure of the data is assumed to be
// defined by the resource struct DATA in "ReadData.rh"
void CResData::ConstructL(TResourceReader& aReader)
{
// Interpret next bytes as a TInt16
iWrd = aReader.ReadInt16();
// Interpret next bytes as a TInt16
iFlags = aReader.ReadInt16();
// Interpret next bytes as a TInt32
iLng = aReader.ReadInt32();
iTxt = aReader.ReadTPtrC();
// Interpret the next byte as the length
// of text. The text itself follows
// this byte.
iLtxt = aReader.ReadHBufC16L();
// Interpret the next byte as a TInt8
iByt = aReader.ReadInt8();
// Interpret next bytes as a TReal
iDbl = aReader.ReadReal64();
}
示例7: ConstructFromResourceL
// This function is used when the CSmileyContainer is created inside a dialog.
void CSmileyContainer::ConstructFromResourceL(TResourceReader& aReader)
{
// Read the smiley mood from the resource file
TBool isSmiling = (TBool) aReader.ReadInt8();
// Read the width of the smiley container from the resource file.
TInt width = aReader.ReadInt16();
// Set the height of the container to be half its width
TSize containerSize(width, width / 2);
iSmiley1 = new (ELeave) CSmiley(isSmiling);
iSmiley1->SetContainerWindowL(*this);
iSmiley2 = new (ELeave) CSmiley(isSmiling);
iSmiley2->SetContainerWindowL(*this);
iSmiley1->SetFocus(ETrue);
iSmiley1->SetObserver(this);
iSmiley2->SetObserver(this);
SetSize(containerSize);
ActivateL();
}
示例8: ReadAnimStepL
void CAknAnimationData::ReadAnimStepL(TResourceReader& aReader)
{
TInt drawSteps = aReader.ReadInt16();
iDrawStepsPerAnimStep->AppendL((TUint8)drawSteps);
for (TInt stepCount=0; stepCount<drawSteps; stepCount++)
{
TAnimStep drawStep;
TUint8 type = (TUint8)aReader.ReadInt8();
drawStep.SetType(type);
switch(type)
{
case EAnimBlitPreviousView:
case EAnimBlitNewView:
{
TAnimBlitStep* step = drawStep.BlitStep();
step->iDestX = (TInt16)aReader.ReadInt16();
step->iDestY = (TInt16)aReader.ReadInt16();
}
break;
case EAnimBlitPartPreviousView:
{
TAnimBlitStep* step = drawStep.BlitStep();
step->iSrcX = (TInt16)aReader.ReadInt16();
step->iSrcY = (TInt16)aReader.ReadInt16();
step->iWidth = (TUint16)aReader.ReadInt16();
step->iHeight = (TUint16)aReader.ReadInt16();
step->iDestX = (TInt16)aReader.ReadInt16();
step->iDestY = (TInt16)aReader.ReadInt16();
}
case EAnimBlitPartNewView:
case EAnimRevealPartNewViewFromLeft:
case EAnimRevealPartNewViewFromRight:
case EAnimRevealPartNewViewFromTop:
case EAnimRevealPartNewViewFromBottom:
{
TAnimBlitStep* step = drawStep.BlitStep();
step->iSteps = (TUint16)aReader.ReadInt16();
step->iSrcX = (TInt16)aReader.ReadInt16();
step->iSrcY = (TInt16)aReader.ReadInt16();
step->iWidth = (TUint16)aReader.ReadInt16();
step->iHeight = (TUint16)aReader.ReadInt16();
step->iDestX = (TInt16)aReader.ReadInt16();
step->iDestY = (TInt16)aReader.ReadInt16();
if (step->iDestX == -32760) step->iDestX = step->iSrcX;
if (step->iDestY == -32760) step->iDestY = step->iSrcY;
}
break;
case EAnimBlitSlideNewView:
case EAnimBlitSlideNewViewClearBehind:
{
TAnimSlideStep* step = drawStep.SlideStep();
step->iSteps = (TUint16)aReader.ReadInt16();
step->iSrcX = (TInt16)aReader.ReadInt16();
step->iSrcY = (TInt16)aReader.ReadInt16();
step->iWidth = (TUint16)aReader.ReadInt16();
step->iHeight = (TUint16)aReader.ReadInt16();
step->iSlideToX = (TInt16)aReader.ReadInt16();
step->iSlideToY = (TInt16)aReader.ReadInt16();
step->iSlideFromX = (TInt16)aReader.ReadInt16();
step->iSlideFromY = (TInt16)aReader.ReadInt16();
}
break;
case EAnimWait:
{
TAnimWaitStep* step = drawStep.WaitStep();
step->iSteps = (TUint16)aReader.ReadInt16();
}
break;
case EAnimSetColor:
{
TAnimSetColorStep* step = drawStep.SetColorStep();
step->iRed = (TUint8)aReader.ReadUint8();
step->iGreen = (TUint8)aReader.ReadUint8();
step->iBlue = (TUint8)aReader.ReadUint8();
}
break;
case EAnimDrawLine:
case EAnimDrawRect:
case EAnimDrawFilledRect:
{
TAnimLineDrawStep* step = drawStep.LineDrawStep();
step->iSteps = (TUint16)aReader.ReadInt16();
step->iStartX = (TInt16)aReader.ReadInt16();
step->iStartY = (TInt16)aReader.ReadInt16();
step->iEndX = (TInt16)aReader.ReadInt16();
step->iEndY = (TInt16)aReader.ReadInt16();
}
break;
case EAnimWaitUntilComplete:
// No parameters to be read
break;
default:
ConstructUserAnimationStepL(drawStep, aReader);
break;
}
AppendL(drawStep);
}
}