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


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

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


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

示例1: GetPhoneConfigL

// ---------------------------------------------------------------------------
// 
// ---------------------------------------------------------------------------
//
void CCapabilityManager::GetPhoneConfigL()
    {
    FLOG(_L("[IMAGEPRINTUI]>>> :CCapabilityManager, GetPhoneConfigL BEGIN"));
    
        
    TBuf<KResource> resourceFile(PathInfo::RomRootPath());
    TBuf<KResource> length(KPhoneCapability);    
    resourceFile.SetLength(KDriver + length.Length());
    resourceFile.Replace(KDriver, length.Length(), KPhoneCapability);
    
    RResourceFile resource;
    resource.OpenL(CCoeEnv::Static()->FsSession(),  resourceFile);
    FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUi:CCapabilityManager, Resource open"));
    
    CleanupClosePushL(resource);
    resource.ConfirmSignatureL(KPhoneCapabilityVersion);
    
    HBufC8* id = resource.AllocReadLC(PHONECAPABILITY_CONFIG);
    
    TResourceReader reader;
    reader.SetBuffer(id);   
    
    TInt qualityCount = reader.ReadUint8();
    TInt papersizeCount = reader.ReadUint8();
    TInt layoutCount  = reader.ReadUint8();
      
       
    for (TInt i = 0; i < qualityCount; i++)
    	{
    	iPhoneSuppQuality.AppendL(reader.ReadUint16());
    	}
    FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUi:CCapabilityManager, quality readed"));
    	
    for (TInt i = 0; i < papersizeCount; i++)
    	{
       	iPhoneSuppPaperSize.AppendL(reader.ReadUint16());
    	}		
    
    FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUi:CCapabilityManager, papersize readed"));
    for (TInt i = 0; i < layoutCount; i++)
    	{
    	iPhoneSuppLayout.AppendL(reader.ReadUint16());
    	}
    FLOG(_L("[IMAGEPRINTUI]>>> CImagePrintUi:CCapabilityManager, layout readed"));
    	
    CleanupStack::PopAndDestroy(id);
    CleanupStack::PopAndDestroy(&resource);
    FLOG(_L("[IMAGEPRINTUI]<<< CImagePrintUi:CCapabilityManager GetPhoneConfigL END "));
    }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:53,代码来源:capabilitymanager.cpp

示例2: ConditionalCommandAllowedL

TBool CGsaStatePolicyStartup::ConditionalCommandAllowedL(CResourceFile& /*aResourceFile*/, TInt /*aResourceId*/)
#endif
	{
	TBool isAllowed = EFalse;        
#ifdef SYMBIAN_SSM_GRACEFUL_SHUTDOWN
   	HBufC8* buf = aResourceFile.AllocReadLC(aResourceId);
   	TResourceReader reader; 
	reader.SetBuffer(buf);
	//Read the type of the command from the resource file
	TUint16 type = reader.ReadUint16();
	CleanupStack::PopAndDestroy(buf);
	// check that the type is equal to "EGracefulShutdown"
	if(type == EGracefulShutdown)    
		{
		//Check whether SSM graceful shutdown is enabled or not
		if(IsSsmGracefulShutdown())   
			{
			isAllowed = ETrue;
			}
		}
#else
	// no commands use 'conditional_information' in Startup state command list.
	PanicNow(KPanicGsaStartupState, EConditionalInfoNotImplemented);
#endif
	return isAllowed;
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:26,代码来源:gsastatepolicystartup.cpp

示例3: ReadResourceFileConfigurationL

void CLogServDatabaseMarshall::ReadResourceFileConfigurationL(TLogConfig& aConfig) const
	{	
	TResourceReader reader;
	iResourceInterface.CreateResourceReaderLC(reader, R_LOG_INITIAL_CONFIG);
	//
	aConfig.iMaxLogSize = static_cast<TLogSize>(reader.ReadUint16());
	aConfig.iMaxRecentLogSize = static_cast<TLogRecentSize>(reader.ReadUint8());
	aConfig.iMaxEventAge = static_cast<TLogAge>(reader.ReadUint32());
	//
	CleanupStack::PopAndDestroy(); // reader	
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:11,代码来源:LogServDatabaseMarshall.cpp

示例4: ConstructFromResourceL

EXPORT_C void CEikFloatingPointEditor::ConstructFromResourceL(TResourceReader& aReader)
	{
	TInt textLimit=aReader.ReadUint16();
	TReal min=aReader.ReadReal64();
	TReal max=aReader.ReadReal64();
	TReal defaultValue=aReader.ReadReal64(); // does not work with queries !!!
	ConstructL(min,max,textLimit);
    // 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,代码行数:12,代码来源:EIKFPNE.CPP

示例5: TestButtonL

/**
@SYMTestCaseID          SYSLIB-BAFL-CT-0433
@SYMTestCaseDesc        Tests for TResourceReader::ReadInt16(),TResourceReader::ReadUint16() functions
@SYMTestPriority        Medium
@SYMTestActions         Attempt to read a BUTTON resource
@SYMTestExpectedResults Tests must not fail
@SYMREQ                 REQ0000
*/
void TRsReadTester::TestButtonL()
	{
	test.Next(_L(" @SYMTestCaseID:SYSLIB-BAFL-CT-0433 Test reading BUTTON resource "));
    TResourceReader reader;
    CreateResourceReaderLC(reader,SYS_BUTTON_ONE);
    test(reader.ReadInt16()==3);
    test(reader.ReadUint16()==5);
    TPtrC ptr=reader.ReadTPtrC();
    test(ptr==_L("Text"));
    ptr.Set(reader.ReadTPtrC());
    test(ptr.Length()==0);
    HBufC* hBuf=reader.ReadHBufCL();
    test(*hBuf==_L("Bitmap placeholder"));
    delete(hBuf);
    CleanupStack::PopAndDestroy();
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:24,代码来源:T_RSREAD.CPP

示例6: 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
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:45,代码来源:LogServDatabaseMarshall.cpp

示例7: AddDeviceModesL

//------------------------------------------------------------------------------
// CKefResource::AddDeviceModesL
//------------------------------------------------------------------------------
//
void CKefResource::AddDeviceModesL( TResourceReader& aReader )
{
    TUint n;
    n = aReader.ReadUint8();
    for ( TUint i = 0; i < n; i++ )
    {
        TUint16 tryMode = aReader.ReadUint16();
        if ( tryMode < KKefKeyMapRows ) // modeWithoutTypes >= 0
        {
            iDeviceModes->AppendL( tryMode );
            __KEFLOGSTRING2("CKefResource::AddDeviceModesL: iDeviceModes[%d] = %d",i,iDeviceModes->At(i));
        }
        else
        {
            __KEFLOGSTRING("CKefResource::AddDeviceModesL: Invalid mode");
            __KEFLOGSTRING1("CKefResource::AddDeviceModesL: rows=%d", KKefKeyMapRows );
        }
    }
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:23,代码来源:kefresource.cpp

示例8: AddKeyCodesL

//------------------------------------------------------------------------------
// CKefResource::AddKeyCodesL
//------------------------------------------------------------------------------
//
void CKefResource::AddKeyCodesL( TResourceReader& aReader )
{
    TUint n;
    n = aReader.ReadUint8();
    for ( TUint i = 0; i < n; i++ )
    {
        TUint16 tryCode = aReader.ReadUint16();
        if ( tryCode < 0xFFFF ) // tryCode >= 0 (because TUint16)
        {
            iKeyCodes->AppendL( tryCode );
            __KEFLOGSTRING2( "CKefResource::AddKeyCodesL: iKeyCodes[%d] = %d",i,iKeyCodes->At(i));
        }
        else
        {
            __KEFLOGSTRING2("CKefResource::AddKeyCodesL: Erroneus keycode[%d] = %d",i,tryCode);
        }

    }
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:23,代码来源:kefresource.cpp

示例9: AddScanCodesL

//------------------------------------------------------------------------------
// CKefResource::AddScanCodesL
//------------------------------------------------------------------------------
//
void CKefResource::AddScanCodesL( TResourceReader& aReader )
{
    TUint n;
    n = aReader.ReadUint8();
    if ( n > KKefMaxComboKeys )
    {
        User::Leave( KErrGeneral );
    }

    for ( TUint i = 0; i < n; i++ )
    {
        TUint16 tryCode = aReader.ReadUint16();
        if ( tryCode < KKefMaxScanCode ) // tryCode >= 0 (because TUint16)
        {
            iScanCodes->AppendL( tryCode );
            __KEFLOGSTRING2("CKefResource::AddScanCodesL: iScanCodes[%d] = %d",i,iScanCodes->At(i));
        }
        else
        {
            __KEFLOGSTRING2("CKefResource::AddScanCodesL: Erroneus scancode[%d] = %d",i,tryCode);
        }
    }
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:27,代码来源:kefresource.cpp

示例10: ConstructFromResourceL

void CStartupProperties::ConstructFromResourceL(TResourceReader& aSource)
	{
	const TStartupCommandType commandType = static_cast<TStartupCommandType>(aSource.ReadUint16());	
	iStartupType = ((commandType==EStartupApp)||(commandType==EStartupApp2)) ? EStartApp : EStartProcess;
	
	iFileName = aSource.ReadHBufCL();
	if(iFileName)
		{
		TPtr writeableFilename = iFileName->Des();
		writeableFilename.TrimAll();		
		}
	
	iArgs = aSource.ReadHBufCL(); 
	if(iArgs)
		{
		TPtr writeableArgs = iArgs->Des();
		writeableArgs.TrimAll();
		}
	
	iStartMethod = static_cast<TStartMethod>(aSource.ReadUint16());	
	
	switch(commandType)
		{
		case EStartupApp:
			delete iArgs; // deleted for backwards compatibility
			iArgs = NULL;
			iViewless = static_cast<TUint16>(aSource.ReadUint16());
			iStartInBackground = static_cast<TUint16>(aSource.ReadUint16());
			iTimeout = aSource.ReadInt32();
			iRecoveryMethod.iActionOnCommandFailure = static_cast<TActionOnCommandFailure> (aSource.ReadUint16());
			iNoOfRetries = static_cast<TUint16> (aSource.ReadUint16());
			break;
			
		case EStartupApp2:
			iViewless = static_cast<TUint16>(aSource.ReadUint16());
			iStartInBackground = static_cast<TUint16>(aSource.ReadUint16());
			iTimeout = aSource.ReadInt32();
			iRecoveryMethod.iRecoveryMethod = static_cast<TRecoveryMethod> (aSource.ReadUint16());
			iNoOfRetries = static_cast<TUint16> (aSource.ReadUint16());
			iMonitored = static_cast<TUint16>(aSource.ReadUint16());
			iRestartMode = aSource.ReadInt16();
			break;
			
		case EStartupProcess:
			iTimeout = aSource.ReadInt32();
			iRecoveryMethod.iActionOnCommandFailure = static_cast<TActionOnCommandFailure>(aSource.ReadUint16());
			iNoOfRetries = static_cast<TUint16> (aSource.ReadUint16());	
			break;
			
		case EStartupProcess2:
			iTimeout = aSource.ReadInt32();
			iRecoveryMethod.iRecoveryMethod = static_cast<TRecoveryMethod>(aSource.ReadUint16());
			iNoOfRetries = static_cast<TUint16> (aSource.ReadUint16());	
			iMonitored = static_cast<TUint16>(aSource.ReadUint16());	
			iRestartMode = aSource.ReadInt16();
			break;
			
		default:
			PanicNow(KPanicStartupProperties, EInvalidCommandType);
			break;
		}
	
	DoSanityCheck(commandType);
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:64,代码来源:startupproperties.cpp

示例11: AddFeedbackTypeL

void CKefResource::AddFeedbackTypeL( TResourceReader& aReader )
{
#ifdef RD_TACTILE_FEEDBACK
    iFeedbackType = aReader.ReadUint16();
#endif // RD_TACTILE_FEEDBACK
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:6,代码来源:kefresource.cpp

示例12: ReadNewStartupItemsL

// -----------------------------------------------------------------------------
// CSisxUIStartupFile::ReadStartupItemsL
// Get all startup items from the given resource file.
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CSisxUIStartupFile::ReadNewStartupItemsL( RArray<TStartupTaskParam>& aStartupItems,
                                               const RPointerArray<HBufC>& aFiles )
    {
    RResourceFile resource;
    CleanupClosePushL( resource );
    resource.OpenL( iFileSession, *iNewFile );
  
    TInt index( 0 );    

    // Read resources
    for ( index = 1; resource.OwnsResourceId( index ); index++ )
        {
        // Create the reader
        HBufC8* resBuffer = resource.AllocReadLC( index );
        TResourceReader reader;
        reader.SetBuffer( resBuffer );
 
        // Read version byte
        TInt version = reader.ReadUint8();        
     
        // Read actual parameters
        TStartupTaskParam item;
        item.iFileName.Copy( reader.ReadTPtrC() );        
        item.iRecoveryPolicy = (TStartupExceptionPolicy) reader.ReadUint16();
        
        aStartupItems.Append( item );

        CleanupStack::PopAndDestroy( resBuffer );
        }   

    // Validate the array. Each and every executable to be added to the 
    // startup list must also be installed by this package.
    for ( index = 0; index < aStartupItems.Count(); index++ ) 
        {
        // Sanity check
        if ( !aStartupItems[index].iFileName.Length() )
            {
            continue;
            }        
             
        TBool entryFound( EFalse );        
        TInt j( 0 );        
        iTemp = aStartupItems[index].iFileName;
        iTemp.Delete( 0, 1 );        
        iTemp.Fold();        

        for ( j = 0; j < aFiles.Count(); j++ )
            {            
            if ( aFiles[j]->FindF( iTemp ) >= 0 )
                {
                entryFound = ETrue;
                // Replace the possible ! with correct drive
                if ( aStartupItems[index].iFileName[0] == '!' )
                    {
                    TBuf<1> temp;
                    temp.Append( (*aFiles[j])[0] );                    
                    aStartupItems[index].iFileName.Replace(0, 1, temp );                    
                    }
                
                break;                
                }            
            }

        if ( !entryFound )
            {
            aStartupItems.Remove( index );
            index--;            
            }        
        }    

    CleanupStack::PopAndDestroy(); // resource
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:78,代码来源:SisxUIStartupFile.cpp


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