|
||
class TDes8 : public TDesC8;
Abstract base class for 8-bit modifiable descriptors.
The class encapsulates the data member containing the maximum length of data represented by an 8-bit descriptor. It also provides member functions through which the data can be modified.
The class adds to the behaviour provided by TDesC8
.
This class cannot be instantiated as it is intended to form part of a class hierarchy; it provides a well defined part of descriptor behaviour. It can, however, be passed as an argument type for functions which need to both modify and access descriptor data.
TDesC8
-
Abstract base class for 8-bit non-modifiable descriptors.
TDes8
-
Abstract base class for 8-bit modifiable descriptors.
Defined in TDes8
:
Append(TChar)
Appends a character onto the end of this descriptor's data.Append(const TDesC16 &)
Appends data onto the end of this descriptor's data.Append(const TDesC8 &)
Appends data onto the end of this descriptor's data.Append(const TUint8 *,TInt)
Appends data onto the end of this descriptor's data.AppendFill(TChar,TInt)
Appends and fills this descriptor with the specified character.AppendFormat(TRefByValue< const TDesC8 >,...)
Formats and appends text onto the end of this descriptor's data.AppendFormat(TRefByValue< const TDesC8 >,TDes8Overflow *,...)
Formats and appends text onto the end of this descriptor's data.AppendFormatList(const TDesC8 &,VA_LIST,TDes8Overflow *)
Formats and appends text onto the end of this descriptor's data.AppendJustify(const TDesC8 &,TInt,TAlign,TChar)
Appends data onto the end of this descriptor's data and justifies it.AppendJustify(const TDesC8 &,TInt,TInt,TAlign,TChar)
Appends data onto the end of this descriptor's data and justifies it.AppendJustify(const TUint8 *,TInt,TAlign,TChar)
Appends a zero terminated string onto the end of this descriptor's data and just...AppendJustify(const TUint8 *,TInt,TInt,TAlign,TChar)
Appends data onto the end of this descriptor's data and justifies it.AppendNum(TInt64)
Converts the 64-bit signed integer into a decimal character representation and a...AppendNum(TReal,const TRealFormat &)
Converts the specified floating point number into a character representation and...AppendNum(TUint64,TRadix)
Converts the specified 64-bit unsigned integer into a character representation b...AppendNumFixedWidth(TUint,TRadix,TInt)
Converts the specified unsigned integer into a fixed width character representat...AppendNumFixedWidthUC(TUint,TRadix,TInt)
Converts the specified unsigned integer into a fixed width character representat...AppendNumUC(TUint64,TRadix)
Converts the specified 64-bit unsigned integer into a character representation b...Capitalize()
Capitalises the content of this descriptor.Collapse()
Collapse all characters from 16 to 8 bitsCollate()
Performs collation on the content of this descriptor. Copy(const TDesC16 &)
Copies data into this descriptor replacing any existing data.Copy(const TDesC8 &)
Copies data into this descriptor replacing any existing data.Copy(const TUint8 *)
Copies data into this descriptor replacing any existing data.Copy(const TUint8 *,TInt)
Copies data into this descriptor replacing any existing data.CopyC(const TDesC8 &)
Copies and collates data from the specified descriptor into this descriptor repl...CopyCP(const TDesC8 &)
Copies text from the specified descriptor and capitalises it before putting it i...CopyF(const TDesC8 &)
Copies and folds data from the specified descriptor into this descriptor replaci...CopyLC(const TDesC8 &)
Copies text from the specified descriptor and converts it to lower case before p...CopyUC(const TDesC8 &)
Copies text from the specified descriptor and converts it to upper case before p...Delete(TInt,TInt)
Deletes data from this descriptor.Expand()
Expand all characters from 8 to 16 bitsFill(TChar)
Fills the descriptor's data area with the specified character, replacing any exi...Fill(TChar,TInt)
Fills the descriptor's data area with the specified character, replacing any exi...FillZ()
Fills the descriptor's data area with binary zeroes, i.e. 0x00, replacing any ex...FillZ(TInt)
Fills the descriptor's data area with binary zeroes, i.e. 0x00, replacing any ex...Fold()
Performs folding on the content of this descriptor.Format(TRefByValue< const TDesC8 >,...)
Formats and copies text into this descriptor, replacing any existing data.FormatList(const TDesC8 &,VA_LIST)
Formats and copies text into this descriptor, replacing any existing data.Insert(TInt,const TDesC8 &)
Inserts data into this descriptor.Justify(const TDesC8 &,TInt,TAlign,TChar)
Copies data into this descriptor and justifies it, replacing any existing data.LeftTPtr(TInt)const
Extracts the leftmost part of the data.LowerCase()
Converts the content of this descriptor to lower case.MaxLength()const
Gets the maximum length of the descriptor.MaxSize()const
Gets the maximum size of the descriptor.MidTPtr(TInt)const
Extracts a portion of the data.MidTPtr(TInt,TInt)const
Extracts a portion of the data.Num(TInt64)
Converts the 64-bit signed integer into a decimal character representation and c...Num(TReal,const TRealFormat &)
Converts the specified floating point number into a character representation and...Num(TUint64,TRadix)
Converts the specified 64-bit unsigned integer into a character representation b...NumFixedWidth(TUint,TRadix,TInt)
Converts the specified unsigned integer into a fixed width character representat...NumFixedWidthUC(TUint,TRadix,TInt)
Converts the specified unsigned integer into a fixed width character representat...NumUC(TUint64,TRadix)
Converts the specified 64-bit unsigned integer into a character representation b...PtrZ()
Appends a zero terminator onto the end of this descriptor's data and returns a p...Repeat(const TDesC8 &)
Copies data with repetition into this descriptor, from another descriptor, repla...Repeat(const TUint8 *,TInt)
Copies data with repetition into this descriptor, from a memory location specifi...Replace(TInt,TInt,const TDesC8 &)
Replaces data in this descriptor.RightTPtr(TInt)const
Extracts the rightmost part of the data.SetLength(TInt)
Sets the length of the data represented by the descriptor to the specified value...SetMax()
Sets the length of the data to the maximum length of the descriptor. Swap(TDes8 &)
Swaps the data represented by this descriptor with the data represented by the s...TDes8()
TDes8(TInt,TInt,TInt)
Trim()
Deletes leading and trailing whitespace characters from the descriptor's data.TrimAll()
Deletes leading and trailing whitespace characters from the descriptor's data an...TrimLeft()
Deletes leading whitespace characters from the descriptor's data.TrimRight()
Deletes trailing whitespace characters from the descriptor's data.UpperCase()
Converts the content of this descriptor to upper case.WPtr()const
Zero()
Sets the length of the data to zero. ZeroTerminate()
Appends a zero terminator onto the end of this descriptor's data.__DECLARE_TEST
iMaxLength
operator+=(const TDesC8 &)
Appends data onto the end of this descriptor's data and returns a reference to t...operator=(const TDes8 &)
Copies data into this descriptor replacing any existing data.operator=(const TDesC8 &)
Copies data into this descriptor replacing any existing data.operator=(const TUint8 *)
Copies data into this descriptor replacing any existing data.operator[](TInt)
Gets a non-const reference to a single data item within this descriptor's data.operator[](TInt)const
Gets a const reference to a single data item within this descriptor's data.Inherited from TDesC8
:
Alloc()const
Creates a new 8-bit heap descriptor and initialises it with a copy of this descr...AllocL()const
Creates a new 8-bit heap descriptor and initialises it with a copy of this descr...AllocLC()const
Creates a new 8-bit heap descriptor, initialises it with a copy of this descript...AtC(TInt)const
Compare(const TDesC8 &)const
Compares this descriptor's data with the specified descriptor's data.CompareC(const TDesC8 &)const
Compares this descriptor's data with the specified descriptor's data using the s...CompareF(const TDesC8 &)const
Compares this descriptor's folded data with the specified descriptor's folded da...DoSetLength(TInt)
Find(const TDesC8 &)const
Searches for the first occurrence of the specified data sequence within this des...Find(const TUint8 *,TInt)const
Searches for the first occurrence of the specified data sequence within this des...FindC(const TDesC8 &)const
Searches for the first occurrence of the specified collated data sequence within...FindC(const TUint8 *,TInt)const
Searches for the first occurrence of the specified collated data sequence within...FindF(const TDesC8 &)const
Searches for the first occurrence of the specified folded data sequence within t...FindF(const TUint8 *,TInt)const
Searches for the first occurrence of the specified folded data sequence within t...Left(TInt)const
Extracts the leftmost part of the data.Length()const
Gets the length of the data.Locate(TChar)const
Searches for the first occurrence of a character within this descriptor's data.LocateF(TChar)const
Searches for the first occurrence of a folded character within this descriptor's...LocateReverse(TChar)const
Searches for the first occurrence of a character within this descriptor's data, ...LocateReverseF(TChar)const
Searches for the first occurrence of a folded character within this descriptor's...Match(const TDesC8 &)const
Searches this descriptor's data for a match with the match pattern supplied in t...MatchC(const TDesC8 &)const
Searches this descriptor's collated data for a match with the collated match pat...MatchF(const TDesC8 &)const
Searches this descriptor's folded data for a match with the folded match pattern...Mid(TInt)const
Extracts a portion of the data.Mid(TInt,TInt)const
Extracts a portion of the data.Ptr()const
Gets a pointer to the data represented by the descriptor.Right(TInt)const
Extracts the rightmost part of the data.Size()const
Gets the size of the data.TDesC8(TInt,TInt)
Type()const
operator!=(const TDesC8 &)const
Determines whether this descriptor's data is not equal to the specified descript...operator>(const TDesC8 &)const
Determines whether this descriptor's data is greater than the specified descript...operator>=(const TDesC8 &)const
Determines whether this descriptor's data is greater than or equal to the specif...operator<(const TDesC8 &)const
Determines whether this descriptor's data is less than the specified descriptor'...operator<=(const TDesC8 &)const
Determines whether this descriptor's data is less than or equal to the specified...operator==(const TDesC8 &)const
Determines whether this descriptor's data is equal to the specified descriptor's...protected: inline TDes8(TInt aType, TInt aLength, TInt aMaxLength);
|
inline TDes8& operator=(const TUint8 *aString);
Copies data into this descriptor replacing any existing data.
The length of this descriptor is set to reflect the new data.
|
|
|
inline TDes8& operator=(const TDesC8 &aDes);
Copies data into this descriptor replacing any existing data.
The length of this descriptor is set to reflect the new data.
|
|
|
inline TDes8& operator=(const TDes8 &aDes);
Copies data into this descriptor replacing any existing data.
The length of this descriptor is set to reflect the new data.
|
|
|
inline TInt MaxLength() const;
Gets the maximum length of the descriptor.
This is the upper limit for the number of 8-bit values or data items that the descriptor can represent.
|
inline TInt MaxSize() const;
Gets the maximum size of the descriptor.
This is the upper limit for the number of bytes which the data represented by the descriptor can occupy.
|
inline const TUint8& operator[](TInt anIndex) const;
Gets a const reference to a single data item within this descriptor's data.
|
|
|
inline TUint8& operator[](TInt anIndex);
Gets a non-const reference to a single data item within this descriptor's data.
|
|
|
inline TDes8& operator+=(const TDesC8 &aDes);
Appends data onto the end of this descriptor's data and returns a reference to this descriptor.
The length of this descriptor is incremented to reflect the new content.
|
|
|
IMPORT_C void SetLength(TInt aLength);
Sets the length of the data represented by the descriptor to the specified value.
|
|
IMPORT_C void SetMax();
Sets the length of the data to the maximum length of the descriptor.
IMPORT_C void Copy(const TDesC8 &aDes);
Copies data into this descriptor replacing any existing data.
The length of this descriptor is set to reflect the new data.
|
|
IMPORT_C void Copy(const TUint8 *aBuf, TInt aLength);
Copies data into this descriptor replacing any existing data.
The length of this descriptor is set to reflect the new data.
|
|
IMPORT_C void Copy(const TUint8 *aString);
Copies data into this descriptor replacing any existing data.
The length of this descriptor is set to reflect the new data.
|
|
IMPORT_C void Copy(const TDesC16 &aDes);
Copies data into this descriptor replacing any existing data.
The length of this descriptor is set to reflect the new data.
|
|
IMPORT_C void Append(TChar aChar);
Appends a character onto the end of this descriptor's data.
The length of this descriptor is incremented to reflect the new content.
|
|
IMPORT_C void Append(const TDesC8 &aDes);
Appends data onto the end of this descriptor's data.
The length of this descriptor is incremented to reflect the new content.
|
|
IMPORT_C void Append(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.
|
|
IMPORT_C void Append(const TUint8 *aBuf, TInt aLength);
Appends data onto the end of this descriptor's data.
The length of this descriptor is incremented to reflect the new content.
|
|
IMPORT_C void Fill(TChar aChar);
Fills the descriptor's data area with the specified character, replacing any existing data.
The descriptor is filled from the beginning up to its current length. The descriptor's length does not change. It is not filled to its maximum length.
|
IMPORT_C void Fill(TChar aChar, TInt aLength);
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.
|
|
IMPORT_C void FillZ();
Fills the descriptor's data area with binary zeroes, i.e. 0x00, replacing any existing data.
The descriptor is filled from the beginning up to its current length. The descriptor's length does not change. It is not filled to its maximum length.
IMPORT_C void FillZ(TInt aLength);
Fills the descriptor's data area with binary zeroes, i.e. 0x00, 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.
|
|
IMPORT_C void Num(TInt64 aVal);
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.
|
IMPORT_C void Num(TUint64 aVal, TRadix aRadix);
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.
|
IMPORT_C void NumFixedWidth(TUint aVal, TRadix aRadix, TInt aWidth);
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 TDes8::Format(TRefByValue< const TDesC8 >,...)
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 TDes8::NumFixedWidth(TUint,TRadix,TInt)
in preference to TDes8::Format(TRefByValue< const TDesC8 >,...)
as it is more efficient.
|
TDes8::Format(TRefByValue< const TDesC8 >,...)
Formats and copies text into this descriptor, replacing any existing data.IMPORT_C void AppendNum(TInt64 aVal);
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.
|
IMPORT_C void AppendNum(TUint64 aVal, TRadix aRadix);
Converts the specified 64-bit unsigned 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.
|
IMPORT_C void AppendNumFixedWidth(TUint aVal, TRadix aRadix, TInt aWidth);
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.
|
IMPORT_C TPtr8 LeftTPtr(TInt aLength) const;
Extracts the leftmost part of the data.
The function does not cut or remove any data but constructs a modifiable pointer descriptor to represent the leftmost part of the data.
|
|
|
IMPORT_C TPtr8 RightTPtr(TInt aLength) const;
Extracts the rightmost part of the data.
The function does not cut or remove any data but constructs a modifiable pointer descriptor to represent the rightmost part of the data.
|
|
|
IMPORT_C TPtr8 MidTPtr(TInt aPos) const;
Extracts a portion of the data.
The function does not cut or remove any data but constructs a modifiable pointer descriptor to represent the defined portion.
The portion is identified by its starting position and by the length of the remainder of the data starting from the specified position.
|
|
|
IMPORT_C TPtr8 MidTPtr(TInt aPos, TInt aLength) const;
Extracts a portion of the data.
The function does not cut or remove any data but constructs a modifiable pointer descriptor to represent the defined portion.
The portion is identified by its starting position and by its length.
|
|
|
IMPORT_C const TUint8* PtrZ();
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. It must, however, be strictly less than the descriptor's maximum length. This condition guarantees that there is sufficient space for the zero terminator.
|
|
IMPORT_C void CopyF(const TDesC8 &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.
|
|
Interface status: | deprecated |
IMPORT_C void CopyC(const TDesC8 &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.
|
|
IMPORT_C void CopyLC(const TDesC8 &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.
|
|
IMPORT_C void CopyUC(const TDesC8 &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.
|
|
IMPORT_C void CopyCP(const TDesC8 &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.
|
|
IMPORT_C void Swap(TDes8 &aDes);
Swaps the data represented by this descriptor with the data represented by the specified descriptor.
The lengths of both descriptors are swapped to reflect the change.
Note that each descriptor must be capable of accommodating the contents of the other descriptor.
|
|
IMPORT_C void AppendFill(TChar aChar, TInt aLength);
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.
|
|
IMPORT_C void ZeroTerminate();
Appends a zero terminator onto the end of this descriptor's data.
The length of the descriptor is not changed. It must, however, be strictly less than the descriptor's maximum length. This condition guarantees that there is sufficient space for the zero terminator.
|
IMPORT_C void Fold();
Performs folding on the content of this descriptor.
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.
Interface status: | deprecated |
IMPORT_C void Collate();
Performs collation on the content of this descriptor.
IMPORT_C void LowerCase();
Converts the content of this descriptor to lower case.
Conversion is implemented as appropriate to the current locale.
IMPORT_C void UpperCase();
Converts the content of this descriptor to upper case.
Conversion is implemented as appropriate to the current locale.
IMPORT_C void Capitalize();
Capitalises the content of this descriptor.
Capitalisation is implemented as appropriate to the current locale.
IMPORT_C void Repeat(const TUint8 *aBuf, TInt aLength);
Copies data with repetition into this descriptor, from a memory location specified by pointer, replacing any existing data.
Copying proceeds until this descriptor is filled up to its current length. If it cannot contain a whole number of copies of the source data, then the last copy is truncated.
|
|
IMPORT_C void Repeat(const TDesC8 &aDes);
Copies data with repetition into this descriptor, from another descriptor, replacing any existing data.
Copying proceeds until this descriptor is filled up to its current length. If it cannot contain a whole number of copies of the source data, then the last copy is truncated.
|
IMPORT_C void Trim();
Deletes leading and trailing whitespace characters from the descriptor's data.
The length of the descriptor is reduced to reflect the loss of the whitespace characters.
TDes8::TrimLeft()
Deletes leading whitespace characters from the descriptor's data.TDes8::TrimRight()
Deletes trailing whitespace characters from the descriptor's data.IMPORT_C void TrimAll();
Deletes leading and trailing whitespace characters from the descriptor's data and replaces each contiguous set of whitespace characters within the data by one whitespace character.
The length of the descriptor is reduced to reflect the loss of the whitespace characters.
TDes8::Trim()
Deletes leading and trailing whitespace characters from the descriptor's data.IMPORT_C void TrimLeft();
Deletes leading whitespace characters from the descriptor's data.
All whitespace characters up to, but not including the first non-whitespace character, are deleted.
The length of the descriptor is reduced to reflect the loss of the whitespace characters.
IMPORT_C void TrimRight();
Deletes trailing whitespace characters from the descriptor's data.
The process starts on the right hand side of the descriptor's data and proceeds to the left.
All whitespace characters up to, but not including the first non-whitespace character, are deleted.
The length of the descriptor is reduced to reflect the loss of the whitespace characters.
IMPORT_C void Insert(TInt aPos, const TDesC8 &aDes);
Inserts data into this descriptor.
The length of this descriptor is changed to reflect the extra data.
|
|
IMPORT_C void Delete(TInt aPos, TInt aLength);
Deletes data from this descriptor.
The length of this descriptor is changed to reflect the loss of data.
|
|
IMPORT_C void Replace(TInt aPos, TInt aLength, const TDesC8 &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.
|
|
IMPORT_C void Justify(const TDesC8 &aDes, TInt aWidth, TAlign anAlignment, TChar aFill);
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.
|
|
IMPORT_C void NumFixedWidthUC(TUint aVal, TRadix aRadix, TInt aWidth);
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 TDes8::Format(TRefByValue< const TDesC8 >,...)
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 TDes8::NumFixedWidthUC(TUint,TRadix,TInt)
in preference to TDes8::Format(TRefByValue< const TDesC8 >,...)
as it is more efficient.
|
TDes8::Format(TRefByValue< const TDesC8 >,...)
Formats and copies text into this descriptor, replacing any existing data.IMPORT_C void NumUC(TUint64 aVal, TRadix aRadix=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.
|
IMPORT_C TInt Num(TReal aVal, const TRealFormat &aFormat) __SOFTFP;
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.
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 two most common
are: 4.1 the maximum number of characters necessary to represent the number, as defined in the TRealFormat
object, is greater than the maximum length of this descriptor 4.2 the character representation format (i.e. the format type),
as defined in the TRealFormat
object is not recognised.
|
|
TRealFormat::iType
Governs the format of the character representation of the real number.IMPORT_C void AppendNumFixedWidthUC(TUint aVal, TRadix aRadix, TInt aWidth);
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.
|
IMPORT_C TInt AppendNum(TReal aVal, const TRealFormat &aFormat) __SOFTFP;
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.
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 two most common
are: 4.1 the maximum number of characters necessary to represent the number, as defined in the TRealFormat
object, is greater than the maximum length of this descriptor 4.2 the character representation format (i.e. the format type),
as defined in the TRealFormat
object is not recognised
|
|
IMPORT_C void AppendNumUC(TUint64 aVal, TRadix aRadix=EDecimal);
Converts the specified 64-bit unsigned 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.
|
IMPORT_C void Format(TRefByValue< const TDesC8 > 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 TDes8::Num(TInt64)
and TDes8::NumUC(TUint64,TRadix)
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
|
|
TDes8::Num(TInt64)
Converts the 64-bit signed integer into a decimal character representation and c...TDes8::NumUC(TUint64,TRadix)
Converts the specified 64-bit unsigned integer into a character representation b...IMPORT_C void FormatList(const TDesC8 &aFmt, VA_LIST aList);
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 TDes8::Format(TRefByValue< const TDesC8 >,...)
. In practice, it is better and easier to use TDes8::Format(TRefByValue< const TDesC8 >,...)
, passing a variable number of arguments as required by the format string.
|
TDes8::Format(TRefByValue< const TDesC8 >,...)
Formats and copies text into this descriptor, replacing any existing data.IMPORT_C void AppendJustify(const TDesC8 &Des, TInt aWidth, TAlign anAlignment, TChar aFill);
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.
|
|
IMPORT_C void AppendJustify(const TDesC8 &Des, TInt aLength, TInt aWidth, TAlign anAlignment, TChar aFill);
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.
|
|
IMPORT_C void AppendJustify(const TUint8 *aString, TInt aWidth, TAlign anAlignment, TChar aFill);
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.
|
|
IMPORT_C void AppendJustify(const TUint8 *aString, TInt aLength, TInt aWidth, TAlign anAlignment, TChar aFill);
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.
|
|
IMPORT_C void AppendFormat(TRefByValue< const TDesC8 > aFmt, TDes8Overflow *aOverflowHandler,...);
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 TDes8::Format(TRefByValue< const TDesC8 >,...)
function.
Literal text is appended on a character by character basis. If it results in the length of this descriptor exceeding its maximum length, then the function:
1. calls the Overflow() member function of the overflow handler, if an overflow handler is supplied 2 raises a USER 23 panic, if no overflow handler is supplied.
As much literal text as possible will have been copied into this descriptor and this descriptor will have reached its maximum length.
Text converted from a trailing argument is appended as a complete string. If an attempt to append this string fails because the resulting length of this descriptor would exceed its maximum length, then the function:
1. calls the Overflow() member function of the overflow handler, if an overflow handler is supplied
2 raises a USER 23 panic, if no overflow handler is supplied.
None of the generated text is appended and length of this descriptor may be less than the maximum.
|
|
TDes8::Format(TRefByValue< const TDesC8 >,...)
Formats and copies text into this descriptor, replacing any existing data.TDes8Overflow::Overflow(TDes8 &)
Handles the overflow.IMPORT_C void AppendFormat(TRefByValue< const TDesC8 > 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 TDes8::Format(TRefByValue< const TDesC8 >,...)
function.
Literal text is appended on a character by character basis.
Text converted from a trailing argument is appended as a complete string.
|
|
TDes8::Format(TRefByValue< const TDesC8 >,...)
Formats and copies text into this descriptor, replacing any existing data.IMPORT_C void AppendFormatList(const TDesC8 &aFmt, VA_LIST aList, TDes8Overflow *aOverflowHandler=NULL);
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 AppendFormat(TRefByValue<const TDesC8> aFmt,TDes8Overflow
*aOverflowHandler,...). In practice, it is better and easier to use TDes8::AppendFormat(TRefByValue< const TDesC8 >,TDes8Overflow *,...)
, passing a variable number of arguments as required by the format string.
|
TDes8::AppendFormat(TRefByValue< const TDesC8 >,TDes8Overflow *,...)
Formats and appends text onto the end of this descriptor's data.IMPORT_C TPtr16 Expand();
Expand all characters from 8 to 16 bits
The length of descriptor increased by 2 (length *= 2).
|
|
IMPORT_C void Collapse();
Collapse all characters from 16 to 8 bits
The length of descriptor truncated by 2 (length /= 2).
|
protected: __DECLARE_TEST;