RTextBuf Class Reference

class RTextBuf

A simple class that encapsulates a text string.

As with the descriptor classes, the class sets a maximum length for the encapsulated string, which cannot be exceeded. The class might be preferred to a descriptor in some circumstances as its maximum length can be increased (unlike a TBuf ), and it can be created on the stack (unlike an HBufC) .

Public Member Functions
RTextBuf ()
~RTextBuf ()
IMPORT_C void Close ()
TInt MaxLength ()
IMPORT_C void SetMaxLengthL ( TInt )
void SetText (const TDesC &)
TPtr & Text ()
const TPtr & Text ()
Private Attributes
TPtr iPtr
TText * iText

Constructor & Destructor Documentation

RTextBuf()

IMPORT_C RTextBuf ( )

Default constructor.

~RTextBuf()

IMPORT_C ~RTextBuf ( )

Destructor.

Member Functions Documentation

Close()

IMPORT_C void Close ( )

MaxLength()

TInt MaxLength ( ) const [inline]

Gets the maximum length of the text.

SetMaxLengthL(TInt)

IMPORT_C void SetMaxLengthL ( TInt aMaxLength )

Sets the maximum length of the text that the object can store.

Attempts to store text beyond the maximum length cause a panic, as with descriptors.

Parameters

TInt aMaxLength

SetText(const TDesC &)

void SetText ( const TDesC & aDes ) [inline]

Sets the text. You must have set the maximum length appropriately first with SetMaxLengthL() .

Parameters

const TDesC & aDes

Text()

TPtr & Text ( ) [inline]

Gets the text as a descriptor.

Text()

const TPtr & Text ( ) const [inline]

Gets the text as a descriptor.

Member Data Documentation

TPtr iPtr

TPtr iPtr [private]

TText * iText

TText * iText [private]