Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: bamatch.h
Link against: bafl.lib

Class RTextBuf

class RTextBuf;

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

Members

Defined in RTextBuf:
Close(), MaxLength(), RTextBuf(), SetMaxLengthL(), SetText(), Text(), Text(), ~RTextBuf()


Construction and destruction


RTextBuf()

IMPORT_C RTextBuf();

Description

Default constructor.


~RTextBuf()

IMPORT_C ~RTextBuf();

Description

Destructor.

[Top]


Member functions


Text()

inline TPtr &Text();

Description

Gets the text as a descriptor.

Return value

TPtr &

Match text descriptor (non const)


Text()

inline const TPtr &Text() const;

Description

Gets the text as a descriptor.

Return value

const TPtr &

Match text descriptor (const)


MaxLength()

inline TInt MaxLength() const;

Description

Gets the maximum length of the text.

Return value

TInt

The maximum length of the text.


SetText()

inline void SetText(const TDesC &aDes);

Description

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

Parameters

const TDesC &aDes


SetMaxLengthL()

IMPORT_C void SetMaxLengthL(TInt aMaxLength);

Description

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


Close()

IMPORT_C void Close();

Description