#include <ace/SString.h>
class ACE_CString {
public:
friend ACE_Export ACE_CString operator+ ( const ACE_CString &, const ACE_CString & );
friend ACE_Export ostream &operator<< ( ostream &, const ACE_CString & );
static const int npos;
ACE_CString (ACE_Allocator *alloc = 0);
ACE_CString (const char *s, ACE_Allocator *alloc = 0);
ACE_CString (const char *s, size_t len, ACE_Allocator *alloc = 0);
ACE_CString (const ACE_CString &);
ACE_CString (const ACE_USHORT16 *s, ACE_Allocator *alloc = 0);
ACE_CString (char c, ACE_Allocator *alloc = 0);
~ACE_CString (void);
char operator[] (size_t index) const;
char &operator[] (size_t index);
ACE_CString &operator= (const ACE_CString &);
void set (const char *s);
void set (const char *s, size_t len);
ACE_CString substring (size_t offset, ssize_t length = -1) const;
ACE_CString substr (size_t offset, ssize_t length = -1) const;
ACE_CString &operator+= (const ACE_CString &);
u_long hash (void) const;
size_t length (void) const;
char *rep (void) const;
const char *fast_rep (void) const;
const char *c_str (void) const;
int strstr (const ACE_CString &s) const;
int find (const ACE_CString &str, int pos = 0) const;
int find (const char *s, int pos = 0) const;
int find (char c, int pos = 0) const;
int rfind (char c, int pos = npos) const;
int operator== (const ACE_CString &s) const;
int operator!= (const ACE_CString &s) const;
int compare (const ACE_CString &s) const;
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
private:
ACE_Allocator *allocator_;
size_t len_;
char *rep_;
static char NULL_CString_;
};
friend ACE_Export ACE_CString operator+ (
const ACE_CString &,
const ACE_CString &
);
friend ACE_Export ostream &operator<< (
ostream &,
const ACE_CString &
);
static const int npos;
ACE_CString (ACE_Allocator *alloc = 0);
ACE_CString (const char *s, ACE_Allocator *alloc = 0);
s
into dynamically allocated memory.
ACE_CString (const char *s, size_t len, ACE_Allocator *alloc = 0);
len
chars of s
into dynamically
allocated memory (will NUL terminate the result).
ACE_CString (const ACE_CString &);
ACE_CString (const ACE_USHORT16 *s, ACE_Allocator *alloc = 0);
s
into dynamically allocated memory.
Probable loss of data. Please use with care.
ACE_CString (char c, ACE_Allocator *alloc = 0);
c
into dynamically allocated memory.
~ACE_CString (void);
char operator[] (size_t index) const;
index'th
character in the string (doesn't perform
bounds checking).
char &operator[] (size_t index);
index'th
character by reference in the string
(doesn't perform bounds checking).
ACE_CString &operator= (const ACE_CString &);
void set (const char *s);
s
void set (const char *s, size_t len);
len
bytes of s
(will NUL terminate the result)
ACE_CString substring (size_t offset, ssize_t length = -1) const;
ACE_CString substr (size_t offset, ssize_t length = -1) const;
ACE_CString &operator+= (const ACE_CString &);
u_long hash (void) const;
size_t length (void) const;
char *rep (void) const;
const char *fast_rep (void) const;
const char *c_str (void) const;
int strstr (const ACE_CString &s) const;
int find (const ACE_CString &str, int pos = 0) const;
str
starting at pos. Returns the index of the first
location that matches, else npos.
int find (const char *s, int pos = 0) const;
s
starting at pos. Returns the index of the first
location that matches, else npos.
int find (char c, int pos = 0) const;
c
starting at pos. Returns the index of the first
location that matches, else npos.
int rfind (char c, int pos = npos) const;
c
starting at pos (counting from the end). Returns the
index of the first location that matches, else npos.
int operator== (const ACE_CString &s) const;
int operator!= (const ACE_CString &s) const;
int compare (const ACE_CString &s) const;
strcmp
-style comparison.
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
ACE_Allocator *allocator_;
size_t len_;
char *rep_;
static char NULL_CString_;