Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: e32cmn.h

Class TBuf

class TBuf : public TBufBase16;

Description

A build-independent modifiable buffer descriptor.

This is a descriptor class which provides a buffer of fixed length for containing, accessing and manipulating TUint16 or TUint8 data, depending on the build.

The class is intended for instantiation. The 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 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.

This class derives from TBufCBase16 for a Unicode, non-kernel build, but derives from TBufCBase8 for a non-Unicode build.

Derivation

Members

Defined in TBuf:
TBuf(), TBuf(), TBuf(), TBuf(), operator=(), operator=(), operator=()

See also:


Construction and destruction


TBuf()

inline TBuf();

Description

Creates a build-independent modifiable buffer descriptor which contains no data.

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


TBuf()

inline TBuf(TInt aLength);

Description

Constructs an empty build independent modifiable buffer descriptor and sets its length to the specified value.

No data is assigned to the descriptor.

The integer template parameter determines 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 and is greater than the value of the integer template parameter for a 16-bit build variant.

USER

20, if aLength is negative and is greater than the value of the integer template parameter for a 8-bit build variant.


TBuf()

inline TBuf(const TText *aString);

Description

Constructs the build-independent modifiable buffer descriptor from a zero terminated string.

The integer template parameter determines the size of the data area which is created as part of this object.

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 TText *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 for a 16-bit build variant.

USER

23, if the length of the string, excluding the zero terminator, is greater than the value of the integer template parameter for a 8-bit build variant.


TBuf()

inline TBuf(const TDesC &aDes);

Description

Constructs the build-independent modifiable buffer descriptor from any existing build-independent 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 TDesC &aDes

The source build independent non-modifiable descriptor.

Panic codes

USER

11, if the length of the source descriptor is greater than the value of the integer template parameter for a 16-bit build variant.

USER

23, if the length of the source descriptor is greater than the value of the integer template parameter for an 8-bit build variant.

[Top]


Member functions


operator=()

inline TBuf< S > &operator=(const TText *aString);

Description

Parameters

const TText *aString

Return value

TBuf< S > &


operator=()

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

Description

Parameters

const TDesC &aDes

Return value

TBuf< S > &


operator=()

inline TBuf< S > &operator=(const TBuf< S > &aBuf);

Description

Parameters

const TBuf< S > &aBuf

Return value

TBuf< S > &