伯乐共勉

讨论。NET专区
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Symbian sdk帮助-类TDes8

Posted on 2007-02-08 11:41  伯乐共勉  阅读(1162)  评论(0)    收藏  举报

Location: e32des8.h

Link against: euser.lib

 

定义于:e32des8.h

连接文件:euser.lib

 

 

Class TDes8

TDes8

Support

Supported from 5.0

 

类 TDes8

支 持

支持5.0和5.0以上版本

 

 

Description

Modifiable 8-bit descriptor; abstract class. 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.

描 述

可修改的8位描述符;抽象类。这个类封了8位描述符类型所包含的相关数据成员,例如描述符号的最大长度。它同时也包括也一些方法成员,这些方法成员可以用语修改描述符中存储的数据。

 

The class adds to the behaviour provided by the base class.

这个类在其基类的基础上添加了它自己的一些行为特性。

 

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.

这个类是抽象类,它将作为类的继承层次的一部分,所以它是不可被实例化的。它提供了一组定义良好的描述符行为。如果在函数中需要对描述符进行访问和修改,那么就可以使用这个类型作为函数的参数类型。

 

 

 

Derivation

TDesC8 - Abstract base class for 8 bit non-modifiable descriptors

TDes8 - Modifiable 8-bit descriptor; abstract class

 

派生关系

TDesC8 - 抽象基类,8位不可修改描述符。

TDes8 - 8位可修改描述符,抽象类。

 

Members

Defined in TDes8:

类成员

定义于TDes8的类成员:

 

Append(), Append(), Append(), Append(), AppendFill(), AppendFormat(), AppendFormatList(), AppendJustify(), AppendJustify(), AppendJustify(), AppendJustify(), AppendNum(), AppendNum(), AppendNum(), AppendNum(), AppendNum(), AppendNumFixedWidth(), AppendNumFixedWidthUC(), AppendNumUC(), AppendNumUC(), Capitalize(), Collate(), Copy(), Copy(), Copy(), Copy(), CopyC(), CopyCP(), CopyF(), CopyLC(), CopyUC(), Delete(), Fill(), Fill(), FillZ(), Fillz(), Fold(), Format(), FormatList(), Insert(), Justify(), LowerCase(), MaxLength(), MaxSize(), Num(), Num(), Num(), Num(), Num(), NumFixedWidth(), NumFixedWidthUC(), NumUC(), NumUC(), PtrZ(), Repeat(), Repeat(), Replace(), SetLength(), SetMax(), Swap(), Trim(), TrimAll(), TrimLeft(), TrimRight(), UpperCase(), Zero(), ZeroTerminate(), operator+=(), operator=(), operator=(), operator=(), operator[](), operator[]()

 

Inherited from TDesC8:

继承于TDes8的类成员:

 

Alloc(), AllocL(), AllocLC(), Compare(), CompareC(), CompareF(), Find(), FindC(), FindF(), Left(), Length(), Locate(), LocateF(), LocateReverse(), LocateReverseF(), Match(), MatchC(), MatchF(), Mid(), Ptr(), Right(), Size(), operator!=(), operator<(), operator<=(), operator==(), operator>(), operator>=()

 

See also:

TDesC8

TDesC16

 

另见:

TDesC8

TDesC16

 

 

--------------------------------------------------------------------------------

 

Data characteristics

数据特性

 

--------------------------------------------------------------------------------

 

MaxLength()

TInt MaxLength() const;

Description

Returns 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.

描 述

返回描述符的最大长度。它是描述符可以表现的8位值或数据项的数量上限。

 

 

Return value

TInt  The maximum length of data that the descriptor can represent.

返回值

TInt型常量  描述符可表现数据的最大长度。

 

 

--------------------------------------------------------------------------------

 

MaxSize()

TInt MaxSize() const;

Description

Returns 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.

描述

返回描述符尺寸的最大值。这是描述符数据可占据的字节数上限。

 

Return value

TInt  The maximum size of the descriptor data

返回值

TInt型常量  描述符数据的最大尺寸。

 

 

 

--------------------------------------------------------------------------------

 

Changing data characteristics

更改数据特性

 

--------------------------------------------------------------------------------

 

SetLength()

void SetLength(TInt aLength)

Description

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

描 述

设置数据长度。以一个指定值设置描述符的数据长度。

 

Parameters

TInt aLength  The new length of the descriptor data. This value must be non-negative and must not be greater than the maximum length otherwise the function raises a USER 23 panic.

参 数

TInt aLength    一个新的描述符数据长度值。这个值必须是非负的并且不可以超过描述符的最大长度,否则函数将抛出 USER 23 异常。

 

--------------------------------------------------------------------------------

SetMax()

void SetMax()

Description

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

描 述

设置数据长度为描述符的最大长度。

 

--------------------------------------------------------------------------------

 

Zero()

void Zero()

Description

Sets the length of the data to zero.

描 述

设置数据长度为零。

 

 

--------------------------------------------------------------------------------

 

Accessing individual data items

独立数据项访问

 

--------------------------------------------------------------------------------

 

operator[]()

const TUint8& operator[](TInt anIndex) const;

Description

Returns a const reference to a single data item within this descriptor's data.

描 述

返回描述符中单个数据项的常量引用。

 

 

Parameters

TInt anIndex  The position the data item within this descriptor's data. This is an offset; a zero value refers to the leftmost data position. This value must be non-negative and must be less than the current length of this descriptor otherwise the operation raises a USER 21 panic.

参 数

TInt anIndex    数据项在描述符号中的位置。这是一个偏移量;如果这个值是零,那么返回描述符最左侧的数据项。这个值不可以为负值并且必须小于当前描述符的长度否则将抛出 USER 21 异常。

 

Return value

const TUint8&  A const reference to the data item at the specified position.

返回值

const TUint8&  指定位置的数据项常量引用。

 

TUint8&  A non-const reference to the data item at the specified position.

TUint8&  指定位置的数据项非常量引用。

 

示例代码

TBuf<10>  a=_L("gooooo");

TUint b=a[0];

CS->Printf(_L("%c"),b);

--------------------------------------------------------------------------------

 

operator[]()

TUint8& operator[](TInt anIndex);

Description

Returns a non-const reference to a single data item within this descriptor's data.

描 述

返回描述符中单个数据项的非常量引用。

 

Parameters

TInt anIndex  The position the data item within this descriptor's data. This is an offset; a zero value refers to the leftmost data position. This value must be non-negative and must be less than the current length of this descriptor otherwise the operation raises a USER 21 panic.

参 数

TInt anIndex    数据项在描述符号中的位置。这是一个偏移量;如果这个值是零,那么返回描述符最左侧的数据项。这个值不可以为负值并且必须小于当前描述符的长度否则将抛出 USER 21 异常。

 

 

 

Return value

TUint8&  A non-const reference to the data item at the specified position.

返回值

const TUint8&  指定位置的数据非项常量引用。

 

 

--------------------------------------------------------------------------------

 

Copying data, replacing existing data

数据拷贝,原有数据替换

 

--------------------------------------------------------------------------------

 

Copy()

void Copy(const TDesC8& aDes);

Description

Copies data into this descriptor replacing any existing data.

描 述

拷贝数据到当前描述符,并覆盖所有原有数据.

 

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

描述符的长度也被设置为新数据的长度.

 

 

Parameters

const TDesC8& aDes  An 8 bit non modifiable descriptor. The length of the data cannot be greater than the maximum length of the target descriptor otherwise the function raises a USER 23 panic.

参 数

const TDesC8& aDes  8位不可修改描述符号.参数的数据长度不可以超过目标描述符的最大长度,否则将出发 USER 23 异常.

 

实例代码

TBuf<10>  a=_L("gooooo");

TUint b=a[0];

CS->Printf(_L("\n1::%c\n"),b);

a.Copy(_L("1233333333"));

CS->Printf(a);

CS->Printf(_L(",%d\n"),a.Length());

--------------------------------------------------------------------------------

 

Copy()

void Copy(const TDesC16& aDes);

Description

Copies data into this descriptor replacing any existing data.

描 述

拷贝数据到当前描述符并覆盖原有数据.

 

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

描述符的长度将被设置为新数据长度.

 

Parameters

const TDesC16& aDes  A 16 bit non modifiable descriptor. 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. The length of the data cannot be greater than the maximum length of the target descriptor otherwise the function raises a USER 23 panic

参 数

const TDesC16& aDes 16位不可修改描述符.如果双字节值小于十进制256,那么这个双字节的值就可以被拷贝到单字节中.如果这个双字节值刚好等于或大于256,那么对应单字节将被设置成十进制1.新数据的长度不可以大于原有描述符的最大长度,否则将抛出 USER 23 异常.

 

 

 

 

--------------------------------------------------------------------------------

 

Copy()

void Copy(const TUint8* aBuf,TInt aLength);

Description

Copies data into this descriptor replacing any existing data.

描 述

拷贝数据到当前描述符并覆盖原有数据.

 

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

描述符的长度将被设置为新数据长度.

 

 

Parameters

const TUint8* aBUf A pointer to data to be copied.

参 数

TUint8* aBuf    指向将要被拷贝数据的指针。

 

TInt aLength  The length of data to be copied. This value must be non-negative and must not be greater than maximum length of the target descriptor, otherwise the function raises a USER 23 panic.

TInt aLength    将要拷贝数据的长度。这个值不可以是负值或超过描述符的最大长度,否则将抛出 USER 23 异常。

 

 

 

 

--------------------------------------------------------------------------------

 

Copy()

void Copy(const TUint8* aString);

Description

Copies data into this descriptor replacing any existing data.

描 述

拷贝数据到当前描述符并覆盖原有数据.

 

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

描述符的长度将被设置为新数据长度.

 

 

Parameters

const TUint8* aString  A pointer to a zero-terminated string. The length of the string, excluding the zero terminator, must not be greater than the maximum length of the target descriptor, otherwise the function raises a USER 23 panic.

const TUint8* aString

参 数

一个指向有\0终结符的字符串。字符串的长度,包括\0终结符,不可以超过目标描述符的最大长度,否则将抛出 USER 23 异常。

 

 

 

--------------------------------------------------------------------------------

 

operator=()

TDes8& operator=(const TDesC8& aDes);

Description

Copies data into this descriptor replacing any existing data. The length of this descriptor is set to reflect the new data.

描 述

拷贝数据到描述符,并覆盖原来数据,描述符的长度被设置为新数据的长度。

 

 

Parameters

const TDesC8& aDes  An 8 bit non-modifiable descriptor. The length of the data cannot be greater than the maximum length of the target descriptor, otherwise the function raises a USER 23 panic.

参 数

const TDesC8& aDes  一个8位不可修改描述符。参数长度不可长过目标描述符的最大长度,否则将抛出 USER 23 异常。

 

 

Return value

TDes8&  A reference to this, the target descriptor

返回值

TDes8&  一个对当前描述符的引用。

 

 

 

--------------------------------------------------------------------------------

 

operator=()

TDes8& operator=(const TDes8& aDes);

Description

Copies data into this descriptor replacing any existing data.

 

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

描 述

拷贝数据到描述符,并覆盖原来数据,描述符的长度被设置为新数据的长度。

 

 

 

Parameters

const TDes8& aDes  An 8 bit modifiable descriptor. The length of the data cannot be greater than the maximum length of the target descriptor, otherwise the function raises a USER 23 panic.

参 数

const TDesC8& aDes  一个8位可修改描述符。参数长度不可长过目标描述符的最大长度,否则将抛出 USER 23 异常。

 

 

 

Return value

TDes8&  A reference to this, the target descriptor

返回值

TDes8&  一个对当前描述符的引用。

 

 

 

 

--------------------------------------------------------------------------------

 

operator=()

TDes8& operator=(const TUint8* aString);

Description

Copies data into this descriptor replacing any existing data.

 

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

描 述

拷贝数据到描述符,并覆盖原来数据,描述符的长度被设置为新数据的长度。

 

 

Parameters

const TUint8* aString  A pointer to a zero-terminated string. The length of the string, excluding the zero terminator, must not be greater than the maximum length of the target descriptor, otherwise the function raises a USER 23 panic.

参 数

一个指向有\0终结符的字符串。字符串的长度,包括\0终结符,不可以超过目标描述符的最大长度,否则将抛出 USER 23 异常。

 

 

 

Return value

TDes8&  A reference to this, the target descriptor

返回值

TDes8&  一个对当前描述符的引用。

 

 

 

 

--------------------------------------------------------------------------------

 

CopyC()

void CopyC(const TDesC8& aDes);

Description

Copies and collates. 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.

描 述

拷贝并且比较。从指定描述符拷贝并比较数据到当前描述符,覆盖原有数据。描述符的长度被设置为新数据的长度。

 

Parameters

const TDesC8& aDes  An 8 bit non-modifiable descriptor. The length of the data cannot be greater than the maximum length of the target descriptor otherwise the function raises a USER 23 panic.

参 数

const TDesC8& aDes  一个8位不可修改描述符,参数长度不可长过目标描述符的最大长度,否则将抛出 USER 23 异常。

 

 

 

 

--------------------------------------------------------------------------------

 

CopyF()

void CopyF(const TDesC8& aDes);

Description

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.

注意,折叠是一个不依赖语言环境(地域环境)的行为。同样需要重视的是,折叠并不保证对任何地域(以语言划分)都是合适的,对于处理自然语言是不推荐使用这个函数。

 

 

Parameters

const TDesC8& aDes  An 8 bit non-modifiable descriptor. The length of the data cannot be greater than the maximum length of the target descriptor otherwise the function raises a USER 23 panic.

 

const TDesC8& aDes 8位不可修改描述符。数长度不可长过目标描述符的最大长度,否则将抛出 USER 23 异常。

 

 

--------------------------------------------------------------------------------

 

CopyCP()

void CopyCP(const TDesC8& aDes);

Description

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.

首字符大写转换将根据当前语言区域以一种适当的方式进行。

 

Parameters

const TDesC8& aDes  An 8 bit non-modifiable descriptor. The length of the data cannot be greater than the maximum length of the target descriptor otherwise the function raises a USER 23 panic.

参 数

const TDesC8& aDes 8位不可修改描述符。数长度不可长过目标描述符的最大长度,否则将抛出 USER 23 异常。

 

 

 

--------------------------------------------------------------------------------

 

CopyLC()

void CopyLC(const TDesC8& aDes);

Description

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.

小写转换将根据当前语言区域以一种适当的方式进行。

 

Parameters

const TDesC8& aDes  An 8 bit non modifiable descriptor. The length of the data cannot be greater than the maximum length of the target descriptor otherwise the function raises a USER 23 panic.

参 数

const TDesC8& aDes 8位不可修改描述符。数长度不可长过目标描述符的最大长度,否则将抛出 USER 23 异常。

 

 

 

--------------------------------------------------------------------------------

 

CopyUC()

void CopyUC(const TDesC8& aDes);

Description

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.

描 述

从指定描述符拷贝文本,在文本放入描述符前把文本转为大写。替换现有数据,并根据新的数据长度设置描述符长度。

 

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

大写转换将根据当前语言区域以一种适当的方式进行。

Parameters

const TDesC8& aDes  An 8 bit non modifiable descriptor. The length of the data cannot be greater than the maximum length of the target descriptor otherwise the function raises a USER 23 panic

参 数

const TDesC8& aDes 8位不可修改描述符。数长度不可长过目标描述符的最大长度,否则将抛出 USER 23 异常。

 

 

 

 

--------------------------------------------------------------------------------

 

Repeat()

void Repeat(const TUint8* aBuf,TInt aLength);

Description

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.

拷贝过程直到当前数据的长度被填满为止,如果余下的长度不足以放下一个拷贝,那么这个拷贝将被切去尾部填充。

 

Parameters

const TUint8* aBuf  A pointer to data to be repeatedly copied.

参 数

const TUint8* aBuf  一个指项将被重复拷贝的数据的指针。

TInt aLength  The length of data to be copied. This value must be non-negative, otherwise the function raises a USER 29 panic.

TInt aLength    将要被拷贝的数据长度。

 

 

示例代码

TBuf<100>  d=_L("o3o4");

const TUint16 *x=d.Ptr();

a.Repeat(x,2);

CS->Printf(a);

CS->Printf(_L(",%d\n"),a.Length());

 

 

--------------------------------------------------------------------------------

 

Repeat()

void Repeat(const TDesC8& aDes);

Description

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.

拷贝过程直到当前数据的长度被填满为止,如果余下的长度不足以放下一个拷贝,那么这个拷贝将被切去尾部填充。

 

 

Parameters

const TDesC8& aDes  An 8 bit non modifiable descriptor whose data is to be repeatedly copied.

参 数

一个被用于重复拷贝的8位不可修改描述符。

 

 

 

--------------------------------------------------------------------------------

 

Justify()

void Justify(const TDesC8& aDes,TInt aWidth,TAlign anAlignment,TChar aFill);

Description

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.

如果目标区域的长度大于源区域的长度,那么目标区域的剩余空间将使用填充字符进行填充。

 

The resulting length of this descriptor cannot be greater than its maximum length otherwise the function raises a USER 23 panic.

函数处理后的数据区域不可以超过当前描述符的最大长度,否则将抛出 USER 23 异常。

 

Parameters

const TDesC8& Des An 8 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).

参 数

const TDesC8& aDes  一个包含源数据的8位不可修改描述符。将被拷贝数据的长度是两者中较小的一个:源数据长度,目标区域长度。

 

 

TInt aWidth The 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. If it has any other negative value, then the function raises a USER 23 panic.

TInt aWidth 目标数据的长度。如果这个值被指定为负值 KDefaultJustifyWidth(-1),那么这个值被自动设置为源数据长度。如果它使用了其他负值,那么函数将抛出USER 23 异常。

 

TAlign anAlignment The alignment of the data within the target area.

TAlign anAlignment 指定将被填充数据在目标区域的位置。

 

TChar aFill The fill character used to pad the target area.

TChar aFill 用于填充剩余区域的填充字符。

 

 

--------------------------------------------------------------------------------

 

Num()

void Num(TInt aVal);

Description

Converts the specified 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.

如果这是一个负整数,那么描述符将以减号作为前缀。

 

Parameters

TInt aVal  The signed integer value.

参 数

TInt aVal 一个有符号整数。

 

 

--------------------------------------------------------------------------------

 

Num()

void Num(TUint aVal,TRadix aRadix=EDecimal);

Description

Converts the specified 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.

如果被转为16进制数字,那么16进制字符将用小写表示。

 

 

Parameters

TUint aVal  The unsigned integer value

 

TRadix aRadix  The number system representation for the unsigned integer. If no explicit value is specified, then EDecimal is the default.

参 数

TUint aVal  无符号整数

TRadix aRadix   无符号整数将要转化的数字系统。如果没有被显式的指定将使用默认值EDecimal。

 

 

--------------------------------------------------------------------------------

 

NumUC()

void NumUC(TUint aVal,TRadix aRadix=EDecimal);

Description

Converts the specified 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.

如果被转为16进制数字,那么16进制字符将用大写表示。

 

 

Parameters

TUint aVal  The unsigned integer value.

 

TRadix aRadix  The number system representation for the unsigned integer. If no explicit value is specified, then EDecimal is the default.

参 数

TUint aVal  无符号整数

TRadix aRadix   无符号整数将要转化的数字系统。如果没有被显式的指定将使用默认值EDecimal。

 

 

 

--------------------------------------------------------------------------------

 

NumFixedWidth()

void NumFixedWidth(TUint aVal,TRadix aRadix,TInt aWidth);

Description

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.

函数产生指定字符的精确个数,左侧剩余的空白部分将按需要使用0或低位不可见字符填充。

 

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

如果被转为16进制数字,那么16进制字符将用小写表示。

 

 

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

这个函数效用与具有以下参数的 Format() 函数类似:

a fixed length target field

一个固定长度的目标域

padding with zero characters

以0填充剩余空白

 

for example "%08x". When this is the case, always use NumFixedWidth() in preference to Format() as it is more efficient.

例如: %08x,在这种情况下,一般优先选择NumFixedWidth(),因为它与 Format()函数相比将更加高效。

 

Parameters

TUint aVal  The unsigned integer value.

 

TRadix aRadix  The number system representation for the unsigned integer.

 

TInt aWidth  The number of characters: to be used to contain the conversion, to be copied into this descriptor.

 

参数

TUint aVal  无符号整数

TRadix aRadix   无符号整数将要转化的数字系统。

TInt aWidth 字符个数,用于容纳被转化后的字符的数据段长度,用于被拷贝到描述符中的数据段长度。

 

 

 

--------------------------------------------------------------------------------

 

NumFixedWidthUC()

void NumFixedWidthUC(TUint aVal,TRadix aRadix,TInt aWidth);

Description

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.

函数产生指定字符的精确个数,左侧剩余的空白部分将按需要使用0或低位不可见字符填充。

 

 

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

如果被转为16进制数字,那么16进制字符将用大写表示。

 

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

这个函数效用与具有以下参数的 Format() 函数类似:

 

a fixed length target field

一个固定长度的目标域

 

padding with zero characters

以0填充剩余空白

 

for example "%08x".When this is the case, always use NumFixedWidthUC() in preference to Format() as it is more efficient.

例如: %08x,在这种情况下,一般优先选择NumFixedWidth(),因为它与 Format()函数相比将更加高效。

 

 

Parameters

TUint aVal  The unsigned integer value.

 

TRadix aRadix  The number system representation for the unsigned integer.

 

TInt aWidth  The number of characters: to be used to contain the conversion, to be copied into this descriptor.

参数

TUint aVal  无符号整数

TRadix aRadix   无符号整数将要转化的数字系统。

TInt aWidth 字符个数,用于容纳被转化后的字符的数据段长度,用于被拷贝到描述符中的数据段长度。

 

 

--------------------------------------------------------------------------------

 

Num()

void Num(TInt64 aVal);

Description

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.

描 述

把一个指定的64位有符号的整数转化为一个十进制数的字符表达,并把转换结果拷贝入描述符,替换现有数据。描述符的长度将根据新的数据重新设置。

 

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

如果这是一个负整数,那么描述符将以减号作为前缀。

 

Parameters

TInt64 aVal  The 64 bit signed integer value.

参 数

TInt64 aVal  一个64位有符号整数。

 

 

--------------------------------------------------------------------------------

 

Num()

void Num(TInt64 aVal,TRadix aRadix);

Description

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.

描 述

使用特定的基数把无符号64位整数转转化为字符表达,并把转化结果拷贝的描述符,替换现有数据。描述符的长度将根据新的数据重新设置。

 

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

如果被转为16进制数字,那么16进制字符将用小写表示。

 

Parameters

TInt64 aVal  The 64 bit integer value. This is treated as an unsigned value.

 

TRadix aRadix  The number system representation for the 64 bit integer.

参 数

TUint aVal  64位无符号整数

TRadix aRadix   64位无符号整数将要转化的数字系统。

 

 

 

--------------------------------------------------------------------------------

 

NumUC()

void NumUC(TInt64 aVal,TRadix aRadix=EDecimal);

Description

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.

描述

使用特定的基数把64位无符号整数转转化为字符表达,并把转化结果拷贝的描述符,替换现有数据。描述符的长度将根据新的数据重新设置。

 

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

如果被转为16进制数字,那么16进制字符将用大写表示。

 

Parameters

TInt64 aVal  The 64 bit integer value. This is treated as an unsigned value.

 

TRadix aRadix  The number system representation for the 64 bit integer. If no explicit value is specified, then EDecimal is the default.

 

参 数

TUint aVal  64位无符号整数

TRadix aRadix   64位无符号整数将要转化的数字系统。如果没有被显式的指定将使用默认值EDecimal。

 

 

--------------------------------------------------------------------------------

 

Num()

TInt Num(TReal aVal,const TRealFormat& aFormat);

Description

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.

实数的字符表表形式由指定的格式决定。

 

Parameters

TReal aVal  The floating point number to be converted.

 

const TRealFormat& aFormat  The format of the conversion.

参数

TReal aVal  将要被转化的浮点数。

const TRealFormat& aFormat 转化的格式。

 

Return value

TInt  If the conversion is successful, the length of this descriptor. If the conversion fails, a negative value indicating the cause of failure. In addition, extra information on the cause of the failure may be appended onto this descriptor. The possible values and their meaning are: KErrArgument - the supplied floating point number is not a valid number. The three characters NaN are appended to this descriptor. KErrOverflow - the number is too large to represent.& For positive overflow, the three characters Inf are appended to this descriptor. For negative overflow, the four characters -Inf are appended to this descriptor. KErrUnderflow - the number is too small to represent. For positive underflow, the three characters Inf are appended to this descriptor. For negative underflow, the four characters -Inf are appended to this descriptor. KErrGeneral - the conversion cannot be completed. There are a number of possible reasons for this but the two most common are: 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. the character representation format (i.e. the format type), as defined in the TRealFormat object is not recognised.

 

返回值

如果转化成功,那么返回描述符的长度。如果转化失败,那么将使用负值指明失败原因。另外额外的错误原因可能被追加到描述符后面。可能的错误值和它们的含义如下:

KErrArgument - 传递给函数的浮点数并不是一个有效数据,这时三个字符NAN将追加到描述符后。

KErrOverflow - 传递给函数的浮点数太大以至于无法用描述符表达。对于负向或正向溢出,Inf三个字符将追加到描述符后。对于对于负向或正向下溢,-Inf四个字符将被追加到描述符后。

KErrGeneral - 转换无法完成。有很多因素导致这种情况的发生,但是最常见的两个是:其一是用于表现这个数字的最大字符个数,正如在TRealFormat对象中定义的, 超过了描述符的最大长度。其二是在TRealFormat对象中定义的字符表现格式不可识别。

 

 

 

Leave codes

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.

 

异常退出代码

如果指定TRealFormat对象的iType 数据

 

 

 

 

--------------------------------------------------------------------------------

 

Format()

void Format(TRefByValue aFmt,...);

Description

Formats and copies text into this descriptor, replacing any existing data. The length of this descriptor is set to reflect the new data.

格式化并拷贝数据到描述符,替换现有数据。描述符的长度将根据新的数据重新设置。

 

 

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

(注意:格式化单个数值使用Num()和NumUC() 将更加方便。)

 

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. If any directive has incorrect syntax, then the function raises a USER 24 panic.

内嵌指示命令的语法必须按照常用的4种格式。如果指示命令格式错误,函数将抛出USER 24异常。

 

If the resulting length of text in this descriptor exceeds its maximum length, then the function raises a USER 23 panic.

如果在描述符中的结果文本的长度超过了它的最大长度,函数将抛出USER 23异常。

 

Parameters

TRefByValue aFmt  The descriptor containing the format string. The TRefByValue class provides a constructor which takes a TDesC8 type

 

... A variable number of arguments to be converted to text as dictated by the format string.

 

参数

TRefByValue aFmt 包含了格式化字符串的描述符。TRefByValue 类提供了一个带TDesC8类型参数的构造函数。

... 一个可变数目的参数,他们将按照指示命令转化为文本。

 

See also:

String

 

TDes8::Num()

TDes8::NumUC()

 

--------------------------------------------------------------------------------

 

FormatList()

void FormatList(const TDesC8& aFmt,VA_LIST aList);

Description

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 Format(). In practice, it is better and easier to use Format(), passing a variable number of arguments as required by the format string.

这个函数的功能和Forma()函数类似。在实际应用中,使用Format()函数更加简单方便,只要根据格式化字符串的需要传递若干参数就可以。

 

Parameters

const TDesC8& aFmt  The descriptor containing the format string.

 

VA_LIST aList  A pointer to an argument list.

参数

const TDesC8& aFmt 包含了格式化字符串的描述符。

VA_LIST aList  一个指向参数列表的指针。

 

 

See also:

TDes8::Format()

VA_LIST

Format string syntax

 

 

 

--------------------------------------------------------------------------------

 

Inserting data

数据插入

 

--------------------------------------------------------------------------------

 

Insert()

void Insert(TInt aPos,const TDesC8& aDes);

Description

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

把数据插入到描述符中。描述符的数据长度将根据数据的改变进行重新设置。

 

 

The resulting length of this descriptor cannot be greater than its maximum length otherwise the function raises a USER 23 panic.

结果描述符的长度不可以超过描述符的最大长度,否则将抛出 USER 23 异常。

 

 

Parameters

TInt aPos  The position within the data where insertion is to start. This is an offset; a zero value refers to the leftmost data position. This value must not be negative and must not be greater than the length of this descriptor, otherwise the function raises a USER 22 panic.

 

const TDesC8& aDes  An 8 bit non modifiable descriptor whose data is to be inserted.

参数

TInt aPos   指示插入将从描述符数据的何处开始,即数据插入点。这是一个偏移量;如果是零则表示插入点位于描述符数据的最左端。这个值不可以是负值也不可以超过描述符的最大值否则将抛出USER 22 异常。

 

 

 

 

--------------------------------------------------------------------------------

 

Replacing some or all data

部分或全部数据替换

 

--------------------------------------------------------------------------------

 

Replace()

void Replace(TInt aPos,TInt aLength,const TDesC8& aDes);

Description

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.

描 述

替换当前描述符中的数据。将要被替换的目标数据长度可以不同于用于替换的数据长度。描述符的数据长度将根据数据的改变进行重新设置。

The resulting length of this descriptor cannot be greater than its maximum length otherwise the function raises a USER 23 panic.

结果描述符的长度不可以产过当前描述符号的最大长度,否则将抛出 USER 23 异常.

 

 

Parameters

TInt aPos  The position within the data where replacement is to start. This is an offset; a zero value refers to the leftmost data position. This value must not be negative and must not be greater than the length of this descriptor, otherwise the function raises a USER 22 panic.

参 数

TInt aPos   描述符中的一个位置,告诉函数从什么地方开始替换.这是一个偏移量;如果这个值被替换为0,那么就表示从最左边开始替换.这个值不可以是负数也不可以大于描述符的长度,否则将抛出 USER 22 异常.

 

TInt aLength  The length of data to be replaced. This length must not be negative and the sum of this value plus aPos must not be greater than the length of this descriptor, otherwise the function raises a USER 20 panic.

TInt aLength  将要被替换的数据的长度。长度不可以是负值,它与替换起始点和不可以超过描述符号的最大长度,否则函数抛出 USER 20 异常。

 

const TDesC8& aDes  The source 8 bit non modifiable descriptor whose data is to replace the target descriptor's data at aPos. The length of the source descriptor must not be negative and must not exceed the maximum length of the target descriptor, otherwise the function raises a USER 28 panic

const TDesC8& aDes  用于在替换起始点处替换目标描述符的8位不可修改描述符。这个描述符的长度不可以是负值、不可以超过目标描述符的最大长度,否则函数将抛出USER 28 异常。

 

 

 

--------------------------------------------------------------------------------

 

Swap()

void Swap(TDes8& aDes);

Description

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.

 

把当前描述符的数据和指定描述符的数据相交换。它们的数据长度也随着数据的变化而重新设置。

 

Each descriptor must be capable of accommodating the contents of the other descriptor. If the maximum length of either descriptor is smaller than the length of the other descriptor, then the function raises a USER 23 panic.

每个描述符都应该可以适和新的数据。如果两个描述符中的任意一个的最大长度小于另外一个的数据长度,这时函数抛出 USER 23 异常。

 

Parameters

TDes8& aDes  The 8 bit modifiable descriptor whose data is to be swapped with the data of this descriptor.

参数

TDes8& aDes 8位可修改描述符,这个描述符的数据将被当前描述符数据替换。

 

 

 

 

 

--------------------------------------------------------------------------------

 

Deleting data

数据删除

 

--------------------------------------------------------------------------------

 

Delete()

void Delete(TInt aPos,TInt aLength);

Description

Deletes data from this descriptor. The length of this descriptor is changed to reflect the loss of data.

描 述

从这个描述符中删除数据。描述符的数据长度将根据数据的改变进行重新设置。

Parameters

TInt aPos  The position within the data where deletion is to start. This is an offset; a zero value refers to the leftmost data position. This value must not be negative and must not be greater than the length of this descriptor, otherwise the function raises a USER 22 panic.

参 数

TInt aPos  在描述符数据中的位置,指示删除将从何处开始。这是一个偏移量,如果是零,那么就是描述符数据的最左端。

 

 

TInt aLength  The length of data to be deleted. If necessary, the function adjusts this value to ensure that no data beyond the end of the descriptor data area is deleted.

TInt aLength    将要被删除的数据的长度。如果有必要,函数将调整这个值,在描述符数据结尾后已经没有可删除的数据了。

 

 

 

 

--------------------------------------------------------------------------------

 

TrimLeft()

void TrimLeft();

Description

Deletes leading space characters from the descriptors data. All space characters up to, but not including the first non-space character, are deleted.

描述

从描述符数据中删除头部的空格字符。所有的空格字符将被删除,但并不包括非空格的第一个字符。

The length of the descriptor is reduced to reflect the loss of the space characters.

描述符的长度将随着空格字符的祛除而减小。

 

--------------------------------------------------------------------------------

 

TrimRight()

void TrimRight();

Description

Deletes trailing space characters from the descriptor's data. The process starts on the right hand side of the descriptors data and proceeds to the left. All space characters up to, but not including the first non-space character, are deleted.

描述

从描述符数据中删除尾部的空格字符。这个过程将由描述符的右侧向左开始进行。所有的空格字符将被删除,但并不包括非空格的第一个字符。

 

The length of the descriptor is reduced to reflect the loss of the space characters.

描述符的长度将随着空格字符的祛除而减小。

 

 

--------------------------------------------------------------------------------

 

Trim()

void Trim();

Description

Deletes leading and trailing space characters from the descriptor's data.

描述

从描述符删除头部和尾部的空格字符。

The length of the descriptor is reduced to reflect the loss of the space characters.

描述符的长度将随着空格字符的祛除而减小。

 

See also:

TDes8::TrimLeft()

TDes8::TrimRight()

 

--------------------------------------------------------------------------------

 

TrimAll()

void TrimAll();

Description

Deletes leading and trailing space characters from the descriptor's data and replaces each contiguous set of space characters within the data by one space character.

描 述

从描述符删除头部和尾部的空格字符,并用一个空格字符替换相互邻接的空格字符区域。

 

The length of the descriptor is reduced to reflect the loss of the space characters.

描述符的长度将随着空格字符的祛除而减小。

 

See also:

TDes8::Trim()

 

 

 

--------------------------------------------------------------------------------

 

Appending

数据追加

 

--------------------------------------------------------------------------------

 

Append()

void Append(TChar aChar);

Description

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

描述

把数据追加到描述符后。

The length of this descriptor is incremented to reflect the new content; the new length cannot be greater than this descriptor's maximum length otherwise the function raises a USER 23 panic

描述符的长度将因为数据的增加而变大,但是新的长度不可以超过描述符的最大长度,否则将抛出USER 23异常。

 

Parameters

TChar aChar  A single character to be appended. The length of the descriptor is incremented by one. The function assumes that the character is non-Unicode and that it can be represented by a single byte.

参数

TChar aChar 一个将要被追加到描述符末尾的单个字符。描述符的长度将增加1,函数认为,这是一个非Unicode字符,并且是但字节的。

 

 

 

 

--------------------------------------------------------------------------------

 

Append()

void Append(const TDesC8& aDes);

Description

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

描述

把数据追加到描述符后。

 

The length of this descriptor is incremented to reflect the new content; the new length cannot be greater than this descriptor's maximum length otherwise the function raises a USER 23 panic

描述符的长度将因为数据的增加而变大,但是新的长度不可以超过描述符的最大长度,否则将抛出USER 23异常。

 

 

Parameters

const TDesC8& aDes  An 8 bit non modifiable descriptor whose data is to be appended.

参数

将要被追加袄描述符后的8位不可修改的描述符。

 

 

 

--------------------------------------------------------------------------------

 

Append()

void Append(const TDesC16& aDes);

Description

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

描述

把数据追加到描述符后。

 

The length of this descriptor is incremented to reflect the new content; the new length cannot be greater than this descriptor's maximum length otherwise the function raises a USER 23 panic

描述符的长度将因为数据的增加而变大,但是新的长度不可以超过描述符的最大长度,否则将抛出USER 23异常。

 

Parameters

const TDesC16& aDes  A 16 bit non modifiable descriptor whose data is to be appended. Each double-byte value can only be appended as a single byte when the double-byte value is less than decimal 256. A double-byte value of 256 or greater cannot be appended and the corresponding single byte is set to a value of decimal 1.

参 数

将要被追加袄描述符后的16位不可修改的描述符。每一个双字节值,如果它的值小于十进制的256,那么它将以单字节的方式追加;如果它的值等于或者超过256将变的不可追加,相应的值被设置成十进制的1。

 

 

 

--------------------------------------------------------------------------------

 

Append()

void Append(const TUint8* aBuf,TInt aLength);

Description

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

描述

把数据追加到描述符后。

 

The length of this descriptor is incremented to reflect the new content; the new length cannot be greater than this descriptor's maximum length otherwise the function raises a USER 23 panic

描述符的长度将因为数据的增加而变大,但是新的长度不可以超过描述符的最大长度,否则将抛出USER 23异常。

 

Parameters

const TUint8* aBuf  A pointer to data to be copied

 

TInt aLength  The length of data to be copied. This value must be non-negative otherwise the function raises a USER 29 panic.

参数

const TUint8* aBuf  指向将要被拷贝的数据的指针。

 

TInt aLength    将要被拷贝的数据长度。这个值不可以是符值,否则函数将抛出USER 29 异常。

 

 

--------------------------------------------------------------------------------

 

AppendFill()

void AppendFill(TChar aChar,TInt aLength);

Description

Appends and fills this descriptor with the specified character. The function assumes that the character is non-Unicode and that it can be represented by a single byte.

描述

使用指定的字符追加和填充描述符,函数将认为字符是非Unicode的单字节字符。

 

 

The length of this descriptor is incremented by the specified length; the new length cannot be greater than this descriptor's maximum length otherwise the function raises a USER 23 panic

描述符的长度将因为数据的增加而变大,但是新的长度不可以超过描述符的最大长度,否则将抛出USER 23异常。

 

 

Parameters

TChar aChar  The fill character.

 

TInt aLength  The number of fill characters to be appended. This value must be non-negative otherwise the function raises a USER 23 panic.

参数

TChar aChar 填充字符。

TInt aLength    填充字符将要填充的个数。这个值不可以是负值否则函数将抛出 USER23 异常。

 

--------------------------------------------------------------------------------

 

AppendJustify()

void AppendJustify(const TDesC8& Des,TInt aWidth,TAlign anAlignment,TChar aFill);

Description

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.

如果目标区域的宽度大于拷贝数据的宽度,那么余下的区域将用填充字符进行填充。

 

The resulting length of this descriptor cannot be greater than its maximum length otherwise the function raises a USER 23 panic.

函数的结果描述符的长度不可以超过描述符的最大长度,否则将抛出USER 23 异常。

 

Parameters

const TDesC8& Des  An 8 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, the width of the target area (only if this is not the explicit negative value KDefaultJustifyWidth).

 

TInt aWidth  The 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. If it has any other negative value, then the function raises a USER 23 panic.

 

TAlign anAlignment  The alignment of the data within the target area.

 

TChar aFill  The fill character used to pad the target area.

参 数

const TDesC8& Des   包含源数据的、8位不可修改的描述符。将要被拷贝的数据的长度是下面两者中的较小者:源描述符的长度,目标区域的宽度(仅当这个值不是一个显式的KDefaultJustifyWidth)

TInt aWidth 目标区域的宽度。如果这个值被指定为负值:KDefaultJustifyWidth,那么目标区域的宽度被设置为源描述符的宽度。如果使用了除KDefaultJustifyWidth外的其它负值,那么将抛出 USER 23 异常。

TAlign anAlignment  数据在目标区域的位置。

TChar aFill 用于填充目标区域剩余空间的字符。

 

--------------------------------------------------------------------------------

 

AppendJustify()

void AppendJustify(const TDesC8& Des,TInt aLength,TInt aWidth,TAlign anAlignment,TChar aFill);

Description

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.

如果目标区域的宽度大于拷贝数据的宽度,那么余下的区域将用填充字符进行填充。

 

The resulting length of this descriptor cannot be greater than its maximum length otherwise the function raises a USER 23 panic.

函数的结果描述符的长度不可以超过描述符的最大长度,否则将抛出USER 23 异常。

 

 

Parameters

const TDesC8& Des  An 8 bit non modifiable descriptor containing the source data.

 

TInt aLength  The 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. This condition is not automatically tested.

 

TInt aWidth  The 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. If it has any other negative value, then the function raises a USER 23 panic.

 

TAlign anAlignment  The alignment of the data within the target area.

 

TChar aFill  The fill character used to pad the target area.

参 数

const TDesC8& Des   包含源数据的、8位不可修改的描述符。

TInt aLength        将要从源描述符拷贝的数据长度。如果这个值大于目标区域的宽度,那么将要被拷贝佃户局的长度将受到目标区域宽度的限制。将要被拷贝的数据长           度不可以超过源描述符的长度,这不被函数自动测试。

TInt aWidth         目标区域的宽度。如果这个值被指定为负值:KDefaultJustifyWidth,那么目标区域的宽度被设置为源描述符的宽度。如果使用了除                  KDefaultJustifyWidth外的其它负值,那么将抛出 USER 23 异常。

TAlign anAlignment  数据在目标区域的位置。

TChar aFill     用于填充目标区域剩余空间的字符。

 

 

 

 

--------------------------------------------------------------------------------

 

AppendJustify()

void AppendJustify(const TUint8* aString,TInt aWidth,TAlign anAlignment,TChar aFill);

Description

Appends a zero terminated string onto the end of this descriptor's data and justifies it. The zero terminator is not copied.

描 述

追加\0终结符字符串到描述符末尾并对这个数据做适当的调整。\0终结符字符串不被拷贝。

 

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.

如果目标区域的宽度大于拷贝数据的宽度,那么余下的区域将用填充字符进行填充。

 

The resulting length of this descriptor cannot be greater than its maximum length otherwise the function raises a USER 23 panic.

函数的结果描述符的长度不可以超过描述符的最大长度,否则将抛出USER 23 异常。

 

 

Parameters

const TUint8* aString  A 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 aWidth  The 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). If it has any other negative value, then the function raises a USER 23 panic.

 

TAlign anAlignment  The alignment of the data within the target area.

 

TChar aFill  The fill character used to pad the target area.

 

参 数

const TDesC8& Des   一个指向\0终结符字符串的指针。将要被拷贝的数据的长度是下面两者中的较小者:字符串长度(包括\0终结符),目标区域的宽度(仅当这个值           不是一个显式的KDefaultJustifyWidth)

TAlign anAlignment  数据在目标区域的位置。

TChar aFill     用于填充目标区域剩余空间的字符。

 

 

 

 

--------------------------------------------------------------------------------

 

AppendJustify()

void AppendJustify(const TUint8* aString,TInt aLength,TInt aWidth,TAlign anAlignment,TChar aFill);

Description

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.

如果目标区域的宽度大于拷贝数据的宽度,那么余下的区域将用填充字符进行填充。

 

The resulting length of this descriptor cannot be greater than its maximum length otherwise the function raises a USER 23 panic.

函数的结果描述符的长度不可以超过描述符的最大长度,否则将抛出USER 23 异常。

 

 

Parameters

const TUint8* aString  A pointer to a memory location.

 

TInt aLength  The 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. This value cannot be negative otherwise the function raises a USER 29 panic.

 

TInt aWidth  The 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. If it has any other negative value, then the function raises a USER 23 panic.

 

TAlign anAlignment  The alignment of the data within the target area.

 

TChar aFill  The fill character used to pad the target area.

 

参 数

const TDesC8& Des   一个指向内存地址的指针。     

 

 

TInt aLength        将要从源描述符拷贝的数据长度。如果这个值大于目标区域的宽度,那么将要被拷贝佃户局的长度将受到目标区域宽度的限制。这个值不可以是负        值,否则函数将抛出 USER 29 异常

TInt aWidth         目标区域的宽度。如果这个值被指定为负值:KDefaultJustifyWidth,那么目标区域的宽度被设置为源描述符的宽度。如果使用了除                  KDefaultJustifyWidth外的其它负值,那么将抛出 USER 23 异常。

TAlign anAlignment  数据在目标区域的位置。

TChar aFill     用于填充目标区域剩余空间的字符。

 

--------------------------------------------------------------------------------

 

operator+=()

TDes8& operator+=(const TDesC8& aDes);

Description

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; the new length cannot be greater than this descriptor's maximum length otherwise the function raises a USER 23 panic

描述符的长度也随着描述符内容的增加而增加。新的描述符长度不可以超过描述符的最大长度,否则将抛出 USER 23异常。

 

Parameters

const TDesC8& aDes  An 8 bit non modifiable descriptor whose data is to be appended.

参 数

const TDesC8& aDes  8位不可修改描述符号,该描述符的数据将用于追加。

 

 

Return value

TDes8&  A reference to this descriptor

返回值

TDes8& 对当前描述符的引用。

 

 

--------------------------------------------------------------------------------

 

AppendNum()

void AppendNum(TInt aVal);

Description

Converts the specified 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.

如果该整数是负值,那么将使用减号作为前缀。

Parameters

TInt aVal  The signed integer value.

参 数

TInt aVal   有符号整数值。

 

 

 

 

--------------------------------------------------------------------------------

 

AppendNum()

void AppendNum(TUint aVal,TRadix aRadix=EDecimal);

Description

Converts the specified 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.

如果被转为16进制数字,那么16进制字符将用小写表示。

 

Parameters

TUint aVal  The unsigned integer value

 

TRadix aRadix  The number system representation for the unsigned integer. If no explicit value is specified, then EDecimal is the default.

 

参 数

TUint aVal  无符号整数

TRadix aRadix   无符号整数将要转化的数制。如果没有被显式的指定将使用默认值EDecimal。

 

 

 

--------------------------------------------------------------------------------

 

AppendNumUC()

void AppendNumUC(TUint aVal,TRadix aRadix=EDecimal);

Description

Converts the specified 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.

如果被转为16进制数字,那么16进制字符将用大写表示。

 

Parameters

TUint aVal  The unsigned integer value.

 

TRadix aRadix  The number system representation for the unsigned integer. If no explicit value is specified, then EDecimal is the default.

 

参 数

TUint aVal  无符号整数

TRadix aRadix   无符号整数将要转化的数字系统。如果没有被显式的指定将使用默认值EDecimal。

 

 

--------------------------------------------------------------------------------

 

AppendNumFixedWidth()

void AppendNumFixedWidth(TUint aVal,TRadix aRadix,TInt aWidth);

Description

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.

函数产生指定字符的精确个数,左侧剩余的空白部分将按需要使用0或低位不可见字符填充。

 

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

如果被转为16进制数字,那么16进制字符将用小写表示。

 

Parameters

TUint aVal  The unsigned integer value.

 

TRadix aRadix  The number system representation for the unsigned integer.

 

TInt aWidth  The number of characters: to be used to contain the conversion, to be appended to this descriptor.

 

参 数

TUint aVal  无符号整数

TRadix aRadix   无符号整数将要转化的数字系统。如果没有被显式的指定将使用默认值EDecimal。

TInt aWidth 字符个数,用于容纳被转化后的字符的数据段长度,用于被追加到描述符中的数据段长度。

 

 

--------------------------------------------------------------------------------

 

AppendNumFixedWidthUC()

void AppendNumFixedWidthUC(TUint aVal,TRadix aRadix,TInt aWidth);

Description

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.

函数产生指定字符的精确个数,左侧剩余的空白部分将按需要使用0或低位不可见字符填充。

 

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

如果被转为16进制数字,那么16进制字符将用大写表示。

 

Parameters

TUint aVal  The unsigned integer value.

 

TRadix aRadix  The number system representation for the unsigned integer.

 

TInt aWidth  The number of characters: to be used to contain the conversion, to be appended to this descriptor.

 

参 数

TUint aVal  无符号整数

TRadix aRadix   无符号整数将要转化的数字系统。如果没有被显式的指定将使用默认值EDecimal。

TInt aWidth 字符个数,用于容纳被转化后的字符的数据段长度,用于被追加到描述符中的数据段长度。

 

 

 

--------------------------------------------------------------------------------

 

AppendNum()

void AppendNum(TInt64 aVal);

Description

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

描 述

把一个指定的64位有符号的整数转化为一个十进制的字符表达,并把转换结果追加到描述符结尾。描述符的长度将根据新的数据重新设置。

 

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

如果这是一个负整数,那么描述符将以减号作为前缀。

 

Parameters

TInt64 aVal  The 64 bit signed integer value.

参 数

TInt64 aVal  一个64位有符号整数。

 

 

--------------------------------------------------------------------------------

 

AppendNum()

void AppendNum(TInt64 aVal,TRadix aRadix);

Description

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

描 述

把一个指定的64位有符号的整数转化为一个特定数制的字符表达,并把转换结果追加到描述符结尾。描述符的长度将根据新的数据重新设置。

 

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

如果被转为16进制数字,那么16进制字符将用小写表示。

Parameters

TInt64 aVal  The 64 bit integer value. This is treated as an unsigned value.

 

TRadix aRadix  The number system representation for the 64 bit integer.

 

参 数

TUint aVal  64位无符号整数

TRadix aRadix   64位无符号整数将要转化的数制。

 

 

--------------------------------------------------------------------------------

 

AppendNumUC()

void AppendNumUC(TInt64 aVal,TRadix aRadix=EDecimal);

Description

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

描 述

把一个指定的64位有符号的整数转化为一个特定数制的字符表达,并把转换结果追加到描述符结尾。描述符的长度将根据新的数据重新设置。

 

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

如果被转为16进制数字,那么16进制字符将用大写表示。

 

Parameters

TInt64 aVal  The 64 bit integer value. This is treated as an unsigned value.

 

TRadix aRadix  The number system representation for the 64 bit integer. If no explicit value is specified, then EDecimal is the default.

参 数

TUint aVal  64位无符号整数

TRadix aRadix   64位无符号整数将要转化的数字系统。如果没有被显式的指定将使用默认值EDecimal。

 

 

 

--------------------------------------------------------------------------------

 

AppendNum()

TInt AppendNum(TReal aVal,const TRealFormat& aFormat);

Description

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.

 

Parameters

TReal aVal  The floating point number to be converted.

 

const TRealFormat& aFormat  The format of the conversion.

 

 

 

Return value

TInt  If the conversion is successful, the length of this descriptor. If the conversion fails, a negative value indicating the cause of failure. In addition, extra information on the cause of the failure may be appended onto this descriptor. The possible values and their meaning are: KErrArgument - the supplied floating point number is not a valid number. The three characters NaN are appended to this descriptor. KErrOverflow - the number is too large to represent. For positive overflow, the three characters Inf are appended to this descriptor. For negative overflow, the four characters -Inf are appended to this descriptor. KErrUnderflow - the number is too small to represent. For positive underflow, the three characters Inf are appended to this descriptor. For negative underflow, the four characters -Inf are appended to this descriptor. KErrGeneral - the conversion cannot be completed. There are a number of possible reasons for this but the two most common are: 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. the character representation format (i.e. the format type), as defined in the TRealFormat object is not recognised.

 

 

 

Leave codes

 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.

 

 

 

 

--------------------------------------------------------------------------------

 

AppendFormat()

void AppendFormat(TRefByValue aFmt,TDes8Overflow* aOverflowHandler,...);

void AppendFormat(TRefByValue aFmt,...);

Description

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 syntax of the format string can be found in the description of the Format() function.

关于格式化字符串的语法可以在Format() 函数的介绍中找到。

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:

字面量文本逐个逐个的追加到描述符。如果结果描述符号的长度超过它的最大长度,那么函数将发生以下情况:

 

calls the Overflow() member function of the overflow handler, if an overflow handler is supplied.

如果溢出句柄已经提供,则调用溢出句柄的Overflow()成员函数。

 

raises a USER 23 panic, if no overflow handler is supplied.

如果没有溢出句柄提供,则抛出USER 23 异常。

 

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 this function:

从尾随的参数转化过来的文本以完整字符串的相形式追加到描述符号。如果这种字符串追加失败,那是因为结果描述符的长度将要超过他的最大长度。这样函数将有以下情况发生:

 

calls the Overflow() member function of the overflow handler, if an overflow handler is supplied.

如果overflow句柄已经提供,则调用overflow句柄的Overflow()成员函数。

 

raises a USER 23 panic, if no overflow handler is supplied.

如果没有overflow句柄提供,则抛出USER 23 异常。

 

None of the generated text is appended and length of this descriptor may be less than the maximum.

没有生成文本的追加,描述符的长度就可能小于它的最大长度。

 

Parameters

TRefByValue aFmt  The 8 bit non modifiable descriptor containing the format string. The TRefByValue class provides a constructor which takes a TDesC8 type

参数

包含了格式化字符串的描述符。TRefByValue 类提供了一个带TDesC8类型参数的构造函数。

 

TDes8Overflow* aOverflowHandler  If supplied, a pointer to the overflow handler.

TDes8Overflow* aOverflowHandler  如果提供,那么它是一个指向溢出句柄的指针。

 

...  A variable number of arguments to be converted to text as dictated by the format string.

... 一个可变数目的参数,他们将按照指示命令转化为文本。

 

 

 

See also:

TDes8::Format()

 

--------------------------------------------------------------------------------

 

AppendFormatList()

void AppendFormatList(const TDesC8& aFmt,VA_LIST aList,TDes8Overflow *aOverflowHandler=NULL);

Description

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(). In practice, it is better and easier to use AppendFormat(), passing a variable number of arguments as required by the format string.

这个函数的功能和AppendFormat()类似。在实际应用中,使用AppendFormat()函数更加简单方便,只要根据格式化字符串的需要传递若干参数就可以。

 

Parameters

const TDesC8& aFmt  The descriptor containing the format string.

 

VA_LIST aList  A pointer to an argument list.

 

TDes8Overflow* aOverflowHandler  If supplied, a pointer to the overflow handler.

参数

const TDesC8& aFmt 包含了格式化字符串的描述符。

VA_LIST aList  一个指向参数列表的指针。

TDes8Overflow* aOverflowHandler  如果提供,那么它是一个指向溢出句柄的指针。

 

 

See also:

TDes8::AppendFormat()

VA_LIST

Format string syntax

 

 

 

--------------------------------------------------------------------------------

 

Append zero terminator

追加零终结符

 

--------------------------------------------------------------------------------

 

ZeroTerminate()

void ZeroTerminate();

Description

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

描述

把一个\0终结符追加到描述符后。

 

The length of the descriptor is not changed. It must be strictly less than the descriptor's maximum length otherwise the function raises a USER 23 panic. This condition guarantees that there is sufficient space for the zero terminator.

描述符的长度并不改变。它必须严格的小于描述符的最大长度,否则函数将抛出USER 23异常。这就保证了有足够的空间分配给\0终结符。

 

--------------------------------------------------------------------------------

 

PtrZ()

const TUint8* PtrZ();

Description

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

描述

把一个\0终结符追加到描述符后,并返回一个指向数据的指针。

 

The length of the descriptor is not changed. It must be strictly less than the descriptor's maximum length otherwise the function raises a USER 23 panic. This condition guarantees that there is sufficient space for the zero terminator.

描述符的长度并不改变。它必须严格的小于描述符的最大长度,否则函数将抛出USER 23异常。这就保证了有足够的空间分配给\0终结符。

 

Return value

TUint8*  A pointer to the descriptor data.

返回值

TUint8* 一个指向描述符数据的指针。

 

 

 

 

--------------------------------------------------------------------------------

 

Filling

数据填充

 

--------------------------------------------------------------------------------

 

Fill()

void Fill(TChar aChar);

Description

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.

描述符将被按照长度从头至尾填充数据区域,但并不填充至最大长度。描述符的长度不被改变。

 

 

Parameters

TChar aChar  The fill character. The function assumes that the character is non-Unicode and that it can be represented by a single byte.

参 数

TChar aChar 填充字符。函数认为该字符是非Unicode的,可被单字节表示的。

 

 

--------------------------------------------------------------------------------

 

Fill()

void Fill(TChar aChar,TInt aLength);

Description

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

用指定字符填充描述符的数据区域,并覆盖原有数据。

 

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

描述符将被指定个数的字符填充。描述符的长度不被改变。

 

Parameters

TChar aChar  The fill character. The function assumes that the character is non-Unicode and that it can be represented by a single byte.

 

TInt aLength  The new length of the descriptor and the number of fill characters to be copied into it. This value must not be negative and must not be greater than the maximum length of this descriptor, otherwise the function raises a USER 23 panic.

参 数

TChar aChar 填充字符。函数认为该字符是非Unicode的,可被单字节表示的。

TInt aLength    描述符的新长度、将要被拷贝到描述符中的字符的个数。这个数不可以是负值、不可以超过描述符的最大长度,否则将抛出 USER 23异常。

 

 

 

--------------------------------------------------------------------------------

 

FillZ()

void FillZ();

Description

Fills the descriptor's data area with binary zeroes, i.e. 0x00, replacing any existing data.

描述

将描述符的数据区域以二进制0填充,即 0x00,覆盖现有数据。

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.

描述符从头开始填充直到当前长度,并不填充到描述符的最大长度。描述符的长度不做改变。

 

 

--------------------------------------------------------------------------------

 

Fillz()

void FillZ(TInt aLength);

Description

Fills the descriptor's data area with binary zeroes, i.e. 0x00, replacing any existing data.

描述

将描述符的数据区域以二进制0填充,即 0x00,覆盖现有数据。

 

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

描述符将被指定个数的二进制0填充。描述符的长度不被改变。描述符的长度将根据新的数据重新设置。

 

 

Parameters

TInt aLength  The new length of the descriptor and the number of binary zeroes to be copied into it. This value must not be negative and must not be greater than the maximum length of this descriptor, otherwise the function raises a USER 23 panic.

 

参 数

描述符的新长度、将要被拷贝到描述符中的二进制0的个数。这个数不可以是负值、不可以超过描述符的最大长度,否则将抛出 USER 23异常。

 

 

 

 

--------------------------------------------------------------------------------

 

Text conversion

文本转换

--------------------------------------------------------------------------------

 

Capitalize()

void Capitalize();

Description

Capitalises the content of this descriptor.

描 述

把描述符内容进行首字大写的转换。

 

Capitalisation is implemented as appropriate to the current locale.

首字大写转换过程将根据所在地域的语言特点进行。

 

--------------------------------------------------------------------------------

 

LowerCase()

void LowerCase();

Description

Converts the content of this descriptor to lower case.

描述

把描述符的内容转为小写。

Conversion is implemented as appropriate to the current locale.

转换过程将根据所在地域的语言特点进行。

 

 

 

--------------------------------------------------------------------------------

 

UpperCase()

void UpperCase();

Description

Converts the content of this descriptor to upper case.

描述

把描述符的内容转为大写。

 

Conversion is implemented as appropriate to the current locale.

转换过程将根据所在地域的语言特点进行。

 

 

--------------------------------------------------------------------------------

 

Collate()

void Collate();

Description

Performs collation on the content of this descriptor.

描述

对描述符的内容进行整理(整序)。(译者:祛除那些字符间被认为不太重要的差别,使字符排列成一个可比序列)

 

 

译者:对于Collate在SDK Help 的Glossary有这样的解释

collate

The removal of differences between characters that are deemed unimportant for the purposes  of ordering characters into their collating sequence.

忽略字符间那些在可比性上的差异,使成为一个可排序的序列。

 

--------------------------------------------------------------------------------

 

Fold()

void Fold();

Description

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.

 

注意:折叠是一个与地域无关的行为。同样需要重视的是,折叠操作并不保证文化上的适用性,不应该在自然语言上使用。

 

 

译者:对于fold在SDK Help 的Glossary有这样的解释

fold

The removal of differences between characters that are deemed unimportant for the purposes  of inexact or case-insensitive matching. As well as ignoring differences of case, folding  ignores any accent on a character.

去除字符间那些不重要差异,其目的是使那些字符不需要太精确也不需要有大小上的区分。忽略字符在大小写上的差异,忽略字符在发音上的差异。