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


C++ TResourceReader::ReadInt32方法代码示例

本文整理汇总了C++中TResourceReader::ReadInt32方法的典型用法代码示例。如果您正苦于以下问题:C++ TResourceReader::ReadInt32方法的具体用法?C++ TResourceReader::ReadInt32怎么用?C++ TResourceReader::ReadInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TResourceReader的用法示例。


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

示例1: 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();
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:7,代码来源:aknnotewrappers.cpp

示例2: 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));
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-mw2,代码行数:34,代码来源:indexcontext.cpp

示例3: ReadConfirmationResourceL

/**
 * Reads in the resource structure associated with a password confirmation (old or new)
 *
 */
EXPORT_C void CAknPasswordSettingPage::ReadConfirmationResourceL( TInt aResourceId, SAknConfirmationResource& resources )
	{
	TResourceReader reader;
	iCoeEnv->CreateResourceReaderLC( reader,aResourceId );

	resources.iEntryQueryResourceId = reader.ReadInt32();
	resources.iSuccessNoteResourceId = reader.ReadInt32();
	resources.iFailureNoteResourceId = reader.ReadInt32();

	CleanupStack::PopAndDestroy(); //reader	

	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:16,代码来源:AknPasswordSettingPage.cpp

示例4: ConstructFromResourceL

// ---------------------------------------------------------------------------
// CAknStylusPopUpMenu::ConstructFromResourceL
// ---------------------------------------------------------------------------
//
EXPORT_C void CAknStylusPopUpMenu::ConstructFromResourceL( TResourceReader&
                                                           aReader )
    {
    TInt count = aReader.ReadInt16();
    TInt commandId;
    for ( TInt i = 0; i < count; i++ )
        {
        TPtrC text = aReader.ReadTPtrC();
        commandId = aReader.ReadInt32();
        iContent->AddMenuItemL( text, commandId );
        aReader.ReadInt32(); // extension link
        }
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:17,代码来源:aknstyluspopupmenu.cpp

示例5: ConstructFromResourceL

EXPORT_C void CEikFixedPointEditor::ConstructFromResourceL(TResourceReader& aReader)
	{
	iDecimalPlaces=aReader.ReadUint16();
	TInt min=aReader.ReadInt32();
	TInt max=aReader.ReadInt32();
	TInt defaultValue = aReader.ReadInt32();

	__ASSERT_DEBUG(min<=max, Panic(EEikPanicInvalidBounds) );

	ConstructL(min, max );

	// added to give a default value, to work with forms.  Unsure if this is desirable.
	if ((min>defaultValue)||(defaultValue>max)) 
		defaultValue=min;
	SetValueL(&defaultValue);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:16,代码来源:EIKFPNE.CPP

示例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);
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:35,代码来源:EIKRUTIL.CPP

示例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;
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:27,代码来源:eiktxlbx.cpp

示例8: 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()
    }
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:49,代码来源:cpimlocalizationdata.cpp

示例9: 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
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:41,代码来源:aknAnimData.cpp

示例10: 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
		}
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:39,代码来源:Tanctl.cpp

示例11: TestMenuBarL

/**
@SYMTestCaseID          SYSLIB-BAFL-CT-0436
@SYMTestCaseDesc        TResourceReader class functionality test
						Test for TResourceReader::ReadInt32 (),TResourceReader::ReadTPtrC() functions
@SYMTestPriority        High
@SYMTestActions         Attempt for reading MENU_BAR resource
@SYMTestExpectedResults Tests must not fail
@SYMREQ                 REQ0000
*/
void TRsReadTester::TestMenuBarL()
	{
	test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0436 Test reading MENU_BAR resource "));
    TResourceReader reader;
    CreateResourceReaderLC(reader,SYS_MENUBAR_ONE);
    test(reader.ReadInt16()==8); // how many items following
    TPtrC ref=_L("abcdefgh");
    for (TInt ii=1; ii<=8; ii++)
        {
        test(reader.ReadInt32()==ii);
        test(reader.ReadTPtrC()==ref.Left(ii));
        }
    CleanupStack::PopAndDestroy(1);
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:23,代码来源:T_RSREAD.CPP

示例12: 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
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:49,代码来源:AknIconArray.cpp

示例13: LoadResourcesL

// ----------------------------------------------------------------------------
// CATCmdPluginEcom::::LoadResourcesL
// Load resources
// (may leave)
// Status : Approved
// ----------------------------------------------------------------------------
//
void CATCmdPluginEcom::LoadResourcesL()
    {
    TRACE_FUNC_ENTRY

    RFs fs;
    CleanupClosePushL( fs );

    TFileName fileName;
    fileName.Copy( KFileName );
    User::LeaveIfError( fs.Connect() );
    BaflUtils::NearestLanguageFile( fs, fileName );

    RResourceFile resourceFile;
    CleanupClosePushL( resourceFile );
    resourceFile.OpenL( fs, fileName );
    resourceFile.ConfirmSignatureL();

    HBufC8* buf8 = resourceFile.AllocReadLC( R_ATCMDPLUGIN_TRANSLATIONTABLE );
    
    TResourceReader reader;
    reader.SetBuffer( buf8 );
    
    TInt count = reader.ReadInt16(); // array count
    iTranslations = new ( ELeave ) CArrayPtrFlat<CATCmdTranslation>( count );

    while ( count-- )
        {
        const TInt code = reader.ReadInt32(); 

        HBufC8* param = reader.ReadHBufC8L(); 
        CleanupStack::PushL( param );
        CATCmdTranslation* t = new (ELeave) CATCmdTranslation( *param, code );
        CleanupStack::Pop( param ); // transfer ownership

        CleanupStack::PushL( t );
        iTranslations->AppendL( t );
        CleanupStack::Pop( t ); // transfer ownership
        }

    CleanupStack::PopAndDestroy( 3 ); // resourceFile, fs, buf8

    TRACE_FUNC_EXIT
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:50,代码来源:atcmdplugin.cpp

示例14: ReadMenuArrayLC

// ----------------------------------------------------------------------------
// Read array of menu items, leave on cleanup stack
// ----------------------------------------------------------------------------
//
EXPORT_C CDesCArrayFlat* CMPXResource::ReadMenuArrayLC(TInt aResourceId, RArray<TInt>& aIdArray)
    {
    //MPX_DEBUG1("CMPXResource::ReadMenuArrayLC");
    TResourceReader resReader;
    HBufC8* readBuffer = iResourceFile.AllocReadLC(aResourceId);
    resReader.SetBuffer(readBuffer);
    TInt count(resReader.ReadInt16());
    CDesCArrayFlat* descArray = new (ELeave) CDesCArrayFlat(count);
    for (TInt k = 0; k < count; k++)
              {
              aIdArray.AppendL (resReader.ReadInt32());
              HBufC* hbuf = resReader.ReadHBufCL();
              CleanupStack::PushL(hbuf);
              descArray->AppendL (*hbuf);
              CleanupStack::PopAndDestroy(hbuf);
        }
    CleanupStack::PopAndDestroy(readBuffer);
    //MPX_DEBUG1("CMPXResource::ReadDesCArrayLC End");
    CleanupStack::PushL(descArray);
    return descArray;
    }
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:25,代码来源:mpxresource.cpp

示例15: CreateColorArrayLC

EXPORT_C CColorArray* EikResourceUtils::CreateColorArrayLC(TInt aResourceId,CEikonEnv* aEnv)
/** Creates an array of control colours from a resource definition and returns it 
on the cleanup stack.

@param aResourceId ID of the resource from which to create the array of control 
colours. 
@param aEnv The UI environment in which the control colours are to be created. 
@return Array of control colours. */
	{ // static
	if (aEnv==NULL)
		aEnv=CEikonEnv::Static();
	__ASSERT_DEBUG(aEnv!=NULL,Panic(EEikPanicResourceNonEnvironment));
	CColorArray* colors=CColorArray::NewLC();
	TResourceReader reader;
	aEnv->CreateResourceReaderLC(reader,aResourceId);
    TInt listId=reader.ReadInt32();
	CleanupStack::PopAndDestroy(); // reader
	aEnv->CreateResourceReaderLC(reader,listId);
	ResourceUtils::PopulateColorArrayL(*colors,reader);
	CleanupStack::PopAndDestroy(); // reader
	return colors;
	}
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:22,代码来源:EIKRUTIL.CPP


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