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

skStringBuffer Class Reference

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

#include <skStringBuffer.h>

Inheritance diagram for skStringBuffer:

List of all members.

Public Member Functions

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

virtual IMPORT_C ~skStringBuffer ()
 Destroys the underlying character buffer.

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

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

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

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

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

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

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

TPtrC ptr () const
 Accesses underlying buffer.

void reset ()
 Resets the length of the buffer to zero.

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

skStringBuffer::skStringBuffer USize  capacity,
USize  growth_increment = 16
[inline]
 

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


Member Function Documentation

IMPORT_C void skStringBuffer::append const TDesC &  s  ) 
 

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

Remarks:
only available in Symbian version
Parameters:
s - the string to append to the end of the current buffer
Exceptions:
Symbian - a leaving function

IMPORT_C void skStringBuffer::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

IMPORT_C void skStringBuffer::append const skString 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

IMPORT_C void skStringBuffer::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 skStringBuffer::capacity  )  const [inline]
 

Returns the current capacity the buffer.

Returns:
the capacity of the buffer

USize skStringBuffer::length  )  const [inline]
 

Returns the current length of the text in the buffer.

Returns:
the length of the text in the buffer

IMPORT_C skStringBuffer& skStringBuffer::operator= const skStringBuffer &  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
Exceptions:
Symbian - a leaving function

TPtrC skStringBuffer::ptr  )  const [inline]
 

Accesses underlying buffer.

Remarks:
only available in Symbian version
Returns:
a pointer to the buffer contained within the StringBuffer object

IMPORT_C skString skStringBuffer::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

IMPORT_C skString skStringBuffer::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 file:
Generated on Fri Dec 17 20:28:27 2004 for Simkin C++ for Symbian by doxygen1.3