Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

skAsciiStringBuffer Class Reference

This class provides an expandable buffer for textual characters. More...

#include <skAsciiStringBuffer.h>

List of all members.

Public Member Functions

 skAsciiStringBuffer (USize capacity, USize growth_increment=16)
 Constructs a blank buffer of the given capacity.

 skAsciiStringBuffer (const skAsciiString &s, USize growth_increment=16)
 Constructs a buffer from the given string.

 skAsciiStringBuffer (const skAsciiStringBuffer &s)
 Copy constructor - it takes a copy of the underlying buffer.

virtual ~skAsciiStringBuffer ()
 Destroys the underlying character buffer.

skAsciiStringBuffer & operator= (const skAsciiStringBuffer &s)
 Assignment operator - it takes a copy of the underlying buffer.

void append (char ch)
 Adds a character to the buffer, growing it if necessary.

void append (const skAsciiString &s)
 Adds a string to the buffer, growing it if necessary.

void append (const char *s)
 Adds a string to the buffer, growing it if necessary.

skAsciiString toString ()
 Creates a new string that owns the underlying buffer.

skAsciiString toStringCopy () const
 Creates a new string that copies the underlying buffer.

 operator const char * () const
 Returns the underlying buffer.

USize length () const
 Returns the current length of the text in the buffer.

USize capacity () const
 Returns the current capacity the buffer.


Detailed Description

This class provides an expandable buffer for textual characters.


Constructor & Destructor Documentation

skAsciiStringBuffer::skAsciiStringBuffer USize  capacity,
USize  growth_increment = 16
 

Constructs a blank buffer of the given capacity.

The buffer's length will be zero.

Parameters:
capacity - the capacity of the buffer to create. This can be zero
growth_increment - the minimum amount to grow the buffer by if it is enlarged

skAsciiStringBuffer::skAsciiStringBuffer const skAsciiString s,
USize  growth_increment = 16
 

Constructs a buffer from the given string.

The string's data will be copied. The buffer's initial capacity and length will be the length of the string.

Remarks:
not available in Symbian version
Parameters:
s - the string to copy
growth_increment - the minimum amount to grow the buffer by if it is enlarged

skAsciiStringBuffer::skAsciiStringBuffer const skAsciiStringBuffer &  s  ) 
 

Copy constructor - it takes a copy of the underlying buffer.

Remarks:
not available in Symbian version
Parameters:
s - the other string buffer. A copy is taken of its underlying buffer


Member Function Documentation

void skAsciiStringBuffer::append const char *  s  ) 
 

Adds a string to the buffer, growing it if necessary.

Parameters:
s - the string to append to the end of the current buffer
Exceptions:
Symbian - a leaving function

void skAsciiStringBuffer::append const skAsciiString s  ) 
 

Adds a string to the buffer, growing it if necessary.

Parameters:
s - the string to append to the end of the current buffer
Exceptions:
Symbian - a leaving function

void skAsciiStringBuffer::append char  ch  ) 
 

Adds a character to the buffer, growing it if necessary.

Parameters:
ch - the character to add
Exceptions:
Symbian - a leaving function

USize skAsciiStringBuffer::capacity  )  const
 

Returns the current capacity the buffer.

Returns:
the capacity of the buffer

USize skAsciiStringBuffer::length  )  const
 

Returns the current length of the text in the buffer.

Returns:
the length of the text in the buffer

skAsciiStringBuffer::operator const char *  )  const
 

Returns the underlying buffer.

Returns:
a pointer to the underlying buffer

skAsciiStringBuffer & skAsciiStringBuffer::operator= const skAsciiStringBuffer &  s  ) 
 

Assignment operator - it takes a copy of the underlying buffer.

Parameters:
s - the other string buffer. A copy is taken of its underlying buffer

skAsciiString skAsciiStringBuffer::toString  ) 
 

Creates a new string that owns the underlying buffer.

The current buffer is set to null.

Returns:
a string which owns the current buffer
Exceptions:
Symbian - a leaving function

skAsciiString skAsciiStringBuffer::toStringCopy  )  const
 

Creates a new string that copies the underlying buffer.

The current buffer remains the same

Returns:
a string which copies the current buffer
Exceptions:
Symbian - a leaving function


The documentation for this class was generated from the following files:
Generated on Fri Dec 17 20:27:34 2004 for Simkin by doxygen1.3