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


C++ TPckgBuf::MaxLength方法代码示例

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


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

示例1: writeRomImage

LOCAL_C void writeRomImage()
//
// Write the ROM image.
//
	{

	test.Start(_L("Write rom file header"));
//
	TPckgBuf<TRomFileHeader> fileHeadB;
	fileHeadB.FillZ(fileHeadB.MaxLength());
	TRomFileHeader& fileHead=fileHeadB();
	Mem::Copy(&fileHead.iName[0],"EPOC468 ROM     ",KRomFileHeaderNameSize);
	Mem::Copy(&fileHead.iVersionStr[0],"0.01",4);
	Mem::Copy(&fileHead.iBuildNumStr[0],"   1",4);
	fileHead.iRomSize=TheRomHeader.iRomSize;
	fileHead.iHeaderSize=KRomFileHeaderSize;
	test(TheFile.Write(fileHeadB)==KErrNone);
//
	test.Next(_L("Write rom header"));
	TheFiller.FillZ(TheFiller.MaxLength());
	TPckgC<TRomHeader> head(TheRomHeader);
	test(TheFile.Write(head)==KErrNone);
	TheCurrentBase=UserSvr::RomHeaderAddress()+sizeof(TheRomHeader);
//
	test.Next(_L("Write directories"));
	TheLevel=(-1);
	TheRootDir->WriteDirs();
	test(TheLevel==(-1));
//
	test.Next(_L("Write files"));
	TheLevel=(-1);
	TheRootDir->WriteFiles();
	test(TheLevel==(-1));
//
	test.End();
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:36,代码来源:t_romg.cpp

示例2: SaveL

// -----------------------------------------------------------------------------
// CNSmlDsProvisioningAdapter::SaveL
// -----------------------------------------------------------------------------
void CNSmlDsProvisioningAdapter::SaveL(TInt aItem)
	{
	_DBG_FILE("CNSmlDsProvisioningAdapter::SaveL(): begin");
	TPckgBuf<TUint32> uid;
	
	RSyncMLDataSyncProfile profile;
	TBool ret = EFalse;
	
	if(iProfiles[aItem]->iServerId != NULL)
	{
	RSyncMLDataSyncProfile ProfileToSearch;
	RArray<TSmlProfileId> arr;
    iSession.ListProfilesL( arr, ESmlDataSync );
    
    TInt ProfileId = KErrNotFound;
    CleanupClosePushL(arr);   	
	for ( TInt index = 0; index < arr.Count(); index++ )
		{
	    TRAPD( error, ProfileToSearch.OpenL(iSession, arr[index], ESmlOpenRead ) );
	    if ( error == KErrNone )
	        {	            	            	        
    	        if ( ( iProfiles[aItem]->iServerId->Des()).Compare(ProfileToSearch.ServerId() ) == 0 )
    	            {
    	            
                    ret = ETrue;                    
                    ProfileId = (TInt)arr[index];
                    ProfileToSearch.Close();
                    break;
                    }	            		    
	        }
	      ProfileToSearch.Close();  
		}
    CleanupStack::PopAndDestroy( &arr );
	
	if( ret )
		{
		profile.OpenL(iSession, ProfileId , ESmlOpenReadWrite );	
		}
	else
		{
	profile.CreateL( iSession );
		}
	CleanupClosePushL( profile );	
	}
	else
	{
		
		profile.CreateL( iSession );
		CleanupClosePushL( profile );	
	}
	
	// ui needs this to be set 0
	profile.SetCreatorId(0);//iProfiles[aItem]->iProfile.SetCreatorId(0);
	profile.SetSanUserInteractionL( iProfiles[aItem]->iServerAlertedAction );
	
	if ( iProfiles[aItem]->iDisplayName )
	    {
	    profile.SetDisplayNameL( iProfiles[aItem]->iDisplayName->Des() );    
	    }
	
	if ( iProfiles[aItem]->iServerId )
	    {
	    profile.SetServerIdL( iProfiles[aItem]->iServerId->Des() );    
	    }
	    
	if ( iProfiles[aItem]->iUsername )   
	    {
	    profile.SetUserNameL( iProfiles[aItem]->iUsername->Des() );    
	    }
	
	if ( iProfiles[aItem]->iPassword )
	    {
	    profile.SetPasswordL( iProfiles[aItem]->iPassword->Des() );    
	    }
	    
	// creates profile -> must be done before opening the connection
	profile.UpdateL();
		
	RSyncMLConnection connection;
	connection.OpenL( profile, KUidNSmlMediumTypeInternet.iUid );
	CleanupClosePushL( connection );
		
    if ( (iProfiles[aItem]->iVisitParameter
            && iProfiles[aItem]->iVisitParameter->Data().Length() == uid.MaxLength() )
            || iToNapIDInternetIndicator)
		{
        TUint apId = 0;
        TInt ERROR = KErrNone;
        TInt err1 = KErrNone;

        if (iToNapIDInternetIndicator)
            {
            //Get Access Point from DB or SNAP
            TRAP(err1, apId = WPAdapterUtil::GetAPIDL());
            }

        else
//.........这里部分代码省略.........
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:101,代码来源:NSmlDsProvisioningAdapter.cpp


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