Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: e32des8.h
Link against: euser.lib

Class TBuf8

class TBuf8<TInt>

Support

Supported from 5.0

Description

This is a descriptor class which provides a buffer of fixed length for containing, accessing and manipulating TUint8 data.

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

TBuf8This is a descriptor class which provides a buffer of fixed length for containing, accessing and manipulating TUint8 data
TBufBase8Base class used in the derivation of TBuf8
TDes8Modifiable 8-bit descriptor; abstract class
TDesC8Abstract base class for 8 bit non-modifiable descriptors

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

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

Inherited from TDesC8:
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:


Construction


TBuf8()

TBuf8();

Description

Constructs an empty 8 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.


TBuf8()

TBuf8(const TBuf8<S>& aBuf);

Description

Constructs the 8 bit modifiable buffer descriptor from an existing 8 bit modifiable buffer descriptor having the same template value.

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

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

Parameters

const TBuf8<S>& aBuf

The source 8 bit modifiable buffer descriptor with the same template length as this descriptor.


TBuf8()

TBuf8(TInt aLength);

Description

Constructs an empty 8 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. This value must be non-negative and must not be greater than the maximum length (the value of the integer template parameter), otherwise the constructor raises a USER 20 panic.


TBuf8()

TBuf8(const TDesC8& aDes);

Description

Constructs the 8 bit modifiable buffer descriptor from any existing 8 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.

The length of the source descriptor must not be greater than the value of the integer template parameter, otherwise the constructor raises a USER 23 panic.

Parameters

const TDes8C& aDes

The source 8 bit non-modifiable descriptor.


TBuf8()

TBuf8(const TUint8* aString);

Description

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

The integer template parameter determines the size of the data area 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.

The length of the string, excluding the zero terminator, must not be greater than the value of the integer template parameter, otherwise the constructor raises a USER 23 panic

Parameters

const TUint8* aString

A pointer to a zero terminated string.

[Top]


Copying data, replacing existing data


operator=()

TBuf8<S>& operator=(const TBuf8<S>& aBuf);TBuf8<S>& operator=(const TDesC8& aDes);TBuf8<S>& operator=(const TUint8* aString);

Description

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

Parameters

const TBuf8<S>& aBuf

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

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

Return value

TBuf8<S>

A reference to this 8 bit modifiable buffer descriptor.