NAME

ACE_WString - A persistent wide string class.

SYNOPSIS

#include <ace/SString.h>

class ACE_WString { public: friend ACE_Export ACE_WString operator+ ( const ACE_WString &, const ACE_WString & ); static const int npos; ACE_WString (ACE_Allocator *alloc = 0); ACE_WString (const char *s, ACE_Allocator *alloc = 0); ACE_WString (const ACE_USHORT16 *s, ACE_Allocator *alloc = 0); ACE_WString ( const ACE_USHORT16 *s, size_t len, ACE_Allocator *alloc = 0 ); ACE_WString (size_t len, ACE_Allocator *alloc = 0); ACE_WString (const ACE_WString &s); ACE_WString (ACE_USHORT16 c, ACE_Allocator *alloc = 0); ~ACE_WString (void); ACE_USHORT16 operator[] (size_t index) const; ACE_USHORT16 &operator[] (size_t index); ACE_WString &operator= (const ACE_WString &); void set (const ACE_USHORT16 *s); void set (const ACE_USHORT16 *s, size_t len); ACE_WString substring (size_t offset, ssize_t length = -1) const; ACE_WString substr (size_t offset, ssize_t length = -1) const; ACE_WString &operator+= (const ACE_WString &); u_long hash (void) const; size_t length (void) const; ACE_USHORT16 *rep (void) const; char *char_rep (void) const; const ACE_USHORT16 *fast_rep (void) const; const ACE_USHORT16 *c_str (void) const; int strstr (const ACE_WString &s) const; int find (const ACE_WString &str, int pos = 0) const; int find (const ACE_USHORT16 *s, int pos = 0) const; int find (ACE_USHORT16 c, int pos = 0) const; int rfind (ACE_USHORT16 c, int pos = npos) const; int operator== (const ACE_WString &s) const; int operator!= (const ACE_WString &s) const; int compare (const ACE_WString &s) const; void dump (void) const; ACE_ALLOC_HOOK_DECLARE; static size_t wstrlen (const ACE_USHORT16 *); static const ACE_USHORT16 *strstr ( const ACE_USHORT16 *s1, const ACE_USHORT16 *s2 ); void resize (size_t len); private: ACE_Allocator *allocator_; size_t len_; ACE_USHORT16 *rep_; };

DESCRIPTION

This is *not* a general-purpose string class. It is only intended for use with applications that understand how it works. Note that we need to use this class since the ACE ACE_Map_Manager requires an object that supports the operator== and operator!=. This class uses an ACE_Allocator to allocate memory The user can make this a persistant class by providing an ACE_Allocator with a persistable memory pool

PUBLIC MEMBERS

friend ACE_Export ACE_WString operator+ (
    const ACE_WString &,
    const ACE_WString &
    );

static const int npos;

ACE_WString (ACE_Allocator *alloc = 0);

ACE_WString (const char *s, ACE_Allocator *alloc = 0);

ACE_WString (const ACE_USHORT16 *s, ACE_Allocator *alloc = 0);

ACE_WString (
    const ACE_USHORT16 *s,
    size_t len,
    ACE_Allocator *alloc = 0
    );

ACE_WString (size_t len, ACE_Allocator *alloc = 0);

ACE_WString (const ACE_WString &s);

ACE_WString (ACE_USHORT16 c, ACE_Allocator *alloc = 0);

~ACE_WString (void);

ACE_USHORT16 operator[] (size_t index) const;

ACE_USHORT16 &operator[] (size_t index);

ACE_WString &operator= (const ACE_WString &);

void set (const ACE_USHORT16 *s);

void set (const ACE_USHORT16 *s, size_t len);

ACE_WString substring (size_t offset, ssize_t length = -1) const;

ACE_WString substr (size_t offset, ssize_t length = -1) const;

ACE_WString &operator+= (const ACE_WString &);

u_long hash (void) const;

size_t length (void) const;

ACE_USHORT16 *rep (void) const;

char *char_rep (void) const;

const ACE_USHORT16 *fast_rep (void) const;

const ACE_USHORT16 *c_str (void) const;

int strstr (const ACE_WString &s) const;

int find (const ACE_WString &str, int pos = 0) const;

int find (const ACE_USHORT16 *s, int pos = 0) const;

int find (ACE_USHORT16 c, int pos = 0) const;

int rfind (ACE_USHORT16 c, int pos = npos) const;

int operator== (const ACE_WString &s) const;

int operator!= (const ACE_WString &s) const;

int compare (const ACE_WString &s) const;

void dump (void) const;

ACE_ALLOC_HOOK_DECLARE;

static size_t wstrlen (const ACE_USHORT16 *);

static const ACE_USHORT16 *strstr (
    const ACE_USHORT16 *s1,
    const ACE_USHORT16 *s2
    );

void resize (size_t len);

PRIVATE MEMBERS

ACE_Allocator *allocator_;

size_t len_;

ACE_USHORT16 *rep_;

AUTHOR

Douglas C. Schmidt (schmidt@cs.wustl.edu)

LIBRARY

ace