ucommon

stringbuf< S > Class Template Reference

A string class that has a predefined string buffer. More...

#include <string.h>

Inheritance diagram for stringbuf< S >:
Collaboration diagram for stringbuf< S >:

Public Member Functions

void operator= (const char *text)
 Assign a string buffer from a null terminated string.
void operator= (string &object)
 Assign a string buffer from another string object.
 stringbuf ()
 Create an empty instance of a string buffer.
 stringbuf (const char *text)
 Create a string buffer from a null terminated string.

Detailed Description

template<strsize_t S>
class stringbuf< S >

A string class that has a predefined string buffer.

The string class and buffer are allocated together as one object. This allows one to use string objects entirely resident on the local stack as well as on the heap. Using a string class on the local stack may be more convenient than a char array since one can use all the features of the class including assignment and concatenation which a char buffer cannot as easily do.

Author:
David Sugar <dyfet@gnutelephony.org>
Examples:

string.cpp.

Definition at line 1550 of file string.h.


Constructor & Destructor Documentation

template<strsize_t S>
stringbuf< S >::stringbuf ( const char *  text) [inline]

Create a string buffer from a null terminated string.

Parameters:
textto place in object.

Definition at line 1565 of file string.h.


Member Function Documentation

template<strsize_t S>
void stringbuf< S >::operator= ( const char *  text) [inline]

Assign a string buffer from a null terminated string.

Parameters:
textto assign to object.

Reimplemented from memstring.

Definition at line 1571 of file string.h.

template<strsize_t S>
void stringbuf< S >::operator= ( string object) [inline]

Assign a string buffer from another string object.

Parameters:
objectto assign from.

Reimplemented from memstring.

Definition at line 1578 of file string.h.


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