Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: bamatch.h
Link against: bafl.lib

Class RTextBuf

RTextBuf

Support

Supported from 5.0

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

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

See also:


Constructors


RTextBuf()

RTextBuf();

Description

Default constructor.


~RTextBuf()

~RTextBuf();

Description

Destructor.

[Top]


Getters


Text()

TPtr& Text();

Description

Gets the text as a descriptor.


Text()

const TPtr& Text() const;

Description

Gets the text as a constant descriptor.


MaxLength()

TInt MaxLength() const;

Description

Gets the maximum length of the text.

[Top]


Setters


SetText()

void SetText(const TDesC &aDes);

Description

Sets the text.

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


SetMaxLengthL()

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.