ucc::memstring Class Reference

A string class that uses a cstring buffer that is fixed in memory. More...

#include <string.h>

Inheritance diagram for ucc::memstring:

Inheritance graph
[legend]
Collaboration diagram for ucc::memstring:

Collaboration graph
[legend]

Public Member Functions

void operator= (string &object)
 Assign the text of a string to our object.
void operator= (char *text)
 Assign null terminated text to our object.
 memstring (void *memory, strsize_t size, char fill=0)
 Create an instance of a memory string.
 ~memstring ()
 Destroy memory string.

Static Public Member Functions

static memstringcreate (strsize_t size, char fill=0)
 Create a memory string with memory allocated from the heap.
static memstringcreate (mempager *pager, strsize_t size, char fill=0)
 Create a memory string with memory allocated from a pager.

Static Public Attributes

static size_t header

Protected Member Functions

cstringc_copy (void)
 Return cstring to use in copy constructors.

Detailed Description

A string class that uses a cstring buffer that is fixed in memory.

This allows one to manipulate a fixed buffer of text in memory through the string class. The size of the memory used must include space for the overhead() size needed for the cstring object control data.

Author:
David Sugar <dyfet@gnutelephony.org>

Definition at line 1423 of file string.h.


Constructor & Destructor Documentation

ucc::memstring::memstring ( void *  memory,
strsize_t  size,
char  fill = 0 
)

Create an instance of a memory string.

Parameters:
memory to use for cstring object.
size of string. Total size must include space for overhead.
fill character for fixed character fields.


Member Function Documentation

cstring* ucc::memstring::c_copy ( void   )  [protected, virtual]

Return cstring to use in copy constructors.

Is virtual for memstring.

Returns:
cstring for copy constructor.

Reimplemented from ucc::string.

static memstring* ucc::memstring::create ( mempager pager,
strsize_t  size,
char  fill = 0 
) [static]

Create a memory string with memory allocated from a pager.

Parameters:
pager to allocate memory from.
size of string to allocate. Automatically adds control size.
fill character for fixed field strings.

static memstring* ucc::memstring::create ( strsize_t  size,
char  fill = 0 
) [static]

Create a memory string with memory allocated from the heap.

Parameters:
size of string to allocate. Automatically adds control size.
fill character for fixed field strings.

Reimplemented from ucc::string.

void ucc::memstring::operator= ( char *  text  )  [inline]

Assign null terminated text to our object.

Parameters:
text to copy.

Reimplemented from ucc::string.

Reimplemented in ucc::stringbuf< S >.

Definition at line 1448 of file string.h.

void ucc::memstring::operator= ( string object  )  [inline]

Assign the text of a string to our object.

Parameters:
object to copy text from.

Reimplemented from ucc::string.

Reimplemented in ucc::stringbuf< S >.

Definition at line 1441 of file string.h.


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

Generated on Tue Jul 28 21:43:34 2009 for UCommon by  doxygen 1.5.9