Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <e32des16.h>

Class TBuf16

class TBuf16 : public TBufBase16;

Description

A descriptor class which provides a buffer of fixed length for containing, accessing and manipulating TUint16 data.

The class is intended for instantiation. The 16-bit data that the descriptor represents is part of the descriptor object itself.

The class is templated, based on an integer value which determines the size of the data area which is created as part of the buffer descriptor object; this is also the maximum length of the descriptor.

The data is intended to be both accessed and modified. The base classes provide the functions through which the data is accessed.

Derivation

Members

Defined in TBuf16:

See also:


Construction and destruction


TBuf16()

inline TBuf16();

Description

Constructs an empty 16-bit modifiable buffer descriptor.

It contains no data.

The integer template parameter determines the size of the data area created as part of the object and defines the descriptor's maximum length.


TBuf16(TInt)

inline TBuf16(TInt aLength);

Description

Constructs an empty 16-bit modifiable buffer descriptor and sets the its length to the specified value.

No data is assigned to the descriptor.

The integer template parameter defines the size of the data area created as part of the object and defines the descriptor's maximum length.

Parameters

TInt aLength

The length of this modifiable buffer descriptor.

Panic codes

USER

8, if aLength is negative or is greater than the value of the integer template parameter.


TBuf16(const TUint16 *)

inline TBuf16(const TUint16 *aString);

Description

Constructs the 16-bit modifiable buffer descriptor from a zero terminated string.

The integer template parameter determines the size of the data area that is created as part of this object, and defines the descriptor's maximum length.

The string, excluding the zero terminator, is copied into this buffer descriptor's data area. The length of this buffer descriptor is set to the length of the string, excluding the zero terminator.

Parameters

const TUint16 *aString

A pointer to a zero terminated string.

Panic codes

USER

11, if the length of the string, excluding the zero terminator, is greater than the value of the integer template parameter.


TBuf16(const TDesC16 &)

inline TBuf16(const TDesC16 &aDes);

Description

Constructs the 16-bit modifiable buffer descriptor from any existing 16-bit descriptor.

The integer template parameter determines the size of the data area created as part of this object and defines the descriptor's maximum length.

Data is copied from the source descriptor into this modifiable buffer descriptor and the length of this modifiable buffer descriptor is set to the length of the source descriptor.

Parameters

const TDesC16 &aDes

The source 16-bit non-modifiable descriptor.

Panic codes

USER

11, if the length of the source descriptor is greater than the value of the integer template parameter.

[Top]


Member functions


operator=(const TUint16 *)

inline TBuf16< S >& operator=(const TUint16 *aString);

Description

Copies data into this 16-bit modifiable buffer descriptor, replacing any existing data.

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

Parameters

const TUint16 *aString

A pointer to a zero-terminated string.

Return value

TBuf16< S > &

A reference to this descriptor.

Panic codes

USER

11, if the length of the string, excluding the zero terminator, is greater than the maximum length of this (target) descriptor.


operator=(const TDesC16 &)

inline TBuf16< S >& operator=(const TDesC16 &aDes);

Description

Copies data into this 16-bit modifiable 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.

Return value

TBuf16< S > &

A reference to this descriptor.

Panic codes

USER

11, if the length of the descriptor aDes is greater than the maximum length of this (target) descriptor.


operator=(const TBuf16< S > &)

inline TBuf16< S >& operator=(const TBuf16< S > &aDes);

Description

Copies data into this 16-bit modifiable buffer descriptor replacing any existing data.

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

Parameters

const TBuf16< S > &aDes

The source 16-bit modifiable buffer descriptor with the same template value.

Return value

TBuf16< S > &

A reference to this 16-bit modifiable buffer descriptor.

Panic codes

USER

11, if the length of the descriptor aDes is greater than the maximum length of this (target) descriptor.

[Top]


Member data


iBuf

protected: TUint16 iBuf[((((S)+(sizeof(TInt)/sizeof(TInt16))-1)/(sizeof(TInt)/sizeof(TInt16)))*(sizeof(TInt)/sizeof(TInt16)))];

Description