本文整理汇总了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();
}
示例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
//.........这里部分代码省略.........