Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members  

opp_string Class Reference

#include <util.h>

List of all members.

Public Methods

 opp_string ()
 opp_string (const char *s)
 opp_string (opp_string &s)
 ~opp_string ()
 operator const char * () const
char* buffer () const
char* allocate (unsigned size)
const char* operator= (const char *s)
opp_string& operator= (const opp_string &s)


Detailed Description

Very simple string class. opp_string has only one data member, a char* pointer. Allocation/deallocation of the contents takes place via opp_strdup() and operator delete

Recommended use: as class member, where otherwise the class members would have to call opp_strdup() and delete for the char* member.


Constructor & Destructor Documentation

opp_string::opp_string ( ) [inline]
 

Constructor.

opp_string::opp_string ( const char * s ) [inline]
 

Constructor.

opp_string::opp_string ( opp_string & s ) [inline]
 

Copy constructor.

opp_string::~opp_string ( ) [inline]
 

Destructor.


Member Function Documentation

char * opp_string::allocate ( unsigned size ) [inline]
 

Allocates a buffer of the given size.

char * opp_string::buffer ( ) const [inline]
 

Returns pointer to the internal buffer where the string is stored. It is allowed to write into the string via this pointer, but the length of the string should not be exceeded.

opp_string::operator const char * ( ) const [inline]
 

Returns pointer to the string.

opp_string & opp_string::operator= ( const opp_string & s ) [inline]
 

Assignment.

const char * opp_string::operator= ( const char * s ) [inline]
 

Deletes the old value and opp_strdup()'s the new value to create the object's own copy.


The documentation for this class was generated from the following file:
Generated at Mon Jun 16 23:37:33 2003 for OMNeT++ by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001