LString16 Class Reference

class LString16 : public RBuf16

This is the 16-bit version of LString8. All the comments on LString8 apply equally.

LString8 RBuf16 TBuf16 TPtr16 HBufC16 TDesC16 TDes16 LString

Inherits from

Public Member Functions
LString16()
LString16(TInt)
LString16(const TDesC16 &)
LString16(const TUint16 *)
LString16(const LString16 &)
LString16(HBufC16 *)
LString16(TUint16 *, TInt)
LString16(TUint16 *, TInt, TInt)
LString16(const wchar_t *)
~LString16()
IMPORT_C voidAppendFillL(TChar, TInt)
IMPORT_C voidAppendFormatL(TRefByValue< const TDesC16 >, ...)
IMPORT_C voidAppendFormatListL(const TDesC16 &, VA_LIST)
IMPORT_C voidAppendJustifyL(const TDesC16 &, TInt, TAlign, TChar)
IMPORT_C voidAppendJustifyL(const TDesC16 &, TInt, TInt, TAlign, TChar)
IMPORT_C voidAppendJustifyL(const TUint16 *, TInt, TAlign, TChar)
IMPORT_C voidAppendJustifyL(const TUint16 *, TInt, TInt, TAlign, TChar)
IMPORT_C voidAppendJustifyL(const wchar_t *, TInt, TAlign, TChar)
IMPORT_C voidAppendJustifyL(const wchar_t *, TInt, TInt, TAlign, TChar)
IMPORT_C voidAppendL(TChar)
IMPORT_C voidAppendL(const TDesC16 &)
IMPORT_C voidAppendL(const TUint16 *, TInt)
IMPORT_C voidAppendL(const TUint16 *)
IMPORT_C voidAppendL(const wchar_t *, TInt)
IMPORT_C voidAppendL(const wchar_t *)
IMPORT_C voidAppendNumFixedWidthL(TUint, TRadix, TInt)
IMPORT_C voidAppendNumFixedWidthUCL(TUint, TRadix, TInt)
IMPORT_C TIntAppendNumL(TReal, const TRealFormat &)
IMPORT_C voidAppendNumL(TInt64)
IMPORT_C voidAppendNumL(TUint64, TRadix)
IMPORT_C voidAppendNumUCL(TUint64, TRadix)
IMPORT_C voidAssign(const LString16 &)
IMPORT_C voidAssign(const RBuf16 &)
IMPORT_C voidAssign(HBufC16 *)
IMPORT_C voidAssign(TUint16 *, TInt)
IMPORT_C voidAssign(TUint16 *, TInt, TInt)
IMPORT_C TIntCompare(const TUint16 *)
IMPORT_C TIntCompare(const wchar_t *)
IMPORT_C TIntCompareF(const TUint16 *)
IMPORT_C TIntCompareF(const wchar_t *)
IMPORT_C voidCompress()
IMPORT_C voidCopyCL(const TDesC16 &)
IMPORT_C voidCopyCPL(const TDesC16 &)
IMPORT_C voidCopyCPL(const TUint16 *)
IMPORT_C voidCopyCPL(const wchar_t *)
IMPORT_C voidCopyFL(const TDesC16 &)
IMPORT_C voidCopyFL(const TUint16 *)
IMPORT_C voidCopyFL(const wchar_t *)
IMPORT_C voidCopyL(const TDesC16 &)
IMPORT_C voidCopyL(const TUint16 *)
IMPORT_C voidCopyL(const TDesC8 &)
IMPORT_C voidCopyL(const TUint16 *, TInt)
IMPORT_C voidCopyL(const wchar_t *)
IMPORT_C voidCopyLCL(const TDesC16 &)
IMPORT_C voidCopyLCL(const TUint16 *)
IMPORT_C voidCopyLCL(const wchar_t *)
IMPORT_C voidCopyUCL(const TDesC16 &)
IMPORT_C voidCopyUCL(const TUint16 *)
IMPORT_C voidCopyUCL(const wchar_t *)
IMPORT_C voidCreateL(RReadStream &, TInt)
IMPORT_C voidFillL(TChar, TInt)
IMPORT_C voidFillZL(TInt)
IMPORT_C TIntFind(const TUint16 *)
IMPORT_C TIntFind(const wchar_t *)
IMPORT_C TIntFind(const wchar_t *, TInt)
IMPORT_C TIntFindF(const TUint16 *)
IMPORT_C TIntFindF(const wchar_t *)
IMPORT_C TIntFindF(const wchar_t *, TInt)
IMPORT_C voidFormatL(TRefByValue< const TDesC16 >, ...)
IMPORT_C voidFormatListL(const TDesC16 &, VA_LIST)
IMPORT_C voidInsertL(TInt, const TDesC16 &)
IMPORT_C voidInsertL(TInt, const TUint16 *)
IMPORT_C voidInsertL(TInt, const wchar_t *)
IMPORT_C voidJustifyL(const TDesC16 &, TInt, TAlign, TChar)
IMPORT_C voidJustifyL(const TUint16 *, TInt, TAlign, TChar)
IMPORT_C voidJustifyL(const wchar_t *, TInt, TAlign, TChar)
IMPORT_C TIntMatch(const TUint16 *)
IMPORT_C TIntMatch(const wchar_t *)
IMPORT_C TIntMatchF(const TUint16 *)
IMPORT_C TIntMatchF(const wchar_t *)
IMPORT_C voidNumFixedWidthL(TUint, TRadix, TInt)
IMPORT_C voidNumFixedWidthUCL(TUint, TRadix, TInt)
IMPORT_C TIntNumL(TReal, const TRealFormat &)
IMPORT_C voidNumL(TInt64)
IMPORT_C voidNumL(TUint64, TRadix)
IMPORT_C voidNumUCL(TUint64, TRadix)
IMPORT_C const TUint16 *PtrZL()
IMPORT_C voidReplaceL(TInt, TInt, const TDesC16 &)
IMPORT_C voidReplaceL(TInt, TInt, const TUint16 *)
IMPORT_C voidReplaceL(TInt, TInt, const wchar_t *)
IMPORT_C voidReserveFreeCapacityL(TInt)
IMPORT_C voidReset()
IMPORT_C voidSetLengthL(TInt)
IMPORT_C voidSetMaxLengthL(TInt)
IMPORT_C voidSwapL(TDes16 &)
IMPORT_C voidSwapL(LString16 &)
IMPORT_C voidZeroTerminateL()
IMPORT_C TBooloperator!=(const TUint16 *)
IMPORT_C TBooloperator!=(const wchar_t *)
IMPORT_C LString16 &operator+=(TChar)
IMPORT_C LString16 &operator+=(const TDesC16 &)
IMPORT_C LString16 &operator+=(const TUint16 *)
IMPORT_C LString16 &operator+=(const wchar_t *)
IMPORT_C TBooloperator<(const TUint16 *)
IMPORT_C TBooloperator<(const wchar_t *)
IMPORT_C TBooloperator<=(const TUint16 *)
IMPORT_C TBooloperator<=(const wchar_t *)
IMPORT_C LString16 &operator=(const TDesC16 &)
IMPORT_C LString16 &operator=(const LString16 &)
IMPORT_C LString16 &operator=(const TUint16 *)
IMPORT_C LString16 &operator=(HBufC16 *)
IMPORT_C LString16 &operator=(const wchar_t *)
IMPORT_C TBooloperator==(const TUint16 *)
IMPORT_C TBooloperator==(const wchar_t *)
IMPORT_C TBooloperator>(const TUint16 *)
IMPORT_C TBooloperator>(const wchar_t *)
IMPORT_C TBooloperator>=(const TUint16 *)
IMPORT_C TBooloperator>=(const wchar_t *)
Private Member Functions
voidAppend(TChar)
voidAppend(const TDesC16 &)
voidAppend(const TUint16 *, TInt)
voidAppendFill(TChar, TInt)
voidAppendFormat(TRefByValue< const TDesC16 >, TDes16Overflow *, ...)
voidAppendFormat(TRefByValue< const TDesC16 >, ...)
voidAppendFormatList(const TDesC16 &, VA_LIST, TDes16Overflow *)
voidAppendJustify(const TDesC16 &, TInt, TAlign, TChar)
voidAppendJustify(const TDesC16 &, TInt, TInt, TAlign, TChar)
voidAppendJustify(const TUint16 *, TInt, TAlign, TChar)
voidAppendJustify(const TUint16 *, TInt, TInt, TAlign, TChar)
TInt AppendNum(TReal, const TRealFormat &)
voidAppendNum(TInt64)
voidAppendNum(TUint64, TRadix)
voidAppendNumFixedWidth(TUint, TRadix, TInt)
voidAppendNumFixedWidthUC(TUint, TRadix, TInt)
voidAppendNumUC(TUint64, TRadix)
voidCleanupClosePushL()
voidClose()
voidCopy(const TDesC8 &)
voidCopy(const TDesC16 &)
voidCopy(const TUint16 *, TInt)
voidCopy(const TUint16 *)
voidCopyC(const TDesC16 &)
voidCopyCP(const TDesC16 &)
voidCopyF(const TDesC16 &)
voidCopyLC(const TDesC16 &)
voidCopyUC(const TDesC16 &)
TInt Create(TInt)
TInt Create(const TDesC16 &)
TInt Create(const TDesC16 &, TInt)
voidCreateL(TInt)
voidCreateL(const TDesC16 &)
voidCreateL(const TDesC16 &, TInt)
TInt CreateMax(TInt)
voidCreateMaxL(TInt)
voidEnsureCapacityIncrementL(TInt)
voidFill(TChar, TInt)
voidFillZ(TInt)
voidFormat(TRefByValue< const TDesC16 >, ...)
voidFormatList(const TDesC16 &, VA_LIST)
voidIncreaseCapacityL()
voidInsert(TInt, const TDesC16 &)
voidJustify(const TDesC16 &, TInt, TAlign, TChar)
TInt Num(TReal, const TRealFormat &)
voidNum(TInt64)
voidNum(TUint64, TRadix)
voidNumFixedWidth(TUint, TRadix, TInt)
voidNumFixedWidthUC(TUint, TRadix, TInt)
voidNumUC(TUint64, TRadix)
const TUint16 *PtrZ()
voidReplace(TInt, TInt, const TDesC16 &)
voidReserveCapacityGrowExponentialL(TInt)
voidReserveCapacityGrowExponentialL()
voidReserveFreeCapacityGrowExponentialL(TInt)
voidReserveL(TInt)
voidSetLength(TInt)
voidSetMax()
voidSwap(TDes16 &)
voidSwap(RBuf16 &)
voidZeroTerminate()
Inherited Functions
RBuf16::RBuf16()
RBuf16::RBuf16(HBufC16 *)
RBuf16::RBuf16(TInt,TInt,TInt)
RBuf16::RBuf16(const RBuf16 &)
RBuf16::ReAlloc(TInt)
RBuf16::ReAllocL(TInt)
RBuf16::operator=(const RBuf16 &)
TDes16::Capitalize()
TDes16::Collapse()
TDes16::Collate()
TDes16::Delete(TInt,TInt)
TDes16::DoAppendNum(TUint64,TRadix,TUint,TInt)
TDes16::DoPadAppendNum(TInt,TInt,const TUint8 *)
TDes16::Fill(TChar)
TDes16::FillZ()
TDes16::Fold()
TDes16::LeftTPtr(TInt)const
TDes16::LowerCase()
TDes16::MaxLength()const
TDes16::MaxSize()const
TDes16::MidTPtr(TInt)const
TDes16::MidTPtr(TInt,TInt)const
TDes16::Repeat(const TDesC16 &)
TDes16::Repeat(const TUint16 *,TInt)
TDes16::RightTPtr(TInt)const
TDes16::TDes16()
TDes16::TDes16(TInt,TInt,TInt)
TDes16::Trim()
TDes16::TrimAll()
TDes16::TrimLeft()
TDes16::TrimRight()
TDes16::UpperCase()
TDes16::WPtr()const
TDes16::Zero()
TDes16::operator=(const TDes16 &)
TDes16::operator[](TInt)
TDes16::operator[](TInt)const
TDesC16::Alloc()const
TDesC16::AllocL()const
TDesC16::AllocLC()const
TDesC16::AtC(TInt)const
TDesC16::Compare(const TDesC16 &)const
TDesC16::CompareC(const TDesC16 &)const
TDesC16::CompareC(const TDesC16 &,TInt,const TCollationMethod *)const
TDesC16::CompareF(const TDesC16 &)const
TDesC16::DoSetLength(TInt)
TDesC16::Find(const TDesC16 &)const
TDesC16::Find(const TUint16 *,TInt)const
TDesC16::FindC(const TDesC16 &)const
TDesC16::FindC(const TDesC16 &,TInt &,const TCollationMethod &,TInt)const
TDesC16::FindC(const TUint16 *,TInt)const
TDesC16::FindC(const TUint16 *,TInt,TInt)const
TDesC16::FindF(const TDesC16 &)const
TDesC16::FindF(const TUint16 *,TInt)const
TDesC16::GetCollationKeysL(TInt,const TCollationMethod *)const
TDesC16::GetFoldedDecomposedFormL()const
TDesC16::GetNormalizedDecomposedFormL()const
TDesC16::HasPrefixC(const TDesC16 &,TInt,const TCollationMethod *)const
TDesC16::Left(TInt)const
TDesC16::Length()const
TDesC16::Locate(TChar)const
TDesC16::LocateF(TChar)const
TDesC16::LocateReverse(TChar)const
TDesC16::LocateReverseF(TChar)const
TDesC16::Match(const TDesC16 &)const
TDesC16::MatchC(const TDesC16 &)const
TDesC16::MatchC(const TDesC16 &,TInt,TInt,TInt,TInt,const TCollationMethod *)const
TDesC16::MatchC(const TDesC16 &,const TCollationMethod *,TInt,TInt,TInt,TInt)const
TDesC16::MatchF(const TDesC16 &)const
TDesC16::Mid(TInt)const
TDesC16::Mid(TInt,TInt)const
TDesC16::Ptr()const
TDesC16::Right(TInt)const
TDesC16::Size()const
TDesC16::TDesC16()
TDesC16::TDesC16(TInt,TInt)
TDesC16::Type()const
TDesC16::operator!=(const TDesC16 &)const
TDesC16::operator<(const TDesC16 &)const
TDesC16::operator<=(const TDesC16 &)const
TDesC16::operator==(const TDesC16 &)const
TDesC16::operator>(const TDesC16 &)const
TDesC16::operator>=(const TDesC16 &)const
Inherited Enumerations
TDesC16:TPrefix
Private Attributes
TInt iReserved
Inherited Attributes
RBuf16::@7
RBuf16::__DECLARE_TEST
RBuf16::iEBufCPtrType
RBuf16::iEPtrType
TDes16::iMaxLength

Constructor & Destructor Documentation

LString16()

LSTRING_CONSTRUCTORS_MAY_LEAVE IMPORT_CLString16()

Default constructor.

Constructs a zero-length 16-bit resizable string descriptor.

Note that the resulting object owns no allocated memory yet. This default constructor never leaves.

LString16(TInt)

IMPORT_CLString16(TIntaInitialCapacity)[explicit]

Constructor to create a 16-bit resizable string descriptor with an initial capacity.

The function allocates sufficient memory to contain descriptor data up to the specified initial maximum length.

The current length of the descriptor is set to zero. The maximum length of the descriptor is set to the specified value.

leave
KErrNoMemory If there is insufficient memory.
RBuf16::CreateL

Parameters

TInt aInitialCapacityThe maximum length of the descriptor.

LString16(const TDesC16 &)

IMPORT_CLString16(const TDesC16 &aDes)

Constructor to create a 16-bit resizable string descriptor to contain a copy of the specified (source) descriptor, or leave on failure.

The constructor allocates sufficient memory so that this string descriptor's maximum length is the same as the length of the source descriptor. Both the current length and the maximum length of this string descriptor are set to the length of the source descriptor.

The data contained in the source descriptor is copied into this string descriptor.

leave
KErrNoMemory If there is insufficient memory.
RBuf16::CreateL()

Parameters

const TDesC16 & aDesSource descriptor to be copied into this object.

LString16(const TUint16 *)

IMPORT_CLString16(const TUint16 *aZeroTerminatedString)

Constructor to create a 16-bit resizable string descriptor containing a copy of the specified (source) zero-terminated string data, or leave on failure.

The constructor allocates sufficient memory so that this string descriptor's maximum length is the same as the length of the source string. Both the current length and the maximum length of this string descriptor are set to the length of the source string.

The data contained in the source string is copied into this string descriptor. The zero terminator is not copied.

leave
KErrNoMemory If there is insufficient memory.
LString16::CopyL

Parameters

const TUint16 * aZeroTerminatedStringA pointer to a zero-terminated string

LString16(const LString16 &)

IMPORT_CLString16(const LString16 &aDes)

Copy constructor to create a 16-bit resizable string descriptor to contain a copy of the specified (source) string descriptor's data, or leave on failure.

The constructor allocates sufficient memory so that this string descriptor's maximum length is the same as the length of the source string descriptor. Both the current length and the maximum length of this string descriptor are set to the length of the source descriptor.

The data contained in the source string descriptor is copied into this string descriptor.

leave
KErrNoMemory If there is insufficient memory.
RBuf16::CreateL()

Parameters

const LString16 & aDesSource string descriptor to be copied into this object.

LString16(HBufC16 *)

IMPORT_CLString16(HBufC16 *aHBuf)[explicit]

Constructor to create a 16-bit resizable string descriptor from a pre-allocated heap descriptor.

Transfers ownership of the specified heap descriptor to this object.

RBuf16::RBuf16(HBufC16*)

Parameters

HBufC16 * aHBufThe heap descriptor to be transferred to this object. This pointer can be NULL, which means that a zero length 16-bit resizable string descriptor is created.

LString16(TUint16 *, TInt)

IMPORT_CLString16(TUint16 *aHeapCell,
TIntaMaxLength
)[explicit]

Constructor to create a 16-bit resizable string descriptor from a pre-allocated raw heap buffer.

The allocated memory forms the buffer for this string descriptor. The current length of the descriptor is set to zero.

panic
USER 8 If the specified maximum length is greater then the size of the allocated heap cell, or the specified maximum length is NOT zero when the pointer to the heap cell is NULL.
RBuf16::Assign()

Parameters

TUint16 * aHeapCellThe allocated memory to be assigned to this object. This pointer can be NULL, which means that a zero length 16-bit resizable buffer descriptor is created.
TInt aMaxLengthThe maximum length of the constructed string descriptor.

LString16(TUint16 *, TInt, TInt)

IMPORT_CLString16(TUint16 *aHeapCell,
TIntaLength,
TIntaMaxLength
)[explicit]

Constructor to create a 16-bit resizable string descriptor from a pre-allocated raw heap buffer.

The allocated memory forms the buffer for this string descriptor. The current length of the descriptor is set to the value of the second parameter.

panic
USER 8 If the specified maximum length is greater then the size of the allocated heap cell, or the specified length is greater then the specified maximum length, or the specified maximum length is NOT zero when the pointer to the heap cell is NULL.
RBuf16::Assign()

Parameters

TUint16 * aHeapCellThe allocated memory to be assigned to this object.
TInt aLengthThe length of the resulting string descriptor.
TInt aMaxLengthThe maximum length of the resulting string descriptor.

LString16(const wchar_t *)

IMPORT_CLString16(const wchar_t *aWideCharStr)

Constructor to create a 16-bit resizable string descriptor containing a copy of the specified (source) zero-terminated wide character string data, or leave on failure.

The constructor allocates sufficient memory so that this string descriptor's maximum length is the same as the length of the source string. Both the current length and the maximum length of this string descriptor are set to the length of the source string.

The data contained in the source string is copied into this string descriptor. The zero terminator is not copied.

leave
KErrNoMemory If there is insufficient memory.
LString16::CopyL

Parameters

const wchar_t * aWideCharStrA pointer to a zero-terminated wide character string

~LString16()

IMPORT_C~LString16()

Destructor.

Frees any heap-allocated resources owned by this string descriptor. It is safe to rely on this destructor to perform all necessary cleanup; it is not necessary use the cleanup stack or to call Close() manually.

RBuf16::Close

Member Functions Documentation

Append(TChar)

voidAppend(TCharaChar)[private]

Parameters

TChar aChar

Append(const TDesC16 &)

voidAppend(const TDesC16 &aDes)[private]

Parameters

const TDesC16 & aDes

Append(const TUint16 *, TInt)

voidAppend(const TUint16 *aBuf,
TIntaLength
)[private]

Parameters

const TUint16 * aBuf
TInt aLength

AppendFill(TChar, TInt)

voidAppendFill(TCharaChar,
TIntaLength
)[private]

Parameters

TChar aChar
TInt aLength

AppendFillL(TChar, TInt)

IMPORT_C voidAppendFillL(TCharaChar,
TIntaLength
)

Appends and fills this descriptor with the specified character.

The descriptor is appended with the specified number of characters. and its length is changed to reflect this.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 11 if aLength is negative

Parameters

TChar aCharThe fill character.
TInt aLengthThe number of fill characters to be appended.

AppendFormat(TRefByValue< const TDesC16 >, TDes16Overflow *, ...)

voidAppendFormat(TRefByValue< const TDesC16 >aFmt,
TDes16Overflow *aOverflowHandler,
...
)[private]

Parameters

TRefByValue< const TDesC16 > aFmt
TDes16Overflow * aOverflowHandler
...

AppendFormat(TRefByValue< const TDesC16 >, ...)

voidAppendFormat(TRefByValue< const TDesC16 >aFmt,
...
)[private]

Parameters

TRefByValue< const TDesC16 > aFmt
...

AppendFormatL(TRefByValue< const TDesC16 >, ...)

IMPORT_C voidAppendFormatL(TRefByValue< const TDesC16 >aFmt,
...
)

Formats and appends text onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

The function takes a format string and a variable number of arguments. The format string contains literal text, embedded with directives, for converting the trailing list of arguments into text.

The embedded directives are character sequences prefixed with the '' character. The literal text is simply copied into this descriptor unaltered while the '' directives are used to convert successive arguments from the trailing list. See the description of the Format() function.

Literal text is appended on a character by character basis, and the underlying buffer is grown as necessary to accommodate it.

Text converted from a trailing argument is appended as a complete string, and the underlying buffer is grown as necessary to accommodate it.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 12 if the format string has incorrect syntax.
TDes16::Format() TDes16Overflow::Overflow()

Parameters

TRefByValue< const TDesC16 > aFmtThe 16-bit non-modifiable descriptor containing the format string. The TRefByValue class provides a constructor which takes a TDesC16 type.
...

AppendFormatList(const TDesC16 &, VA_LIST, TDes16Overflow *)

voidAppendFormatList(const TDesC16 &aFmt,
VA_LISTaList,
TDes16Overflow *aOverflowHandler = NULL
)[private]

Parameters

const TDesC16 & aFmt
VA_LIST aList
TDes16Overflow * aOverflowHandler = NULL

AppendFormatListL(const TDesC16 &, VA_LIST)

IMPORT_C voidAppendFormatListL(const TDesC16 &aFmt,
VA_LISTaList
)

Formats and appends text onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

The behaviour of this function is the same as AppendFormatL(TRefByValue<const TDesC16> aFmt,TDes16Overflow *aOverflowHandler,...). In practice, it is better and easier to use AppendFormat(), passing a variable number of arguments as required by the format string.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
TDes16::AppendFormat VA_LIST

Parameters

const TDesC16 & aFmtThe descriptor containing the format string.
VA_LIST aListA pointer to an argument list.

AppendJustify(const TDesC16 &, TInt, TAlign, TChar)

voidAppendJustify(const TDesC16 &Des,
TIntaWidth,
TAlignanAlignment,
TCharaFill
)[private]

Parameters

const TDesC16 & Des
TInt aWidth
TAlign anAlignment
TChar aFill

AppendJustify(const TDesC16 &, TInt, TInt, TAlign, TChar)

voidAppendJustify(const TDesC16 &Des,
TIntaLength,
TIntaWidth,
TAlignanAlignment,
TCharaFill
)[private]

Parameters

const TDesC16 & Des
TInt aLength
TInt aWidth
TAlign anAlignment
TChar aFill

AppendJustify(const TUint16 *, TInt, TAlign, TChar)

voidAppendJustify(const TUint16 *aZeroTerminatedString,
TIntaWidth,
TAlignanAlignment,
TCharaFill
)[private]

Parameters

const TUint16 * aZeroTerminatedString
TInt aWidth
TAlign anAlignment
TChar aFill

AppendJustify(const TUint16 *, TInt, TInt, TAlign, TChar)

voidAppendJustify(const TUint16 *aZeroTerminatedString,
TIntaLength,
TIntaWidth,
TAlignanAlignment,
TCharaFill
)[private]

Parameters

const TUint16 * aZeroTerminatedString
TInt aLength
TInt aWidth
TAlign anAlignment
TChar aFill

AppendJustifyL(const TDesC16 &, TInt, TAlign, TChar)

IMPORT_C voidAppendJustifyL(const TDesC16 &Des,
TIntaWidth,
TAlignanAlignment,
TCharaFill
)

Appends data onto the end of this descriptor's data and justifies it.

The source of the appended data is an existing descriptor.

The target area is considered to be an area of specified width, immediately following this descriptor's existing data. Source data is copied into, and aligned within this target area according to the specified alignment instruction.

If the length of the target area is larger than the length of the source, then spare space within the target area is padded with the fill character.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 11 if aWidth has a negative value other than KDefaultJustifyWidth.

Parameters

const TDesC16 & Des
TInt aWidthThe width of the target area. If this has the specific negative value KDefaultJustifyWidth, then the width is re-set to the length of the data source.
TAlign anAlignmentThe alignment of the data within the target area.
TChar aFillThe fill character used to pad the target area.

AppendJustifyL(const TDesC16 &, TInt, TInt, TAlign, TChar)

IMPORT_C voidAppendJustifyL(const TDesC16 &Des,
TIntaLength,
TIntaWidth,
TAlignanAlignment,
TCharaFill
)

Appends data onto the end of this descriptor's data and justifies it.

The source of the appended data is an existing descriptor.

The target area is considered to be an area of specified width, immediately following this descriptor's existing data. Source data is copied into, and aligned within this target area according to the specified alignment instruction.

If the length of the target area is larger than the length of the source, then spare space within the target area is padded with the fill character.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 11 if aWidth has a negative value other than KDefaultJustifyWidth.

Parameters

const TDesC16 & Des
TInt aLengthThe length of data to be copied from the source descriptor. If this is greater than the width of the target area, then the length of data copied is limited to the width. The length of data to be copied must not be greater than the length of the source descriptor. Note that this condition is not automatically tested.
TInt aWidthThe width of the target area. If this has the specific negative value KDefaultJustifyWidth, then the width is re-set to the length of the data source.
TAlign anAlignmentThe alignment of the data within the target area.
TChar aFillThe fill character used to pad the target area.

AppendJustifyL(const TUint16 *, TInt, TAlign, TChar)

IMPORT_C voidAppendJustifyL(const TUint16 *aZeroTerminatedString,
TIntaWidth,
TAlignanAlignment,
TCharaFill
)

Appends a zero terminated string onto the end of this descriptor's data and justifies it.

The zero terminator is not copied.

The target area is considered to be an area of specified width, immediately following this descriptor's existing data. Source data is copied into, and aligned within, this target area according to the specified alignment instruction.

If the length of the target area is larger than the length of the source, then spare space within the target area is padded with the fill character.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 11 if aWidth has a negative value other than KDefaultJustifyWidth.

Parameters

const TUint16 * aZeroTerminatedStringA pointer to a zero terminated string The length of the data to be copied is the smaller of: the length of the string (excluding the zero terminator), the width of the target area (only if this is not the explicit negative value KDefaultJustifyWidth).
TInt aWidthThe width of the target area. If this has the specific negative value KDefaultJustifyWidth, then the width is re-set to the length of the zero terminated string (excluding the zero terminator).
TAlign anAlignmentThe alignment of the data within the target area.
TChar aFillThe fill character used to pad the target area.

AppendJustifyL(const TUint16 *, TInt, TInt, TAlign, TChar)

IMPORT_C voidAppendJustifyL(const TUint16 *aString,
TIntaLength,
TIntaWidth,
TAlignanAlignment,
TCharaFill
)

Appends data onto the end of this descriptor's data and justifies it.

The source of the appended data is a memory location.

The target area is considered to be an area of specified width, immediately following this descriptor's existing data. Source data is copied into, and aligned within, this target area according to the specified alignment instruction.

If the length of the target area is larger than the length of the source, then spare space within the target area is padded with the fill character.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 11 if aWidth has a negative value other than KDefaultJustifyWidth.
panic
USER 17 if aLength is negative.

Parameters

const TUint16 * aStringA pointer to a source memory location.
TInt aLengthThe length of data to be copied. If this is greater than the width of the target area, then the length of data copied is limited to the width.
TInt aWidthThe width of the target area. If this has the specific negative value KDefaultJustifyWidth, then the width is re-set to the length of the data source.
TAlign anAlignmentThe alignment of the data within the target area.
TChar aFillThe fill character used to pad the target area.

AppendJustifyL(const wchar_t *, TInt, TAlign, TChar)

IMPORT_C voidAppendJustifyL(const wchar_t *aWideCharStr,
TIntaWidth,
TAlignanAlignment,
TCharaFill
)

Appends data onto the end of this descriptor's data and justifies it.

The source of the appended data is a memory location.

The target area is considered to be an area of specified width, immediately following this descriptor's existing data. Source data is copied into, and aligned within, this target area according to the specified alignment instruction.

If the length of the target area is larger than the length of the source, then spare space within the target area is padded with the fill character.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 11 if aWidth has a negative value other than KDefaultJustifyWidth.
panic
USER 17 if aLength is negative.

Parameters

const wchar_t * aWideCharStrA pointer to a source memory location.
TInt aWidthThe width of the target area. If this has the specific negative value KDefaultJustifyWidth, then the width is re-set to the length of the data source.
TAlign anAlignment
TChar aFillThe fill character used to pad the target area.

AppendJustifyL(const wchar_t *, TInt, TInt, TAlign, TChar)

IMPORT_C voidAppendJustifyL(const wchar_t *aWideCharStr,
TIntaLength,
TIntaWidth,
TAlignanAlignment,
TCharaFill
)

Appends data onto the end of this descriptor's data and justifies it.

The source of the appended data is a memory location.

The target area is considered to be an area of specified width, immediately following this descriptor's existing data. Source data is copied into, and aligned within, this target area according to the specified alignment instruction.

If the length of the target area is larger than the length of the source, then spare space within the target area is padded with the fill character.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 11 if aWidth has a negative value other than KDefaultJustifyWidth.
panic
USER 17 if aLength is negative.

Parameters

const wchar_t * aWideCharStr
TInt aLengthThe length of data to be copied. If this is greater than the width of the target area, then the length of data copied is limited to the width.
TInt aWidthThe width of the target area. If this has the specific negative value KDefaultJustifyWidth, then the width is re-set to the length of the data source.
TAlign anAlignment
TChar aFillThe fill character used to pad the target area.

AppendL(TChar)

IMPORT_C voidAppendL(TCharaChar)

Appends data onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
LString16::operator+=

Parameters

TChar aCharA single character to be appended. The length of the descriptor is incremented by one.

AppendL(const TDesC16 &)

IMPORT_C voidAppendL(const TDesC16 &aDes)

Appends data onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

const TDesC16 & aDesA 16-bit non modifiable descriptor whose data is to be appended.

AppendL(const TUint16 *, TInt)

IMPORT_C voidAppendL(const TUint16 *aBuf,
TIntaLength
)

Appends data onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 17 if aLength is negative.

Parameters

const TUint16 * aBufA pointer to the data to be copied.
TInt aLengthThe length of data to be copied.

AppendL(const TUint16 *)

IMPORT_C voidAppendL(const TUint16 *aZeroTerminatedString)

Appends data onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 17 if aLength is negative.

Parameters

const TUint16 * aZeroTerminatedStringA pointer to the data to be copied.

AppendL(const wchar_t *, TInt)

IMPORT_C voidAppendL(const wchar_t *aWideCharStr,
TIntaLength
)

Appends data onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 17 if aLength is negative.

Parameters

const wchar_t * aWideCharStrA pointer to the data to be copied.
TInt aLengthThe length of data to be copied.

AppendL(const wchar_t *)

IMPORT_C voidAppendL(const wchar_t *aWideCharStr)

Appends data onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 17 if aLength is negative.

Parameters

const wchar_t * aWideCharStrA pointer to the data to be copied.

AppendNum(TReal, const TRealFormat &)

TInt AppendNum(TRealaVal,
const TRealFormat &aFormat
)[private]

Parameters

TReal aVal
const TRealFormat & aFormat

AppendNum(TInt64)

voidAppendNum(TInt64aVal)[private]

Parameters

TInt64 aVal

AppendNum(TUint64, TRadix)

voidAppendNum(TUint64aVal,
TRadixaRadix
)[private]

Parameters

TUint64 aVal
TRadix aRadix

AppendNumFixedWidth(TUint, TRadix, TInt)

voidAppendNumFixedWidth(TUintaVal,
TRadixaRadix,
TIntaWidth
)[private]

Parameters

TUint aVal
TRadix aRadix
TInt aWidth

AppendNumFixedWidthL(TUint, TRadix, TInt)

IMPORT_C voidAppendNumFixedWidthL(TUintaVal,
TRadixaRadix,
TIntaWidth
)

Converts the specified unsigned integer into a fixed width character representation based on the specified number system and appends the conversion onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

The function generates the exact number of specified characters, either padding to the left with character zeroes or discarding low order characters as necessary.

When a hexadecimal conversion is specified, hexadecimal characters are in lower case.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

TUint aValThe unsigned integer value.
TRadix aRadixThe number system representation for the unsigned integer.
TInt aWidthThe number of characters to be used to contain the conversion, and to be appended to this descriptor.

AppendNumFixedWidthUC(TUint, TRadix, TInt)

voidAppendNumFixedWidthUC(TUintaVal,
TRadixaRadix,
TIntaWidth
)[private]

Parameters

TUint aVal
TRadix aRadix
TInt aWidth

AppendNumFixedWidthUCL(TUint, TRadix, TInt)

IMPORT_C voidAppendNumFixedWidthUCL(TUintaVal,
TRadixaRadix,
TIntaWidth
)

Converts the specified unsigned integer into a fixed width character representation based on the specified number system and appends the conversion onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

The function generates the exact number of specified characters, either padding to the left with character zeroes or discarding low order characters as necessary.

When a hexadecimal conversion is specified, hexadecimal characters are in upper case.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

TUint aValThe unsigned integer value.
TRadix aRadixThe number system representation for the unsigned integer.
TInt aWidthThe number of characters: to be used to contain the conversion, to be appended to this descriptor.

AppendNumL(TReal, const TRealFormat &)

IMPORT_C TIntAppendNumL(TRealaVal,
const TRealFormat &aFormat
)

Converts the specified floating point number into a character representation and appends the conversion onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

The character representation of the real number is dictated by the specified format.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

1.KErrArgument - the supplied floating point number is not a valid number. The three characters NaN are appended to this descriptor.

2.KErrOverflow - the number is too large to represent. 2.1 For positive overflow, the three characters Inf are appended to this descriptor. 2.2 For negative overflow, the four characters -Inf are appended to this descriptor.

3.KErrUnderflow - the number is too small to represent. 3.1 For positive underflow, the three characters Inf are appended to this descriptor. 3.2 For negative underflow, the four characters -Inf are appended to this descriptor.

4.KErrGeneral - the conversion cannot be completed. There are a number of possible reasons for this, but the most common is: 4.1 The character representation format (i.e. the format type), as defined in the TRealFormat object is not recognised.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

TReal aValThe floating point number to be converted.
const TRealFormat & aFormatThe format of the conversion.

AppendNumL(TInt64)

IMPORT_C voidAppendNumL(TInt64aVal)

Converts the 64-bit signed integer into a decimal character representation and appends the conversion onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

If the integer is negative, the character representation is prefixed by a minus sign.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

TInt64 aValThe 64-bit signed integer value.

AppendNumL(TUint64, TRadix)

IMPORT_C voidAppendNumL(TUint64aVal,
TRadixaRadix
)

Converts the specified 64 bit integer into a character representation based on the specified number system and appends the conversion onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

When a hexadecimal conversion is specified, hexadecimal characters are in lower case.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

TUint64 aValThe 64 bit integer value. This is always treated as an unsigned value.
TRadix aRadixThe number system representation for the 64 bit integer.

AppendNumUC(TUint64, TRadix)

voidAppendNumUC(TUint64aVal,
TRadixaRadix = EDecimal
)[private]

Parameters

TUint64 aVal
TRadix aRadix = EDecimal

AppendNumUCL(TUint64, TRadix)

IMPORT_C voidAppendNumUCL(TUint64aVal,
TRadixaRadix = EDecimal
)

Converts the specified 64 bit integer into a character representation based on the specified number system and appends the conversion onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

When a hexadecimal conversion is specified, hexadecimal characters are in upper case.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

TUint64 aValThe 64 bit integer value. This is always treated as an unsigned value.
TRadix aRadix = EDecimalThe number system representation for the 64 bit integer. If no explicit value is specified, then EDecimal is the default.

Assign(const LString16 &)

IMPORT_C voidAssign(const LString16 &aString)

Unlinks and transfers ownership of the specified 16-bit resizable descriptor's buffer to this object. The source descriptor is detached from the buffer.

RBuf16::Close()

Parameters

const LString16 & aStringThe source 16-bit resizable buffer. The ownership of this object's buffer is to be transferred.

Assign(const RBuf16 &)

IMPORT_C voidAssign(const RBuf16 &aRBuf)

Transfers ownership of the specified 16-bit resizable descriptor's buffer to this object. The source descriptor is detached from the buffer.

RBuf16::Assign()

Parameters

const RBuf16 & aRBufThe source 16-bit resizable buffer. The ownership of this object's buffer is to be transferred.

Assign(HBufC16 *)

IMPORT_C voidAssign(HBufC16 *aHBuf)

Transfers ownership of the specified 16-bit resizable descriptor's this object.

RBuf16::Assign()

Parameters

HBufC16 * aHBufThe heap descriptor to be transferred to this object. The ownership of this object's buffer is to be transferred.

Assign(TUint16 *, TInt)

IMPORT_C voidAssign(TUint16 *aHeapCell,
TIntaMaxLength
)

Assigns ownership of the specified allocated memory to this object.

panic
USER 8 If the specified maximum length is greater then the size of the allocated heap cell, or the specified maximum length is NOT zero when the pointer to the heap cell is NULL.
RBuf16::Close() RBuf16::Assign()

Parameters

TUint16 * aHeapCellThe allocated memory to be assigned to this object. This pointer can be NULL, which means that a zero length 16-bit resizable buffer descriptor is created.
TInt aMaxLengthThe maximum length of the descriptor.

Assign(TUint16 *, TInt, TInt)

IMPORT_C voidAssign(TUint16 *aHeapCell,
TIntaLength,
TIntaMaxLength
)

Transfers ownership of the specified 16-bit resizable descriptor's this object.

panic
USER 8 If the specified maximum length is greater then the size of the allocated heap cell, or the specified length is greater then the specified maximum length, or the specified maximum length is NOT zero when the pointer to the heap cell is NULL.
RBuf16::Close() RBuf16::Assign()

Parameters

TUint16 * aHeapCellThe allocated memory to be assigned to this object.
TInt aLengthThe length of the descriptor.
TInt aMaxLengthThe maximum length of the descriptor.

CleanupClosePushL()

voidCleanupClosePushL()[private]

Close()

voidClose()[private]

Compare(const TUint16 *)

IMPORT_C TIntCompare(const TUint16 *aZeroTerminatedString)const

Compares this descriptor's data with the specified string's data.

The comparison proceeds on a byte for byte basis. The result of the comparison is based on the difference of the first bytes to disagree.

Parameters

const TUint16 * aZeroTerminatedStringThe wide Zero TerminatedString string whose data is to be compared with this Descriptor's data.

Compare(const wchar_t *)

IMPORT_C TIntCompare(const wchar_t *aWideCharStr)const

Compares this descriptor's data with the specified string's data.

The comparison proceeds on a byte for byte basis. The result of the comparison is based on the difference of the first bytes to disagree.

Parameters

const wchar_t * aWideCharStrThe wide character string whose data is to be compared with this Descriptor's data.

CompareF(const TUint16 *)

IMPORT_C TIntCompareF(const TUint16 *aZeroTerminatedString)const

Compares this descriptor's folded data with the specified string's folded data.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for comparing strings in natural language;

TDesC::Compare()

Parameters

const TUint16 * aZeroTerminatedStringThe wide Zero Terminated String whose data is to be compared with this string's data.

CompareF(const wchar_t *)

IMPORT_C TIntCompareF(const wchar_t *aWideCharStr)const

Compares this descriptor's folded data with the specified string's folded data.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for comparing strings in natural language;

TDesC::Compare()

Parameters

const wchar_t * aWideCharStrThe wide character string whose data is to be compared with this Descriptor's data.

Compress()

IMPORT_C voidCompress()

Re-allocates a smaller descriptor buffer space to the current descriptor length

This may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

If there is insufficient memory to re-allocate the buffer then the descriptor left unchanged

Copy(const TDesC8 &)

voidCopy(const TDesC8 &aDes)[private]

Parameters

const TDesC8 & aDes

Copy(const TDesC16 &)

voidCopy(const TDesC16 &aDes)[private]

Parameters

const TDesC16 & aDes

Copy(const TUint16 *, TInt)

voidCopy(const TUint16 *aBuf,
TIntaLength
)[private]

Parameters

const TUint16 * aBuf
TInt aLength

Copy(const TUint16 *)

voidCopy(const TUint16 *aString)[private]

Parameters

const TUint16 * aString

CopyC(const TDesC16 &)

voidCopyC(const TDesC16 &aDes)[private]

Parameters

const TDesC16 & aDes

CopyCL(const TDesC16 &)

IMPORT_C voidCopyCL(const TDesC16 &aDes)

Copies and collates data from the specified descriptor into this descriptor replacing any existing data.

The length of this descriptor is set to reflect the new data.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

const TDesC16 & aDesA 16-bit non-modifiable descriptor.

CopyCP(const TDesC16 &)

voidCopyCP(const TDesC16 &aDes)[private]

Parameters

const TDesC16 & aDes

CopyCPL(const TDesC16 &)

IMPORT_C voidCopyCPL(const TDesC16 &aDes)

Copies text from the specified descriptor and capitalises it before putting it into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

Capitalisation is implemented as appropriate to the current locale.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

const TDesC16 & aDesA 16-bit non-modifiable descriptor.

CopyCPL(const TUint16 *)

IMPORT_C voidCopyCPL(const TUint16 *aZeroTerminatedString)

Copies text from the specified string and capitalises it before putting it into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

Capitalisation is implemented as appropriate to the current locale.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

const TUint16 * aZeroTerminatedStringA wide zero terminated string.

CopyCPL(const wchar_t *)

IMPORT_C voidCopyCPL(const wchar_t *aWideCharStr)

Copies text from the specified string and capitalises it before putting it into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

Capitalisation is implemented as appropriate to the current locale.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

const wchar_t * aWideCharStrA wide character string.

CopyF(const TDesC16 &)

voidCopyF(const TDesC16 &aDes)[private]

Parameters

const TDesC16 & aDes

CopyFL(const TDesC16 &)

IMPORT_C voidCopyFL(const TDesC16 &aDes)

Copies and folds data from the specified descriptor into this descriptor replacing any existing data.

The length of this descriptor is set to reflect the new data.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used when dealing with strings in natural language.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

const TDesC16 & aDesA 16-bit non-modifiable descriptor.

CopyFL(const TUint16 *)

IMPORT_C voidCopyFL(const TUint16 *aZeroTerminatedString)

Copies and folds data from the specified string into this descriptor replacing any existing data.

The length of this descriptor is set to reflect the new data.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used when dealing with strings in natural language.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

const TUint16 * aZeroTerminatedStringA wide zero terminated string

CopyFL(const wchar_t *)

IMPORT_C voidCopyFL(const wchar_t *aWideCharStr)

Copies and folds data from the specified string into this descriptor replacing any existing data.

The length of this descriptor is set to reflect the new data.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used when dealing with strings in natural language.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

const wchar_t * aWideCharStrA wide character string

CopyL(const TDesC16 &)

IMPORT_C voidCopyL(const TDesC16 &aDes)

Copies data into this 16-bit string descriptor, replacing any existing data, and expanding its heap buffer to accommodate if necessary.

The length of this descriptor is set to reflect the new data.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory If the heap buffer of the string descriptor being assigned to needs to be expanded, but there is insufficient memory to do so
LString16::operator= TDes16::Copy

Parameters

const TDesC16 & aDesA 16-bit non-modifiable descriptor.

CopyL(const TUint16 *)

IMPORT_C voidCopyL(const TUint16 *aZeroTerminatedString)

Copies data into this 16-bit string descriptor, replacing any existing data, and expanding its heap buffer to accommodate if necessary.

The length of this descriptor is set to reflect the new data.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory If the heap buffer of the string descriptor being assigned to needs to be expanded, but there is insufficient memory to do so
LString16::operator= TDes16::Copy

Parameters

const TUint16 * aZeroTerminatedStringA pointer to a zero-terminated string

CopyL(const TDesC8 &)

IMPORT_C voidCopyL(const TDesC8 &aDes)

Copies 8-bit descriptor data into this 16-bit string descriptor, replacing any existing data, and expanding its heap buffer to accommodate if necessary.

The length of this descriptor is set to reflect the new data.

Each 8-bit character value is widened to a 16-bit character value as part of the copying process.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory If the heap buffer of the string descriptor being assigned to needs to be expanded, but there is insufficient memory to do so
LString16::operator= TDes16::Copy

Parameters

const TDesC8 & aDesAn 8 bit non modifiable descriptor.

CopyL(const TUint16 *, TInt)

IMPORT_C voidCopyL(const TUint16 *aBuf,
TIntaLength
)

Copies data into this 16-bit string descriptor, replacing any existing data, and expanding its heap buffer to accommodate if necessary.

The length of this descriptor is set according to the second parameter.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory If the heap buffer of the string descriptor being assigned to needs to be expanded, but there is insufficient memory to do so
panic
USER 11 if aLength is negative.
TDes16::Copy

Parameters

const TUint16 * aBufThe start address of data to be copied.
TInt aLengthThe length of data to be copied.

CopyL(const wchar_t *)

IMPORT_C voidCopyL(const wchar_t *aWideCharStr)

Copies data into this 16-bit string descriptor, replacing any existing data, and expanding its heap buffer to accommodate if necessary.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory If the heap buffer of the string descriptor being assigned to needs to be expanded, but there is insufficient memory to do so
panic
USER 11 if aLength is negative.
TDes16::Copy

Parameters

const wchar_t * aWideCharStrA pointer to a wide character zero terminated string to be copied.

CopyLC(const TDesC16 &)

voidCopyLC(const TDesC16 &aDes)[private]

Parameters

const TDesC16 & aDes

CopyLCL(const TDesC16 &)

IMPORT_C voidCopyLCL(const TDesC16 &aDes)

Copies text from the specified descriptor and converts it to lower case before putting it into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

Conversion to lower case is implemented as appropriate to the current locale.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

const TDesC16 & aDesA 16-bit non modifiable descriptor.

CopyLCL(const TUint16 *)

IMPORT_C voidCopyLCL(const TUint16 *aZeroTerminatedString)

Copies text from the specified string and converts it to lower case before putting it into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

Conversion to lower case is implemented as appropriate to the current locale.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

const TUint16 * aZeroTerminatedStringA wide zero terminated string.

CopyLCL(const wchar_t *)

IMPORT_C voidCopyLCL(const wchar_t *aWideCharStr)

Copies text from the specified string and converts it to lower case before putting it into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

Conversion to lower case is implemented as appropriate to the current locale.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

const wchar_t * aWideCharStrA wide character string.

CopyUC(const TDesC16 &)

voidCopyUC(const TDesC16 &aDes)[private]

Parameters

const TDesC16 & aDes

CopyUCL(const TDesC16 &)

IMPORT_C voidCopyUCL(const TDesC16 &aDes)

Copies text from the specified descriptor and converts it to upper case before putting it into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

Conversion to upper case is implemented as appropriate to the current locale.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

const TDesC16 & aDesA 16-bit non modifiable descriptor.

CopyUCL(const TUint16 *)

IMPORT_C voidCopyUCL(const TUint16 *aZeroTerminatedString)

Copies text from the specified string and converts it to upper case before putting it into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

Conversion to upper case is implemented as appropriate to the current locale.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

const TUint16 * aZeroTerminatedStringA wide zero terminated string.

CopyUCL(const wchar_t *)

IMPORT_C voidCopyUCL(const wchar_t *aWideCharStr)

Copies text from the specified string and converts it to upper case before putting it into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

Conversion to upper case is implemented as appropriate to the current locale.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

const wchar_t * aWideCharStrA wide character string.

Create(TInt)

TInt Create(TIntaMaxLength)[private]

Parameters

TInt aMaxLength

Create(const TDesC16 &)

TInt Create(const TDesC16 &aDes)[private]

Parameters

const TDesC16 & aDes

Create(const TDesC16 &, TInt)

TInt Create(const TDesC16 &aDes,
TIntaMaxLength
)[private]

Parameters

const TDesC16 & aDes
TInt aMaxLength

CreateL(RReadStream &, TInt)

IMPORT_C voidCreateL(RReadStream &aStream,
TIntaMaxLength
)

Creates a 16-bit resizable buffer descriptor that has been initialised with data from the specified read stream; leaves on failure.

Data is assigned to the new descriptor from the specified stream. This variant assumes that the stream contains the length of the data followed by the data itself.

The function is implemented by calling the HBufC16::NewL(RReadStream&,TInt) variant and then assigning the resulting heap descriptor using the RBuf16::Assign(HBufC16*) variant. The comments that describe the HBufC16::NewL() variant also apply to this RBuf16::CreateL() function.

The function may leave with one of the system-wide error codes, specifically KErrOverflow, if the length of the data as read from the stream is greater than the upper limit as specified by the aMaxLength parameter.

Parameters

RReadStream & aStreamThe stream from which the data length and the data to be assigned to the new descriptor, are taken.
TInt aMaxLengthThe upper limit on the length of data that the descriptor is to represent. The value of this parameter must be non-negative otherwise the underlying function will panic.

CreateL(TInt)

voidCreateL(TIntaMaxLength)[private]

Parameters

TInt aMaxLength

CreateL(const TDesC16 &)

voidCreateL(const TDesC16 &aDes)[private]

Parameters

const TDesC16 & aDes

CreateL(const TDesC16 &, TInt)

voidCreateL(const TDesC16 &aDes,
TIntaMaxLength
)[private]

Parameters

const TDesC16 & aDes
TInt aMaxLength

CreateMax(TInt)

TInt CreateMax(TIntaMaxLength)[private]

Parameters

TInt aMaxLength

CreateMaxL(TInt)

voidCreateMaxL(TIntaMaxLength)[private]

Parameters

TInt aMaxLength

EnsureCapacityIncrementL(TInt)

voidEnsureCapacityIncrementL(TIntaLengthIncrement)[private]

Parameters

TInt aLengthIncrement

Fill(TChar, TInt)

voidFill(TCharaChar,
TIntaLength
)[private]

Parameters

TChar aChar
TInt aLength

FillL(TChar, TInt)

IMPORT_C voidFillL(TCharaChar,
TIntaLength
)

Fills the descriptor's data area with the specified character, replacing any existing data.

The descriptor is filled with the specified number of characters, and its length is changed to reflect this.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 11 if aLength is negative

Parameters

TChar aCharThe fill character.
TInt aLengthThe new length of the descriptor and the number of fill characters to be copied into it.

FillZ(TInt)

voidFillZ(TIntaLength)[private]

Parameters

TInt aLength

FillZL(TInt)

IMPORT_C voidFillZL(TIntaLength)

Fills the descriptor's data area with binary zeroes, i.e. 0x0000, replacing any existing data, and changes its length.

The descriptor is filled with the specified number of binary zeroes. The descriptor's length is changed to reflect this.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 11 if aLength is negative

Parameters

TInt aLengthThe new length of the descriptor and the number of binary zeroes to be copied into it.

Find(const TUint16 *)

IMPORT_C TIntFind(const TUint16 *aZeroTerminatedString)const

Searches for the first occurrence of the specified data sequence within this descriptor.

Searching always starts at the beginning of this descriptor's data.

Parameters

const TUint16 * aZeroTerminatedString

Find(const wchar_t *)

IMPORT_C TIntFind(const wchar_t *aWideCharStr)const

Searches for the first occurrence of the specified data sequence within this descriptor.

Searching always starts at the beginning of this descriptor's data.

Parameters

const wchar_t * aWideCharStrThe wide character string whose data is to be searched for, within this Descriptor's data.

Find(const wchar_t *, TInt)

IMPORT_C TIntFind(const wchar_t *aWideCharStr,
TIntaLenS
)const

Searches for the first occurrence of the specified data sequence within this descriptor.

Searching always starts at the beginning of this descriptor's data.

panic
USER 29 if aLenS is negative.

Parameters

const wchar_t * aWideCharStrThe wide character string whose data is to be searched for, within this Descriptor's data.
TInt aLenSThe length of the data sequence to be searched for. This value must not be negative, otherwise the function raises a panic.

FindF(const TUint16 *)

IMPORT_C TIntFindF(const TUint16 *aZeroTerminatedString)const

Searches for the first occurrence of the specified folded data sequence within this descriptor's folded data.

Searching always starts at the beginning of this descriptor's data.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for finding strings in natural language;

Parameters

const TUint16 * aZeroTerminatedString

FindF(const wchar_t *)

IMPORT_C TIntFindF(const wchar_t *aWideCharStr)const

Searches for the first occurrence of the specified folded data sequence within this descriptor's folded data.

Searching always starts at the beginning of this descriptor's data.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for finding strings in natural language;

Parameters

const wchar_t * aWideCharStrThe wide character string whose data is to be searched for, within this Descriptor's data.

FindF(const wchar_t *, TInt)

IMPORT_C TIntFindF(const wchar_t *aWideCharStr,
TIntaLenS
)const

Searches for the first occurrence of the specified folded data sequence within this descriptor's folded data.

Searching always starts at the beginning of this descriptor's data.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for finding strings in natural language;

panic
USER 29 if aLenS is negative

Parameters

const wchar_t * aWideCharStrThe wide character string whose data is to be searched for, within this Descriptor's data.
TInt aLenSThe length of the data sequence to be searched for. This value must not be negative, otherwise the function raises a panic.

Format(TRefByValue< const TDesC16 >, ...)

voidFormat(TRefByValue< const TDesC16 >aFmt,
...
)[private]

Parameters

TRefByValue< const TDesC16 > aFmt
...

FormatL(TRefByValue< const TDesC16 >, ...)

IMPORT_C voidFormatL(TRefByValue< const TDesC16 >aFmt,
...
)

Formats and copies text into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

The function takes a format string and a variable number of arguments. The format string contains literal text embedded with directives for converting the trailing list of arguments into text.

The embedded directives are character sequences prefixed with the '' character. The literal text is simply copied into this descriptor unaltered while the '' directives are used to convert successive arguments from the trailing list.

The resulting stream of literal text and converted arguments is copied into this descriptor.

The syntax of the embedded directives follows one of four general patterns.

Note that formatting of single numerical values can be achieved more conveniently using the Num() and NumUC() member functions of this class.

The full description of the syntax of a format string cannot be included here. For full details, navigate to the Symbian OS guide, and follow the hierarchy of links:

Symbian OS Guide
	Base
		Using  User Library (E32)
			Buffers and Strings
				Using Descriptors
					How to Use Descriptors
						Format string syntax

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

panic
USER 12 if the format string has incorrect syntax.
leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
TDes16::Num() TDes16::NumUC()

Parameters

TRefByValue< const TDesC16 > aFmtThe descriptor containing the format string. The TRefByValue class provides a constructor which takes a TDesC8 type.
...

FormatList(const TDesC16 &, VA_LIST)

voidFormatList(const TDesC16 &aFmt,
VA_LISTaList
)[private]

Parameters

const TDesC16 & aFmt
VA_LIST aList

FormatListL(const TDesC16 &, VA_LIST)

IMPORT_C voidFormatListL(const TDesC16 &aFmt,
VA_LISTaList
)

Formats and copies text into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

The behaviour of this function is the same as FormatL(). In practice, it is better and easier to use FormatL(), passing a variable number of arguments as required by the format string.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
TDes16::Format() VA_LIST

Parameters

const TDesC16 & aFmtThe descriptor containing the format string.
VA_LIST aListA pointer to an argument list.

IncreaseCapacityL()

voidIncreaseCapacityL()[private]

Insert(TInt, const TDesC16 &)

voidInsert(TIntaPos,
const TDesC16 &aDes
)[private]

Parameters

TInt aPos
const TDesC16 & aDes

InsertL(TInt, const TDesC16 &)

IMPORT_C voidInsertL(TIntaPos,
const TDesC16 &aDes
)

Inserts data into this descriptor.

The length of this descriptor is changed to reflect the extra data.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 10 if aPos is negative or is greater than the length of this descriptor.

Parameters

TInt aPosThe position within the data where insertion is to start. This is an offset value; a zero value refers to the leftmost data position.
const TDesC16 & aDesA 16-bit non modifiable descriptor whose data is to be inserted.

InsertL(TInt, const TUint16 *)

IMPORT_C voidInsertL(TIntaPos,
const TUint16 *aZeroTerminatedString
)

Inserts data into this descriptor.

The length of this descriptor is changed to reflect the extra data.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 10 if aPos is negative or is greater than the length of this descriptor.

Parameters

TInt aPosThe position within the data where insertion is to start. This is an offset value; a zero value refers to the leftmost data position.
const TUint16 * aZeroTerminatedStringA wide null terminated string.

InsertL(TInt, const wchar_t *)

IMPORT_C voidInsertL(TIntaPos,
const wchar_t *aWideCharStr
)

Inserts data into this descriptor.

The length of this descriptor is changed to reflect the extra data.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 10 if aPos is negative or is greater than the length of this descriptor.

Parameters

TInt aPosThe position within the data where insertion is to start. This is an offset value; a zero value refers to the leftmost data position.
const wchar_t * aWideCharStrA wide character string.

Justify(const TDesC16 &, TInt, TAlign, TChar)

voidJustify(const TDesC16 &aDes,
TIntaWidth,
TAlignanAlignment,
TCharaFill
)[private]

Parameters

const TDesC16 & aDes
TInt aWidth
TAlign anAlignment
TChar aFill

JustifyL(const TDesC16 &, TInt, TAlign, TChar)

IMPORT_C voidJustifyL(const TDesC16 &aDes,
TIntaWidth,
TAlignanAlignment,
TCharaFill
)

Copies data into this descriptor and justifies it, replacing any existing data.

The length of this descriptor is set to reflect the new data.

The target area is considered to be an area of specified width positioned at the beginning of this descriptor's data area. Source data is copied into, and aligned within this target area according to the specified alignment instruction.

If the length of the target area is larger than the length of the source, then spare space within the target area is padded with the fill character.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 11 if aWidth has a negative value other than KDefaultJustifyWidth.

Parameters

const TDesC16 & aDesA 16-bit non-modifiable descriptor containing the source data. The length of the data to be copied is the smaller of: the length of the source descriptor, and the width of the target area (only if this is not the explicit negative value KDefaultJustifyWidth).
TInt aWidthThe width of the target area. If this has the specific negative value KDefaultJustifyWidth, then the width is re-set to the length of the data source.
TAlign anAlignmentThe alignment of the data within the target area
TChar aFillThe fill character used to pad the target area.

JustifyL(const TUint16 *, TInt, TAlign, TChar)

IMPORT_C voidJustifyL(const TUint16 *aZeroTerminatedString,
TIntaWidth,
TAlignanAlignment,
TCharaFill
)

Copies data into this descriptor and justifies it, replacing any existing data.

The length of this descriptor is set to reflect the new data.

The target area is considered to be an area of specified width positioned at the beginning of this descriptor's data area. Source data is copied into, and aligned within this target area according to the specified alignment instruction.

If the length of the target area is larger than the length of the source, then spare space within the target area is padded with the fill character.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 11 if aWidth has a negative value other than KDefaultJustifyWidth.

Parameters

const TUint16 * aZeroTerminatedString
TInt aWidthThe width of the target area. If this has the specific negative value KDefaultJustifyWidth, then the width is re-set to the length of the data source.
TAlign anAlignment
TChar aFillThe fill character used to pad the target area.

JustifyL(const wchar_t *, TInt, TAlign, TChar)

IMPORT_C voidJustifyL(const wchar_t *aWideCharStr,
TIntaWidth,
TAlignanAlignment,
TCharaFill
)

Copies data into this descriptor and justifies it, replacing any existing data.

The length of this descriptor is set to reflect the new data.

The target area is considered to be an area of specified width positioned at the beginning of this descriptor's data area. Source data is copied into, and aligned within this target area according to the specified alignment instruction.

If the length of the target area is larger than the length of the source, then spare space within the target area is padded with the fill character.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 11 if aWidth has a negative value other than KDefaultJustifyWidth.

Parameters

const wchar_t * aWideCharStrA wide character string containing the source data. The length of the data to be copied is the smaller of: the length of the source descriptor, and the width of the target area (only if this is not the explicit negative value KDefaultJustifyWidth).
TInt aWidthThe width of the target area. If this has the specific negative value KDefaultJustifyWidth, then the width is re-set to the length of the data source.
TAlign anAlignment
TChar aFillThe fill character used to pad the target area.

Match(const TUint16 *)

IMPORT_C TIntMatch(const TUint16 *aZeroTerminatedString)const

Searches this descriptor's data for a match with the match pattern supplied in the specified string.

The match pattern can contain the wildcard characters "*" and "?", where "*" matches zero or more consecutive occurrences of any character and "?" matches a single occurrence of any character.

Note that there is no 'escape character', which means that it is not possible to match either the "*" character itself or the "?" character itself using this function.

Parameters

const TUint16 * aZeroTerminatedStringThe wide Zero TerminatedString string whose data is to be matched with this Descriptor's data.

Match(const wchar_t *)

IMPORT_C TIntMatch(const wchar_t *aWideCharStr)const

Searches this descriptor's data for a match with the match pattern supplied in the specified string.

The match pattern can contain the wildcard characters "*" and "?", where "*" matches zero or more consecutive occurrences of any character and "?" matches a single occurrence of any character.

Note that there is no 'escape character', which means that it is not possible to match either the "*" character itself or the "?" character itself using this function.

Parameters

const wchar_t * aWideCharStrThe wide character string whose data is to be matched with this Descriptor's data.

MatchF(const TUint16 *)

IMPORT_C TIntMatchF(const TUint16 *aZeroTerminatedString)const

Searches this descriptor's folded data for a match with the folded match pattern supplied in the specified string.

The match pattern can contain the wildcard characters "*" and "?", where "*" matches zero or more consecutive occurrences of any character and "?" matches a single occurrence of any character.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for matching strings in natural language; use MatchC() for this.

Note that there is no 'escape character', which means that it is not possible to match either the "*" character itself or the "?" character itself using this function.

TDesC::MatchC()

Parameters

const TUint16 * aZeroTerminatedStringThe wide Zero TerminatedString string whose data is to be matched with this Descriptor's data.

MatchF(const wchar_t *)

IMPORT_C TIntMatchF(const wchar_t *aWideCharStr)const

Searches this descriptor's folded data for a match with the folded match pattern supplied in the specified string.

The match pattern can contain the wildcard characters "*" and "?", where "*" matches zero or more consecutive occurrences of any character and "?" matches a single occurrence of any character.

Note that folding is locale-independent behaviour. It is also important to note that there can be no guarantee that folding is in any way culturally appropriate, and should not be used for matching strings in natural language; use MatchC() for this.

Note that there is no 'escape character', which means that it is not possible to match either the "*" character itself or the "?" character itself using this function.

TDesC::MatchC()

Parameters

const wchar_t * aWideCharStrThe wide character string whose data is to be matched with this Descriptor's data.

Num(TReal, const TRealFormat &)

TInt Num(TRealaVal,
const TRealFormat &aFormat
)[private]

Parameters

TReal aVal
const TRealFormat & aFormat

Num(TInt64)

voidNum(TInt64aVal)[private]

Parameters

TInt64 aVal

Num(TUint64, TRadix)

voidNum(TUint64aVal,
TRadixaRadix
)[private]

Parameters

TUint64 aVal
TRadix aRadix

NumFixedWidth(TUint, TRadix, TInt)

voidNumFixedWidth(TUintaVal,
TRadixaRadix,
TIntaWidth
)[private]

Parameters

TUint aVal
TRadix aRadix
TInt aWidth

NumFixedWidthL(TUint, TRadix, TInt)

IMPORT_C voidNumFixedWidthL(TUintaVal,
TRadixaRadix,
TIntaWidth
)

Converts the specified unsigned integer into a fixed width character representation based on the specified number system and copies the conversion into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

The function generates the exact number of specified characters, either padding to the left with character zeroes or discarding low order characters as necessary.

When a hexadecimal conversion is specified, hexadecimal characters are in lower case.

This function is equivalent to using Format() with parameters which specify:

1. a fixed length target field

2. padding with zero characters, for example "%08x".

When this is the case, always use NumFixedWidth() in preference to Format() as it is more efficient.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

TUint aValThe unsigned integer value.
TRadix aRadixThe number system representation for the unsigned integer.
TInt aWidthThe number of characters: to be used to contain the conversion, to be copied into this descriptor.

NumFixedWidthUC(TUint, TRadix, TInt)

voidNumFixedWidthUC(TUintaVal,
TRadixaRadix,
TIntaWidth
)[private]

Parameters

TUint aVal
TRadix aRadix
TInt aWidth

NumFixedWidthUCL(TUint, TRadix, TInt)

IMPORT_C voidNumFixedWidthUCL(TUintaVal,
TRadixaRadix,
TIntaWidth
)

Converts the specified unsigned integer into a fixed width character representation based on the specified number system and copies the conversion into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

The function generates the exact number of specified characters, either padding to the left with character zeroes or discarding low order characters as necessary.

When a hexadecimal conversion is specified, hexadecimal characters are in upper case.

This function is equivalent to using Format() with parameters which specify:

1. a fixed length target field

2. padding with zero characters, for example "%08x".

When this is the case, always use NumFixedWidthUC() in preference to Format() as it is more efficient.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
TDes16::Format()

Parameters

TUint aValThe unsigned integer value.
TRadix aRadixThe number system representation for the unsigned integer.
TInt aWidthThe number of characters: to be used to contain the conversion, to be copied into this descriptor.

NumL(TReal, const TRealFormat &)

IMPORT_C TIntNumL(TRealaVal,
const TRealFormat &aFormat
)

Converts the specified floating point number into a character representation and copies the conversion into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

The character representation of the real number is dictated by the specified format.

Note that the function leaves if the iType data member of the specified TRealFormat object has both an invalid character representation format (i.e. the format type) and invalid format flags.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

1.KErrArgument - the supplied floating point number is not a valid number. The three characters NaN are appended to this descriptor.

2.KErrOverflow - the number is too large to represent. 2.1 For positive overflow, the three characters Inf are appended to this descriptor. 2.2 For negative overflow, the four characters -Inf are appended to this descriptor.

3.KErrUnderflow - the number is too small to represent. 3.1 For positive underflow, the three characters Inf are appended to this descriptor. 3.2 For negative underflow, the four characters -Inf are appended to this descriptor.

4.KErrGeneral - the conversion cannot be completed. There are a number of possible reasons for this, but the most common is: 4.1 The character representation format (i.e. the format type), as defined in the TRealFormat object is not recognised.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
TRealFormat::iType

Parameters

TReal aValThe floating point number to be converted.
const TRealFormat & aFormatThe format of the conversion.

NumL(TInt64)

IMPORT_C voidNumL(TInt64aVal)

Converts the 64-bit signed integer into a decimal character representation and copies the conversion into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

If the integer is negative, the character representation is prefixed by a minus sign.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

TInt64 aValThe 64-bit signed integer value.

NumL(TUint64, TRadix)

IMPORT_C voidNumL(TUint64aVal,
TRadixaRadix
)

Converts the specified 64 bit unsigned integer into a character representation based on the specified number system and copies the conversion into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

When a hexadecimal conversion is specified, hexadecimal characters are in lower case.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

TUint64 aValThe 64 bit integer value. This is treated as an unsigned value for all builds.
TRadix aRadixThe number system representation for the 64 bit integer.

NumUC(TUint64, TRadix)

voidNumUC(TUint64aVal,
TRadixaRadix = EDecimal
)[private]

Parameters

TUint64 aVal
TRadix aRadix = EDecimal

NumUCL(TUint64, TRadix)

IMPORT_C voidNumUCL(TUint64aVal,
TRadixaRadix = EDecimal
)

Converts the specified 64 bit unsigned integer into a character representation based on the specified number system and copies the conversion into this descriptor, replacing any existing data.

The length of this descriptor is set to reflect the new data.

When a hexadecimal conversion is specified, hexadecimal characters are in upper case.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

TUint64 aValThe 64 bit integer value. This is always treated as an unsigned value for all builds.
TRadix aRadix = EDecimalThe number system representation for the 64 bit integer. If no explicit value is specified, then EDecimal is the default.

PtrZ()

const TUint16 *PtrZ()[private]

PtrZL()

IMPORT_C const TUint16 *PtrZL()

Appends a zero terminator onto the end of this descriptor's data and returns a pointer to the data.

The length of the descriptor is not changed, but the capacity of the descriptor may need to be grown to accommodate the zero terminator.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Replace(TInt, TInt, const TDesC16 &)

voidReplace(TIntaPos,
TIntaLength,
const TDesC16 &aDes
)[private]

Parameters

TInt aPos
TInt aLength
const TDesC16 & aDes

ReplaceL(TInt, TInt, const TDesC16 &)

IMPORT_C voidReplaceL(TIntaPos,
TIntaLength,
const TDesC16 &aDes
)

Replaces data in this descriptor.

The specified length can be different to the length of the replacement data. The length of this descriptor changes to reflect the change of data.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 8 if aLength is negative
panic
USER 10 if aPos is negative or is greater than the length of this descriptor.
panic
USER 16 if the length of the source descriptor aDes is negative

Parameters

TInt aPosThe position within the data where replacement is to start. This is an offset value; a zero value refers to the leftmost data position.
TInt aLengthThe length of data to be replaced.
const TDesC16 & aDesThe source 16-bit non modifiable descriptor whose data is to replace the target descriptor's data at aPos.

ReplaceL(TInt, TInt, const TUint16 *)

IMPORT_C voidReplaceL(TIntaPos,
TIntaLength,
const TUint16 *aZeroTerminatedString
)

Replaces data in this descriptor.

The specified length can be different to the length of the replacement data. The length of this descriptor changes to reflect the change of data.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 8 if aLength is negative
panic
USER 10 if aPos is negative or is greater than the length of this descriptor.
panic
USER 16 if the length of the source descriptor aDes is negative

Parameters

TInt aPosThe position within the data where replacement is to start. This is an offset value; a zero value refers to the leftmost data position.
TInt aLengthThe length of data to be replaced.
const TUint16 * aZeroTerminatedStringThe source wide null terminated character string

ReplaceL(TInt, TInt, const wchar_t *)

IMPORT_C voidReplaceL(TIntaPos,
TIntaLength,
const wchar_t *aWideCharStr
)

Replaces data in this descriptor.

The specified length can be different to the length of the replacement data. The length of this descriptor changes to reflect the change of data.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 8 if aLength is negative
panic
USER 10 if aPos is negative or is greater than the length of this descriptor.
panic
USER 16 if the length of the source descriptor aDes is negative

Parameters

TInt aPosThe position within the data where replacement is to start. This is an offset value; a zero value refers to the leftmost data position.
TInt aLengthThe length of data to be replaced.
const wchar_t * aWideCharStrThe source wide character string

ReserveCapacityGrowExponentialL(TInt)

voidReserveCapacityGrowExponentialL(TIntaRequiredCapacity)[private]

Guarantees that MaxLength() is greater than or equal to the supplied integer parameter, growing the underlying heap buffer if necessary.

The growth is exponential; maxLength *= 1.5 This is reported to give an amortised complexity of O(n) when adding n characters. If the required capacity is larger than the expanded size then the required capacity is used instead.

The actual value of MaxLength() after a call may differ from the exact value requested, but if it does differ it will always be greater. This flexibility allows the implementation to manage heap buffers more efficiently.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

TInt aRequiredCapacityThe minimum value of MaxLength() required

ReserveCapacityGrowExponentialL()

voidReserveCapacityGrowExponentialL()[private]

Grows the underlying buffer using the exponential growth function. Guarantees that MaxLength() is greater than or equal to 1.5 * the current MaxLength.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

ReserveFreeCapacityGrowExponentialL(TInt)

voidReserveFreeCapacityGrowExponentialL(TIntaRequiredEmptySpace)[private]

Guarantees that free space in the buffer greater than or equal the supplied integer parameter, growing the underlying heap buffer if necessary.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

TInt aRequiredEmptySpaceThe minimum value of free space required

ReserveFreeCapacityL(TInt)

IMPORT_C voidReserveFreeCapacityL(TIntaExtraSpaceLength)

Ensures that the remaining unused space is more than the supplied value.

May reallocate a larger storage space to meet the requirement. As a result MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

Typically, you use this method to reserve a known amount of required space in one go instead of relying on the automatic growth pattern.

leave
KErrNoMemory if the the buffer needs to be reallocated and there are insufficient resources to do so.
panic
USER 11 if aLength is negative

Parameters

TInt aExtraSpaceLengthThe extra space required.

ReserveL(TInt)

voidReserveL(TIntaMinRequiredCapacity)[private]

Guarantees that MaxLength() is greater than or equal to the supplied capacity, reallocating the supplied capacity if necessary.

The actual value of MaxLength() after a call may differ from the exact value requested, but if it does differ it will always be greater. This flexibility allows the implementation to manage heap buffers more efficiently.

The string descriptor's heap buffer may be reallocated in order to accommodate the new size. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

Parameters

TInt aMinRequiredCapacityThe minimum value of MaxLength() required

Reset()

IMPORT_C voidReset()

Re-initialises the descriptor destroying its payload

SetLength(TInt)

voidSetLength(TIntaLength)[private]

Parameters

TInt aLength

SetLengthL(TInt)

IMPORT_C voidSetLengthL(TIntaLength)

Sets the length of the data represented by the string descriptor to the specified value.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 11 if aLength is negative

Parameters

TInt aLengthThe new length of the descriptor.

SetMax()

voidSetMax()[private]

SetMaxLengthL(TInt)

IMPORT_C voidSetMaxLengthL(TIntaMaxLength)

Sets the storage space allocated to this descriptor to the specified value by growing or compressing its buffer size.

If the current length of the descriptor is greater than the specified max length, length is truncated to max length.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the the buffer needs to be reallocated and there are insufficient resources to do so
panic
USER 11 if aLength is negative

Parameters

TInt aMaxLengthThe new maximum length of the descriptor.

Swap(TDes16 &)

voidSwap(TDes16 &aDes)[private]

Parameters

TDes16 & aDes

Swap(RBuf16 &)

voidSwap(RBuf16 &aRBuf)[private]

Parameters

RBuf16 & aRBuf

SwapL(TDes16 &)

IMPORT_C voidSwapL(TDes16 &aDes)

Swaps the data represented by this descriptor with the data represented by the specified descriptor.

The lengths of both descriptors are also swapped to reflect the change.

Note that each descriptor must be capable of accommodating the contents of the other descriptor.

Each descriptor must be capable of accommodating the contents of the other descriptor. If the maximum length of the descriptor parameter is smaller than the length of the target LString16, then the function raises a USER 11 panic. The target LString16 will be grown if necessary to accommodate the descriptor parameter's data.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
panic
USER 11 if the maximum length of the descriptor parameter is smaller than the length of the target LString16

Parameters

TDes16 & aDesThe 16-bit modifiable descriptor whose data is to be swapped with the data of this descriptor.

SwapL(LString16 &)

IMPORT_C voidSwapL(LString16 &aDes)

Swaps the data represented by this string descriptor with the data represented by the specified string descriptor.

The lengths of both string descriptors are also swapped to reflect the change, and their buffers grown as necessary to accommodate the data they receive.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if one of the underlying buffers needs to be grown and there are insufficient resources to do so

Parameters

LString16 & aDesThe 16-bit modifiable string descriptor whose data is to be swapped with the data of this descriptor.

ZeroTerminate()

voidZeroTerminate()[private]

ZeroTerminateL()

IMPORT_C voidZeroTerminateL()

Appends a zero terminator onto the end of this descriptor's data.

The length of the descriptor is not changed, but the capacity of the descriptor may need to be grown to accommodate the zero terminator.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so

operator!=(const TUint16 *)

IMPORT_C TBooloperator!=(const TUint16 *aZeroTerminatedString)const

Determines whether this descriptor's data is not equal to the specified strings's data.

The comparison is implemented internally using the TDesC::Compare() function.

TDesC::Compare

Parameters

const TUint16 * aZeroTerminatedStringThe wide Zero TerminatedString string whose data is to be compared with this Descriptor's data.

operator!=(const wchar_t *)

IMPORT_C TBooloperator!=(const wchar_t *aWideCharStr)const

Determines whether this descriptor's data is not equal to the specified strings's data.

The comparison is implemented internally using the TDesC::Compare() function.

TDesC::Compare

Parameters

const wchar_t * aWideCharStrThe wide character string whose data is to be compared with this Descriptor's data.

operator+=(TChar)

IMPORT_C LString16 &operator+=(TCharaChar)

Appends data onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
LString16::AppendL

Parameters

TChar aCharA single character to be appended. The length of the descriptor is incremented by one.

operator+=(const TDesC16 &)

IMPORT_C LString16 &operator+=(const TDesC16 &aDes)

Appends data onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
LString16::AppendL

Parameters

const TDesC16 & aDesA 16-bit non modifiable descriptor whose data is to be appended.

operator+=(const TUint16 *)

IMPORT_C LString16 &operator+=(const TUint16 *aZeroTerminatedString)

Appends data onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
LString16::AppendL

Parameters

const TUint16 * aZeroTerminatedStringA pointer to a zero terminated string .

operator+=(const wchar_t *)

IMPORT_C LString16 &operator+=(const wchar_t *aWideCharStr)

Appends data onto the end of this descriptor's data.

The length of this descriptor is incremented to reflect the new content.

This leaving variant of the standard, non-leaving descriptor method differs in that this operation may cause the string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

leave
KErrNoMemory if the underlying buffer needs to be grown and there are insufficient resources to do so
LString16::AppendL

Parameters

const wchar_t * aWideCharStrA pointer to a wide character zero terminated string .

operator<(const TUint16 *)

IMPORT_C TBooloperator<(const TUint16 *aZeroTerminatedString)const

Determines whether this descriptor's data is less than the specified strings's data.

The comparison is implemented internally using the TDesC::Compare() function.

TDesC::Compare

Parameters

const TUint16 * aZeroTerminatedStringThe wide Zero TerminatedString string whose data is to be compared with this Descriptor's data.

operator<(const wchar_t *)

IMPORT_C TBooloperator<(const wchar_t *aWideCharStr)const

Determines whether this descriptor's data is less than the specified strings's data.

The comparison is implemented internally using the TDesC::Compare() function.

TDesC::Compare

Parameters

const wchar_t * aWideCharStrThe wide character string whose data is to be compared with this Descriptor's data.

operator<=(const TUint16 *)

IMPORT_C TBooloperator<=(const TUint16 *aZeroTerminatedString)const

Determines whether this descriptor's data is less than/equal to the specified strings's data.

The comparison is implemented internally using the TDesC::Compare() function.

TDesC::Compare

Parameters

const TUint16 * aZeroTerminatedStringThe wide Zero TerminatedString string whose data is to be compared with this Descriptor's data.

operator<=(const wchar_t *)

IMPORT_C TBooloperator<=(const wchar_t *aWideCharStr)const

Determines whether this descriptor's data is less than the specified strings's data.

The comparison is implemented internally using the TDesC::Compare() function.

TDesC::Compare

Parameters

const wchar_t * aWideCharStrThe wide character string whose data is to be compared with this Descriptor's data.

operator=(const TDesC16 &)

IMPORT_C LString16 &operator=(const TDesC16 &aDes)

Copies data into this 16-bit string descriptor, replacing any existing data, and expanding its heap buffer to accommodate if necessary.

The length of this descriptor is set to reflect the new data.

This operation may cause the target string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

Note that the automatic resizing performed is a change to the functionality of this operation compared to other descriptor classes. This change is only active on objects directly declared LString16; when LString16 instances are instead manipulated via references to TDes16 or TDesC16, the standard (non-resizing, panicing) variant is invoked.

leave
KErrNoMemory If the heap buffer of the string descriptor being assigned to needs to be expanded, but there is insufficient memory to do so
LString16::CopyL

Parameters

const TDesC16 & aDesA 16-bit non-modifiable descriptor.

operator=(const LString16 &)

IMPORT_C LString16 &operator=(const LString16 &aDes)

Copies data into this 16-bit string descriptor, replacing any existing data, and expanding its heap buffer to accommodate if necessary.

The length of this descriptor is set to reflect the new data.

This operation may cause the target string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

Note that the automatic resizing performed is a change to the functionality of this operation compared to other descriptor classes. This change is only active on objects directly declared LString16; when LString16 instances are instead manipulated via references to TDes16 or TDesC16, the standard (non-resizing, panicing) variant is invoked.

leave
KErrNoMemory If the heap buffer of the string descriptor being assigned to needs to be expanded, but there is insufficient memory to do so
LString16::CopyL

Parameters

const LString16 & aDesA 16-bit string descriptor.

operator=(const TUint16 *)

IMPORT_C LString16 &operator=(const TUint16 *aZeroTerminatedString)

Copies data into this 16-bit string descriptor, replacing any existing data, and expanding its heap buffer to accommodate if necessary.

The length of this descriptor is set to reflect the new data.

This operation may cause the target string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

Note that the automatic resizing performed is a change to the functionality of this operation compared to other descriptor classes. This change is only active on objects directly declared LString16; when LString16 instances are instead manipulated via references to TDes16 or TDesC16, the standard (non-resizing, panicing) variant is invoked.

leave
KErrNoMemory If the heap buffer of the string descriptor being assigned to needs to be expanded, but there is insufficient memory to do so
LString16::CopyL

Parameters

const TUint16 * aZeroTerminatedStringA pointer to a zero-terminated string

operator=(HBufC16 *)

IMPORT_C LString16 &operator=(HBufC16 *aHBuf)

Transfers ownership of the specified 16-bit resizable descriptor's this object.

Assign()

Parameters

HBufC16 * aHBufThe source 16-bit resizable buffer. The ownership of this object's buffer is to be transferred.

operator=(const wchar_t *)

IMPORT_C LString16 &operator=(const wchar_t *aWideCharStr)

Copies data into this 16-bit string descriptor, replacing any existing data, and expanding its heap buffer to accommodate if necessary.

The length of this descriptor is set to reflect the new data.

This operation may cause the target string descriptor's heap buffer to be reallocated in order to accommodate the new data. As a result, MaxLength() and Ptr() may return different values afterwards, and any existing raw pointers to into the descriptor data may be invalidated.

Note that the automatic resizing performed is a change to the functionality of this operation compared to other descriptor classes. This change is only active on objects directly declared LString16; when LString16 instances are instead manipulated via references to TDes16 or TDesC16, the standard (non-resizing, panicing) variant is invoked.

leave
KErrNoMemory If the heap buffer of the string descriptor being assigned to needs to be expanded, but there is insufficient memory to do so
LString16::CopyL

Parameters

const wchar_t * aWideCharStrA pointer to a wide character zero-terminated string

operator==(const TUint16 *)

IMPORT_C TBooloperator==(const TUint16 *aZeroTerminatedString)const

Determines whether this Descriptor's data is equal to the specified string's data.

The comparison is implemented internally using the TDesC::Compare() function.

TDesC::Compare

Parameters

const TUint16 * aZeroTerminatedStringThe wide Zero TerminatedString string whose data is to be compared with this Descriptor's data.

operator==(const wchar_t *)

IMPORT_C TBooloperator==(const wchar_t *aWideCharStr)const

Determines whether this Descriptor's data is equal to the specified string's data.

The comparison is implemented internally using the TDesC::Compare() function.

TDesC::Compare

Parameters

const wchar_t * aWideCharStrThe wide character string whose data is to be compared with this Descriptor's data.

operator>(const TUint16 *)

IMPORT_C TBooloperator>(const TUint16 *aZeroTerminatedString)const

Determines whether this descriptor's data is greater than the specified strings's data.

The comparison is implemented internally using the TDesC::Compare() function.

TDesC::Compare

Parameters

const TUint16 * aZeroTerminatedStringThe wide Zero TerminatedString string whose data is to be compared with this Descriptor's data.

operator>(const wchar_t *)

IMPORT_C TBooloperator>(const wchar_t *aWideCharStr)const

Determines whether this descriptor's data is greater than the specified strings's data.

The comparison is implemented internally using the TDesC::Compare() function.

TDesC::Compare

Parameters

const wchar_t * aWideCharStrThe wide character string whose data is to be compared with this Descriptor's data.

operator>=(const TUint16 *)

IMPORT_C TBooloperator>=(const TUint16 *aZeroTerminatedString)const

Determines whether this descriptor's data is greater than the specified strings's data.

The comparison is implemented internally using the TDesC::Compare() function.

TDesC::Compare

Parameters

const TUint16 * aZeroTerminatedStringThe wide Zero TerminatedString string whose data is to be compared with this Descriptor's data.

operator>=(const wchar_t *)

IMPORT_C TBooloperator>=(const wchar_t *aWideCharStr)const

Determines whether this descriptor's data is greater than/equal to the specified strings's data.

The comparison is implemented internally using the TDesC::Compare() function.

TDesC::Compare

Parameters

const wchar_t * aWideCharStrThe wide character string whose data is to be compared with this Descriptor's data.

Member Data Documentation

TInt iReserved

TInt iReserved[private]