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

CString.h File Reference

Portable implementation of CString. More...

#include "config.h"
#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>

Go to the source code of this file.

Compounds

class  CString_
 CString. More...


Defines

#define CString   CString_
 Define CString to be CString_. More...

#define CSTR_WASTE_LIMIT   32
 Over-allocate by this many bytes. More...

#define CSTR_REUSE_ALLOC   16
 Keep this number of prior allocations. More...


Typedefs

typedef void (* CSTRING_CRIT )(void *hLock, bool setLock)
 Prototype for locking functions. More...


Functions

void CString_init (void *hLock=NULL, CSTRING_CRIT locker=NULL)
 Initialize CString_ support. More...

void CString_term ()
 Terminate CString_ support. More...

bool operator== (const CString_ &s1, const CString_ &s2)
 Compare helpers. More...

bool operator== (const CString_ &s1, const char *s2)
 Compare helpers. More...

bool operator== (const char *s1, const CString_ &s2)
 Compare helpers. More...

bool operator!= (const CString_ &s1, const CString_ &s2)
 Compare helpers. More...

bool operator!= (const CString_ &s1, const char *s2)
 Compare helpers. More...

bool operator!= (const char *s1, const CString_ &s2)
 Compare helpers. More...

bool operator< (const CString_ &s1, const CString_ &s2)
 Compare helpers. More...

bool operator< (const CString_ &s1, const char *s2)
 Compare helpers. More...

bool operator< (const char *s1, const CString_ &s2)
 Compare helpers. More...

bool operator> (const CString_ &s1, const CString_ &s2)
 Compare helpers. More...

bool operator> (const CString_ &s1, const char *s2)
 Compare helpers. More...

bool operator> (const char *s1, const CString_ &s2)
 Compare helpers. More...

bool operator<= (const CString_ &s1, const CString_ &s2)
 Compare helpers. More...

bool operator<= (const CString_ &s1, const char *s2)
 Compare helpers. More...

bool operator<= (const char *s1, const CString_ &s2)
 Compare helpers. More...

bool operator>= (const CString_ &s1, const CString_ &s2)
 Compare helpers. More...

bool operator>= (const CString_ &s1, const char *s2)
 Compare helpers. More...

bool operator>= (const char *s1, const CString_ &s2)
 Compare helpers. More...


Detailed Description

Portable implementation of CString.


Define Documentation

#define CSTR_REUSE_ALLOC   16
 

Keep this number of prior allocations.

#define CSTR_WASTE_LIMIT   32
 

Over-allocate by this many bytes.

#define CString   CString_
 

Define CString to be CString_.


Typedef Documentation

typedef void(* CSTRING_CRIT)(void *hLock, bool setLock)
 

Prototype for locking functions.

If you pass a non-NULL pointer to a function of the above type to CString_init() the CString library will call it with the supplied lock handle and the setLock parameter to indicate whether to lock or to unlock. This should implement a "critical section", only one thread may be running after (*locker) (handle, true) has been called until (*locker) (handle, false) is called.

Parameters:
hLock   Whatever handle represents your semaphore.
setLock   True if CString needs to have mutex access, false when it is done.


Function Documentation

void CString_init ( void * hLock = NULL,
CSTRING_CRIT locker = NULL )
 

Initialize CString_ support.

Unlike the MFC version of CString this version must be initialized by making the following call before instantiating any CString object. Also unlike the MFC version, at least the last one we encountered, this version can be easily adapted to be thread-safe with your personal flavor of threads. Don't forget to do any initialization of your thread library BEFORE initializing CString_ support.

void CString_term ( )
 

Terminate CString_ support.

It isn't absolutely necessary to terminate the CString_ support code but if you don't you will have at least one memory leak. Don't forget to do any termination of your thread library AFTER terminating CString_ support.

bool operator!= ( const char * s1,
const CString_ & s2 ) [inline]
 

Compare helpers.

bool operator!= ( const CString_ & s1,
const char * s2 ) [inline]
 

Compare helpers.

bool operator!= ( const CString_ & s1,
const CString_ & s2 ) [inline]
 

Compare helpers.

bool operator< ( const char * s1,
const CString_ & s2 ) [inline]
 

Compare helpers.

bool operator< ( const CString_ & s1,
const char * s2 ) [inline]
 

Compare helpers.

bool operator< ( const CString_ & s1,
const CString_ & s2 ) [inline]
 

Compare helpers.

bool operator<= ( const char * s1,
const CString_ & s2 ) [inline]
 

Compare helpers.

bool operator<= ( const CString_ & s1,
const char * s2 ) [inline]
 

Compare helpers.

bool operator<= ( const CString_ & s1,
const CString_ & s2 ) [inline]
 

Compare helpers.

bool operator== ( const char * s1,
const CString_ & s2 ) [inline]
 

Compare helpers.

bool operator== ( const CString_ & s1,
const char * s2 ) [inline]
 

Compare helpers.

bool operator== ( const CString_ & s1,
const CString_ & s2 ) [inline]
 

Compare helpers.

bool operator> ( const char * s1,
const CString_ & s2 ) [inline]
 

Compare helpers.

bool operator> ( const CString_ & s1,
const char * s2 ) [inline]
 

Compare helpers.

bool operator> ( const CString_ & s1,
const CString_ & s2 ) [inline]
 

Compare helpers.

bool operator>= ( const char * s1,
const CString_ & s2 ) [inline]
 

Compare helpers.

bool operator>= ( const CString_ & s1,
const char * s2 ) [inline]
 

Compare helpers.

bool operator>= ( const CString_ & s1,
const CString_ & s2 ) [inline]
 

Compare helpers.


Generated at Wed Nov 21 11:34:17 2001 for AnyConfig by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001