本文整理汇总了C++中HBufC16::Length方法的典型用法代码示例。如果您正苦于以下问题:C++ HBufC16::Length方法的具体用法?C++ HBufC16::Length怎么用?C++ HBufC16::Length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HBufC16
的用法示例。
在下文中一共展示了HBufC16::Length方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ETagStringLC
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//
HBufC16* CPosLmXmlEncoder::ETagStringLC( TPosXmlTagType aTagType )
{
TPtrC tag = TagNameL( aTagType );
if ( !IsTagLeaf( aTagType ) )
{
iIndentationDepth = Max( iIndentationDepth - 1, 0 );
}
HBufC16* indent = IndentationLC();
HBufC16* string = HBufC16::NewLC( KPosStringLength + indent->Length() );
if ( !IsTagLeaf( aTagType ) )
{
string->Des().Append( *indent );
}
string->Des().Append( KPosXmlETagStart );
string->Des().Append( KPosXmlNameSpacePrefix );
string->Des().Append( tag );
string->Des().Append( KPosXmlTagEnd );
string->Des().Append( KPosXmlNewLine );
CleanupStack::Pop( string );
CleanupStack::PopAndDestroy( indent );
CleanupStack::PushL( string );
return string;
}
示例2: STagStringLC
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
//
HBufC16* CPosLmXmlEncoder::STagStringLC( TPosXmlTagType aTagType, const TDesC& aAttributes )
{
TPtrC tag = TagNameL( aTagType );
HBufC16* indent = IndentationLC();
HBufC16* string = HBufC16::NewLC( KPosStringLength + indent->Length() + aAttributes.Length() );
string->Des().Append( *indent );
string->Des().Append( KPosXmlSTagStart );
string->Des().Append( KPosXmlNameSpacePrefix );
string->Des().Append( tag );
if ( aAttributes.Length() )
{
string->Des().Append( KPosXmlSpace );
string->Des().Append( aAttributes );
}
string->Des().Append( KPosXmlTagEnd );
if ( !IsTagLeaf( aTagType ) )
{
string->Des().Append( KPosXmlNewLine );
iIndentationDepth++;
}
CleanupStack::Pop( string );
CleanupStack::PopAndDestroy( indent );
CleanupStack::PushL( string );
return string;
}
示例3: ConstructL
// ----------------------------------------------------------------------------
// UntrustedCertificateInfoSymbian::ConstructL()
// ----------------------------------------------------------------------------
//
void UntrustedCertificateInfoSymbian::ConstructL(const QByteArray &aEncodedCert)
{
TPtrC8 encodedCert( reinterpret_cast<const TText8*>( aEncodedCert.constData() ),
aEncodedCert.length() );
ASSERT( mCert == 0 );
mCert = CX509Certificate::NewL( encodedCert );
HBufC16* subjectBuf = NULL;
X509CertNameParser::SubjectFullNameL( *mCert, subjectBuf );
CleanupStack::PushL( subjectBuf );
QT_TRYCATCH_LEAVING( mSubjectName =
QString::fromUtf16(subjectBuf->Ptr(), subjectBuf->Length()) );
CleanupStack::PopAndDestroy( subjectBuf );
HBufC16* issuerBuf = NULL;
X509CertNameParser::IssuerFullNameL( *mCert, issuerBuf );
CleanupStack::PushL( issuerBuf );
QT_TRYCATCH_LEAVING( mIssuerName =
QString::fromUtf16(issuerBuf->Ptr(), issuerBuf->Length()));
CleanupStack::PopAndDestroy( issuerBuf );
TPtrC8 fingerprint = mCert->Fingerprint();
QT_TRYCATCH_LEAVING( mFingerprint = QByteArray::fromRawData(
reinterpret_cast<const char*>(fingerprint.Ptr()), fingerprint.Length()) );
mMd5Fingerprint = Md5FingerprintL( mCert->Encoding() );
TPtrC8 serialNumber = mCert->SerialNumber();
QT_TRYCATCH_LEAVING( mSerialNumber = QByteArray::fromRawData(
reinterpret_cast<const char*>(serialNumber.Ptr()), serialNumber.Length()) );
const CValidityPeriod& validityPeriod = mCert->ValidityPeriod();
convertDateTime(validityPeriod.Start(), mValidFrom);
convertDateTime(validityPeriod.Finish(), mValidTo);
mFormat = X509Certificate;
const CSigningAlgorithmIdentifier& alg = mCert->SigningAlgorithm();
mDigestAlgorithm = mapAlgorithm(alg.DigestAlgorithm().Algorithm());
mAsymmetricAlgorithm = mapAlgorithm(alg.AsymmetricAlgorithm().Algorithm());
}
示例4: ApplyCacheOverridesL
void CHttpCacheManager::ApplyCacheOverridesL(CRepository& aRepository, const TUint32& aSecIdInt, TBool& aCacheEnabled, TInt& aCacheSize, TBool& aOpCacheEnabled, TBool& aVssCacheEnabled, TDes& aPath, const TDesC& aDefaultDrive)
{
TDriveUnit drive(aDefaultDrive);
// set defaults
if(aSecIdInt == KUIDBROWSERNG) // for the browser, force use of Operator and VSS caches
{
aOpCacheEnabled = ETrue;
aVssCacheEnabled = ETrue;
}
// read override string from centrep
HBufC16 *overrideBuf = HBufC16::NewLC(64);
TPtr overrideStr(overrideBuf->Des());
TInt strLen;
TInt err = aRepository.Get(KCacheManagerHttpCacheProcessOverride, overrideStr, strLen);
if(strLen > overrideBuf->Length())
{
overrideBuf = overrideBuf->ReAllocL(strLen);
// make sure cleanup stack contains correct pointer since ReAllocL always allocates a new des for larger space.
CleanupStack::Pop();
CleanupStack::PushL(overrideBuf);
// reassign the TPtr
overrideStr.Set(overrideBuf->Des());
// pull in the whole string
aRepository.Get(KCacheManagerHttpCacheProcessOverride, overrideStr, strLen);
}
// if we failed to load an override string, use the default.
if( overrideStr.Length() == 0 )
{
CleanupStack::PopAndDestroy( overrideBuf );
overrideBuf = KDefaultOverrideString().AllocLC();
overrideStr.Set( overrideBuf->Des() );
}
// Built in Lex likes white space to separate strings, but easier to enter with ; separators. Replace all ; with spaces.
TInt pos=0;
do{
if(overrideStr[pos] == ';')
{
overrideStr[pos] = ' ';
}
pos++;
}while(pos < overrideStr.Length());
TLex overrideLex(overrideStr);
do{
TUint32 tempId;
User::LeaveIfError(overrideLex.BoundedVal(tempId,EHex,KMaxTUint32));
if(overrideLex.TokenLength() != 8) // if we're not pointing at an SID in the string, we are incorrect and the override is broken.
User::Leave(KErrCorrupt);
overrideLex.SkipSpace();
TInt32 tempCacheEnabled;
User::LeaveIfError(overrideLex.BoundedVal(tempCacheEnabled,KMaxTInt32));
overrideLex.SkipSpace();
TInt32 tempCacheSize;
User::LeaveIfError(overrideLex.BoundedVal(tempCacheSize,KMaxTInt32));
overrideLex.SkipSpace();
TDriveUnit tempDrive(overrideLex.NextToken());
overrideLex.SkipSpaceAndMark();
// found a hex SID matching ours, use the parameters.
if(tempId == aSecIdInt)
{
aCacheEnabled = tempCacheEnabled;
aCacheSize = tempCacheSize * 1024; // conf is in KB
drive = tempDrive;
break;
}
}while(!overrideLex.Eos());
// Modify drive letter on aPath to match
TParsePtr parsePath(aPath);
TPtrC pathStr(parsePath.Path());
TPath tempPath;
tempPath.Format(_L("%c:%S"), TInt(drive)+'A', &pathStr);
aPath.Copy(tempPath);
HttpCacheUtil::EnsureTrailingSlash( aPath );
CleanupStack::PopAndDestroy(overrideBuf);
}
示例5: ProcessTagL
//.........这里部分代码省略.........
iDestination.SetMetadataL(
ESnapMetadataPurpose,
ESnapPurposeInternet );
}
else if( !ptrTag->Compare( KPurposeOperator ) )
{
iDestination.SetMetadataL(
ESnapMetadataPurpose,
ESnapPurposeOperator );
}
else if( !ptrTag->Compare( KPurposeMMS ) )
{
iDestination.SetMetadataL(
ESnapMetadataPurpose,
ESnapPurposeMMS );
}
else if( !ptrTag->Compare( KPurposeIntranet ) )
{
iDestination.SetMetadataL(
ESnapMetadataPurpose,
ESnapPurposeIntranet );
}
else
{
//no valid data is given - use default value
iDestination.SetMetadataL( ESnapMetadataPurpose,
ESnapPurposeUnknown );
CLOG_WRITE( "! Error : Invalid Metadata. Default:User Defined");
}
}
break;
case EDN_Protection:
{
TPtrC16 protPtr = ptrTag->Right( ptrTag->Length() );
TLex16 lex( protPtr );
TUint32 prot( 0 );
if ( lex.Val( prot, EDecimal ) == KErrNone )
{
if( prot <= EProtLevel3 ) // prot is unsigned so no need
// to check lower boundary
{
iProtectionLevel = TProtectionLevel( prot );
}
else
{
//no valid data is given - use default value
iProtectionLevel = EProtLevel0;
CLOG_WRITE( "! Error : Invalid Protection level. Default:Level0");
}
}
}
break;
case EDN_Hidden:
{
if( !ptrTag->Compare( KStrYes ) )
{
iDestination.SetHiddenL( ETrue );
}
else if( !ptrTag->Compare( KStrNo ) )
{
iDestination.SetHiddenL( EFalse );
}
else
{
//no valid data is given - use default value
iDestination.SetHiddenL( EFalse );