ICU 4.8.1.1  4.8.1.1
Public Member Functions
UnicodeStringAppendable Class Reference

An Appendable implementation which writes to a UnicodeString. More...

#include <appendable.h>

Inheritance diagram for UnicodeStringAppendable:
Appendable UObject UMemory

Public Member Functions

 UnicodeStringAppendable (UnicodeString &s)
 Aliases the UnicodeString (keeps its reference) for writing.
virtual UBool appendCodeUnit (UChar c)
 Appends a 16-bit code unit to the string.
virtual UBool appendCodePoint (UChar32 c)
 Appends a code point to the string.
virtual UBool appendString (const UChar *s, int32_t length)
 Appends a string to the UnicodeString.
virtual UBool reserveAppendCapacity (int32_t appendCapacity)
 Tells the UnicodeString that the caller is going to append roughly appendCapacity UChars.
virtual UChargetAppendBuffer (int32_t minCapacity, int32_t desiredCapacityHint, UChar *scratch, int32_t scratchCapacity, int32_t *resultCapacity)
 Returns a writable buffer for appending and writes the buffer's capacity to *resultCapacity.

Detailed Description

An Appendable implementation which writes to a UnicodeString.

This class is not intended for public subclassing.

Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Definition at line 149 of file appendable.h.


Constructor & Destructor Documentation

Aliases the UnicodeString (keeps its reference) for writing.

Parameters:
sThe UnicodeString to which this Appendable will write.
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Definition at line 156 of file appendable.h.


Member Function Documentation

Appends a code point to the string.

Parameters:
ccode point 0..0x10ffff
Returns:
TRUE if the operation succeeded
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Reimplemented from Appendable.

Appends a 16-bit code unit to the string.

Parameters:
ccode unit
Returns:
TRUE if the operation succeeded
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Implements Appendable.

virtual UBool UnicodeStringAppendable::appendString ( const UChar s,
int32_t  length 
) [virtual]

Appends a string to the UnicodeString.

Parameters:
sstring, must not be NULL if length!=0
lengthstring length, or -1 if NUL-terminated
Returns:
TRUE if the operation succeeded
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Reimplemented from Appendable.

virtual UChar* UnicodeStringAppendable::getAppendBuffer ( int32_t  minCapacity,
int32_t  desiredCapacityHint,
UChar scratch,
int32_t  scratchCapacity,
int32_t resultCapacity 
) [virtual]

Returns a writable buffer for appending and writes the buffer's capacity to *resultCapacity.

Guarantees *resultCapacity>=minCapacity. May return a pointer to the caller-owned scratch buffer which must have scratchCapacity>=minCapacity. The returned buffer is only valid until the next write operation on the UnicodeString.

For details see Appendable::getAppendBuffer().

Parameters:
minCapacityrequired minimum capacity of the returned buffer; must be non-negative
desiredCapacityHintdesired capacity of the returned buffer; must be non-negative
scratchdefault caller-owned buffer
scratchCapacitycapacity of the scratch buffer
resultCapacitypointer to an integer which will be set to the capacity of the returned buffer
Returns:
a buffer with *resultCapacity>=minCapacity
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Reimplemented from Appendable.

virtual UBool UnicodeStringAppendable::reserveAppendCapacity ( int32_t  appendCapacity) [virtual]

Tells the UnicodeString that the caller is going to append roughly appendCapacity UChars.

Parameters:
appendCapacityestimated number of UChars that will be appended
Returns:
TRUE if the operation succeeded
Draft:
This API may be changed in the future versions and was introduced in ICU 4.8

Reimplemented from Appendable.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines