Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: e32des8.h
Link against: euser.lib

Class TPtr8

class TPtr8

Support

Supported from 5.0

Description

This is a descriptor class intended for instantiation and encapsulates a pointer to the 8 bit data that it represents. The data can live in ROM or RAM and this location is separate from the descriptor object itself.

The data is intended to be accessed and modified through this descriptor. The base classes provide the functions through which the data can be manipulated.

Derivation

TDes8Modifiable 8-bit descriptor; abstract class
TDesC8Abstract base class for 8 bit non-modifiable descriptors
TPtr8This is a descriptor class intended for instantiation and encapsulates a pointer to the 8 bit data that it represents

Defined in TPtr8:
Set(), TPtr8(), 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


TPtr8()

TPtr8(const TPtr8& aTPtr);

Description

Constructs the 8 bit modifiable pointer descriptor from an existing 8 bit pointer descriptor.

It is set to point to the same data, is given the same length and the same maximum length as the source pointer descriptor.

Parameters

const TPtr8& aTPtr

The source 8 bit modifiable pointer descriptor


TPtr8()

TPtr8(TUint8* aBuf,TInt aMaxLength);

Description

Constructs the 8 bit modifiable pointer descriptor to point to the specified location in memory, whether in RAM or ROM. The length of the descriptor is set to zero and its maximum length is set to the specified value.

Parameters

const TUint8* aBuf

A pointer to the location that the descriptor is to represent.

TInt aMaxLength

The maximum length of the descriptor. This value must be non-negative otherwise the constructor raises a USER 30 panic.


TPtr8()

TPtr8(TUint8* aBuf,TInt aLength,TInt aMaxLength);

Description

Constructs the 8 bit modifiable pointer descriptor to point to the specified location in memory, whether in RAM or ROM. The length of the descriptor and its maximum length are set to the specified values.

Parameters

const TUint8* aBuf

A pointer to the location that the descriptor is to represent.

TInt aLength

The length of the descriptor. This value must be non-negative and must not be greater than the maximum length, otherwise the constructor raises a USER 20 panic.

TInt aMaxLength

The maximum length of the descriptor. This value must be non-negative, otherwise the constructor raises a USER 30 panic.

[Top]


Setting the descriptor


Set()

void Set(TPtr8& aPtr);

Description

Sets the 8 bit modifiable pointer descriptor from an existing 8 bit modifiable pointer descriptor.

It is set to point to the same data, is given the same length and the same maximum length as the source pointer descriptor.

Parameters

const TPtr8& aTPtr

The source 8 bit modifiable pointer descriptor


Set()

void Set(TUint8* aBuf,TInt aLength,TInt aMaxLength);

Description

Sets the 8 bit modifiable pointer descriptor to point to the specified location in memory, whether in RAM or ROM. The length of the descriptor and its maximum length are set to the specified values.

Parameters

const TUint8* aBuf

A pointer to the location that the descriptor is to represent.

TInt aLength

The length of the descriptor. This value must be non-negative and must not be greater than the maximum length, otherwise the constructor raises a USER 20 panic.

TInt aMaxLength

The maximum length of the descriptor. This value must be non-negative, otherwise the constructor raises a USER 30 panic.

[Top]


Copying data, replacing existing data


operator=()

TPtr8& operator=(const TDesC8& aDes);
TPtr8& operator=(const TPtr8& aDes);
TPtr8& operator=(const TUint8* aString);

Description

Copies data into this 8 bit modifiable pointer 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 whose data is to be copied into this descriptor. The length of the data cannot be greater than the maximum length of this descriptor otherwise the function raises a USER 23 panic.

const TPtr8& aDes

An 8 bit modifiable pointer descriptor whose data is to be copied into this descriptor. The length of the data cannot be greater than the maximum length of this 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 this descriptor, otherwise the function raises a USER 23 panic.

Return value

TPtr8&

A reference to this 8 bit modifiable pointer descriptor