RTextBuf Class Reference

#include <bamatch.h>

Link against: bafl.lib

class RTextBuf
Public Member Functions
RTextBuf()
~RTextBuf()
IMPORT_C voidClose()
TInt MaxLength()
IMPORT_C voidSetMaxLengthL(TInt)
voidSetText(const TDesC &)
TPtr &Text()
const TPtr &Text()

Detailed Description

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

Constructor & Destructor Documentation

RTextBuf ( )

IMPORT_CRTextBuf()

Default constructor.

~RTextBuf ( )

IMPORT_C~RTextBuf()

Destructor.

Member Function Documentation

Close ( )

IMPORT_C voidClose()

MaxLength ( )

TInt MaxLength()const [inline]

Gets the maximum length of the text.

Returns: The maximum length of the text.

SetMaxLengthL ( TInt )

IMPORT_C voidSetMaxLengthL(TIntaMaxLength)

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.

SetText ( const TDesC & )

voidSetText(const TDesC &aDes)[inline]

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

Text ( )

TPtr &Text()[inline]

Gets the text as a descriptor.

Returns: Match text descriptor (non const)

Text ( )

const TPtr &Text()const [inline]

Gets the text as a descriptor.

Returns: Match text descriptor (const)