Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
TBuf< S > Class Template Reference

A build-independent modifiable buffer descriptor. More...

#include <e32cmn.h>

Inheritance diagram for TBuf< S >:

Public Member Functions

 TBuf ()
 Creates a build-independent modifiable buffer descriptor which contains no data.
 
 TBuf (TInt aLength)
 Constructs an empty build independent modifiable buffer descriptor and sets its length to the specified value.
 
 TBuf (const TText *aString)
 Constructs the build-independent modifiable buffer descriptor from a zero terminated string.
 
 TBuf (const TDesC &aDes)
 Constructs the build-independent modifiable buffer descriptor from any existing build-independent descriptor.
 
TBuf< S > & operator= (const TText *aString)
 
TBuf< S > & operator= (const TDesC &aDes)
 Copies data into this descriptor replacing any existing data.
 
TBuf< S > & operator= (const TBuf< S > &aBuf)
 

Detailed Description

template<TInt S>
class TBuf< S >

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.

See also
TDesC
TDesC8
TDesC16
TDes
TDes8
TDes16
TPtr
TPtr8
TPtr16
API status
Published to all clients. Released API.

Definition at line 1576 of file e32cmn.h.

Constructor & Destructor Documentation

◆ TBuf() [1/4]

template<TInt S>
TBuf< S >::TBuf ( )
inline

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.

(generated from Symbian Developer Library)

◆ TBuf() [2/4]

template<TInt S>
TBuf< S >::TBuf ( TInt  aLength)
inlineexplicit

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
aLengthThe length of this modifiable buffer descriptor.

Panic condition: USER 8, if aLength is negative and is greater than the value of the integer template parameter for a 16-bit build variant.

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

(generated from Symbian Developer Library)

◆ TBuf() [3/4]

template<TInt S>
TBuf< S >::TBuf ( const TText *  aString)
inline

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
aStringA pointer to a zero terminated string.

Panic condition: 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.

Panic condition: 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.

(generated from Symbian Developer Library)

◆ TBuf() [4/4]

template<TInt S>
TBuf< S >::TBuf ( const TDesC &  aDes)
inline

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
aDesThe source build independent non-modifiable descriptor.

Panic condition: 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.

Panic condition: 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.

(generated from Symbian Developer Library)

Member Function Documentation

◆ operator=() [1/3]

template<TInt S>
TBuf< S > & TBuf< S >::operator= ( const TBuf< S > &  aBuf)
inline

◆ operator=() [2/3]

template<TInt S>
TBuf< S > & TBuf< S >::operator= ( const TDesC &  aDes)
inline

Copies data into this descriptor replacing any existing data.

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

Parameters
aDesA 16-bit non-modifiable descriptor.

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

(generated from Symbian Developer Library)

◆ operator=() [3/3]

template<TInt S>
TBuf< S > & TBuf< S >::operator= ( const TText *  aString)
inline

The documentation for this class was generated from the following files: