NAME

ACE_WString - This class provides a wrapper facade for C wide strings.

SYNOPSIS

#include <ace/SString.h>

class ACE_WString { public: 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 slot) const; ACE_USHORT16 &operator [] (size_t slot); 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 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 strlen (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 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. This class is optimized for efficiency, so it doesn't provide any internal locking.

PUBLIC MEMBERS

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 slot) const;

ACE_USHORT16 &operator [] (size_t slot);

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 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 strlen (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