TUnicodeTextStorage Class Reference

Manages storage for dynamic array of unicode characters. More...

#include <TUnicodeTextStorage.h>

List of all members.

Public Member Functions

 TUnicodeTextStorage ()
 Default constructor;.
virtual ~TUnicodeTextStorage ()
 Disposes of the text storage buffer.
bool ReserveSpace (uint32_t totalCount)
 If this routine returns true, then you can be assured that there is room in the buffer for totalCount number of characters.
unsigned Count () const
 Returns the number of characters actually in the buffer.
Setters
void SetString (CFStringRef text)
 Sets the characters in the buffer.
void SetText (const UniChar *text, uint32_t count)
 Sets.
Getters
CFStringRef GetString ()
const UniChar * GetText ()
Operators
TUnicodeTextStorageoperator= (CFStringRef text)
 operator CFStringRef ()
 operator UniChar * ()
 operator const UniChar * ()
UniChar & operator[] (int index)
Edit operations
void Delete (uint32_t start, uint32_t count=1)
 Delets.
void InsertString (uint32_t position, CFStringRef text)
 Inserts the given CFStringRef.
void InsertText (uint32_t position, const UniChar *text, uint32_t count)
 Inserts the given text before the character at position.
void AppendString (CFStringRef text)
void AppendText (const UniChar *text, uint32_t count)

Protected Member Functions

void Allocate (uint32_t characters)
 Internal method to allocat or reallocate the buffer.

Protected Attributes

UniChar * mStorage
 The buffer where characters are stored.
uint32_t mCount
 Actual number of characters in storage buffer.
uint32_t mSize
 Total number of characters that have been allocated.


Detailed Description

Manages storage for dynamic array of unicode characters.


Constructor & Destructor Documentation

TUnicodeTextStorage::TUnicodeTextStorage  ) 
 

Default constructor;.

TUnicodeTextStorage::~TUnicodeTextStorage  )  [virtual]
 

Disposes of the text storage buffer.


Member Function Documentation

void TUnicodeTextStorage::Allocate uint32_t  characters  )  [protected]
 

Internal method to allocat or reallocate the buffer.

The number of characters can be less than the current number of characters in the buffer, in which case they are truncated.

void TUnicodeTextStorage::AppendString CFStringRef  text  )  [inline]
 

void TUnicodeTextStorage::AppendText const UniChar *  text,
uint32_t  count
[inline]
 

unsigned TUnicodeTextStorage::Count  )  const [inline]
 

Returns the number of characters actually in the buffer.

void TUnicodeTextStorage::Delete uint32_t  start,
uint32_t  count = 1
 

Delets.

CFStringRef TUnicodeTextStorage::GetString  ) 
 

const UniChar* TUnicodeTextStorage::GetText  )  [inline]
 

void TUnicodeTextStorage::InsertString uint32_t  position,
CFStringRef  text
 

Inserts the given CFStringRef.

See also:
InsertText()

void TUnicodeTextStorage::InsertText uint32_t  position,
const UniChar *  text,
uint32_t  count
 

Inserts the given text before the character at position.

So to append text, position must equal the current number of characters, the value returned by Count().

TUnicodeTextStorage::operator CFStringRef  )  [inline]
 

TUnicodeTextStorage::operator const UniChar *  )  [inline]
 

TUnicodeTextStorage::operator UniChar *  )  [inline]
 

TUnicodeTextStorage& TUnicodeTextStorage::operator= CFStringRef  text  )  [inline]
 

UniChar& TUnicodeTextStorage::operator[] int  index  )  [inline]
 

bool TUnicodeTextStorage::ReserveSpace uint32_t  totalCount  ) 
 

If this routine returns true, then you can be assured that there is room in the buffer for totalCount number of characters.

The previous contents of the buffer will be preserved. If totalCount is smaller than the current number of characters in the buffer, the contents will be truncated.

void TUnicodeTextStorage::SetString CFStringRef  text  ) 
 

Sets the characters in the buffer.

Writes over any previous buffer contents; no data is preserved.

void TUnicodeTextStorage::SetText const UniChar *  text,
uint32_t  count
 

Sets.


Member Data Documentation

uint32_t TUnicodeTextStorage::mCount [protected]
 

Actual number of characters in storage buffer.

uint32_t TUnicodeTextStorage::mSize [protected]
 

Total number of characters that have been allocated.

UniChar* TUnicodeTextStorage::mStorage [protected]
 

The buffer where characters are stored.


The documentation for this class was generated from the following files:




Generated on Sat Jul 8 13:11:09 2006 for AUGUI Framework by doxygen1.4.6

hosted on SourceForge.net Logo