TDes Methods

Descriptors that derive from TDes are directly modifiable. TDes provides the methods to alter the contents of these descriptors, summarized below.

Name

Description

Append()

Appends a character, a descriptor, or data onto the end of the descriptor.

AppendFill( )

Appends and fills the descriptor with a specified character.

AppendJustify()

Appends data and justifies it.

AppendFormat() AppendFormatList()

Formats and appends text onto the end of the descriptor.

AppendNum() AppendNumUC() AppendNumFixedWidth() AppendNumFixedWidthUC()

Converts a number into a character representation or fixed-width character representation and appends to the end of the descriptor.

Capitalize()

Capitalizes the content of the descriptor.

Collapse()

Narrows each character.

Name

Description

Collate()

Performs collation on the content of the descriptor (this method is deprecated).

Copy() CopyC() CopyCP() CopyF() CopyLC() CopyUC()

Copies data into the descriptor with various options. TDesl6 : :Copy( const TDesC8&) converts from a narrow descriptor to a wide descriptor; with TDes8 : : Copy ( const TDesC16&) each double-byte value can only be copied into the corresponding single byte when the double-byte value is less than decimal 256. A double-byte value of 256 or greater cannot be copied and the corresponding single byte is set to a value of decimal 1.

Delete()

Delete n characters of data from the descriptor starting at position m.

Expand()

Zero-extends each narrow character to 1 6 bits (only available for TDes8 and from Symbian OS v8.1)

Fill () FillZ ()

Fills the descriptor with a specified TChar or with binary zeros.

Fold()

Performs folding on the contents of the descriptor.

Format() FormatList()

Formats and copies text into the descriptor.

Insert()

Inserts data into the descriptor from position n.

Name

Description

Justify()

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

LeftTPtr()

Returns a TPtr to the leftmost portion of the descriptor of length n.

LowerCase()

Converts the contents of the descriptor to lower case.

MaxLength()

Returns the maximum length of the descriptor.

MaxSize()

Returns the maximum size of the descriptor.

MidTPtr()

Returns a TPtr to a portion of the descriptor starting at position p and of length I.

NumFixedWidth() NumFixedWidthUC()

Converts a number into a character representation (with fixed width) and copies it to the descriptor.

operator^() operator+=()

Copies or appends data into the descriptor.

operator[]() operator [ ] () const

Returns a TUint& or const TUint& to a specified data item in the descriptor.

PtrZ()

Appends a NULL terminator onto the end of the descriptor's data and returns a pointer to the data; this allows the pointer to be used directly as a C string. The length of the descriptor must be less than its maximum length to allow for the addition of the terminator.

Name

Description

Repeat()

Copies data with repetition into the descriptor, either from another descriptor or a specified memory location.

Replace()

Replaces data in the descriptor.

RightTPtr()

Returns a TPtr to the rightmost n characters of the descriptor.

SetLength()

Sets the length of the data represented by the descriptor.

SetMax()

Sets the length of the data to the maximum length of the descriptor.

Swap()

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

Trim() TrimAll() TrimLeft() TrimRight()

Presents various options for deleting white space within the descriptor.

Uppercase()

Converts the contents of the descriptor to upper case

Zero()

Sets the length of the data to zero.

ZeroTerminate()

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

+1 0

Average user rating: 5 stars out of 1 votes

Post a comment

  • Receive news updates via email from this site