#include <String_Base.h>
Inheritance diagram for ACE_String_Base< CHAR >:
Public Methods | |
ACE_String_Base (ACE_Allocator *the_allocator=0) | |
ACE_String_Base (const CHAR *s, ACE_Allocator *the_allocator=0, int release=1) | |
ACE_String_Base (const CHAR *s, size_t len, ACE_Allocator *the_allocator=0, int release=1) | |
ACE_String_Base (const ACE_String_Base< CHAR > &s) | |
ACE_String_Base (CHAR c, ACE_Allocator *the_allocator=0) | |
ACE_String_Base (size_t len, CHAR c=0, ACE_Allocator *the_allocator=0) | |
~ACE_String_Base (void) | |
const CHAR & | operator[] (size_t slot) const |
CHAR & | operator[] (size_t slot) |
ACE_String_Base< CHAR > & | operator= (const ACE_String_Base< CHAR > &s) |
ACE_String_Base< CHAR > & | assign_nocopy (const ACE_String_Base< CHAR > &s) |
void | set (const CHAR *s, int release=1) |
void | set (const CHAR *s, size_t len, int release) |
void | clear (int release=0) |
ACE_String_Base< CHAR > | substring (size_t offset, ssize_t length=-1) const |
ACE_String_Base< CHAR > | substr (size_t offset, ssize_t length=-1) const |
ACE_String_Base< CHAR > & | operator+= (const ACE_String_Base< CHAR > &s) |
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 |
ssize_t | strstr (const ACE_String_Base< CHAR > &s) const |
ssize_t | find (const ACE_String_Base< CHAR > &str, size_t pos=0) const |
ssize_t | find (const CHAR *s, size_t pos=0) const |
ssize_t | find (CHAR c, size_t pos=0) const |
ssize_t | rfind (CHAR c, ssize_t pos=npos) const |
int | operator== (const ACE_String_Base< CHAR > &s) const |
int | operator< (const ACE_String_Base< CHAR > &s) const |
int | operator> (const ACE_String_Base< CHAR > &s) const |
int | operator!= (const ACE_String_Base< CHAR > &s) const |
int | compare (const ACE_String_Base< CHAR > &s) const |
void | dump (void) const |
void | resize (size_t len, CHAR c=0) |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Protected Attributes | |
ACE_Allocator * | allocator_ |
size_t | len_ |
size_t | buf_len_ |
CHAR * | rep_ |
int | release_ |
Static Protected Attributes | |
CHAR | NULL_String_ = '\0' |
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. NOTE: if an instance of this class is constructed from or assigned an empty string (with first element of '\0'), then it is not allocated new space. Instead, its internal representation is set equal to a global empty string. CAUTION: in cases when ACE_String_Base is constructed from a provided buffer with the release parameter set to 0, ACE_String_Base is not guaranteed to be '\0' terminated.
|
Default constructor.
|
|
Constructor that copies s into dynamically allocated memory. If release is non-0 then the ACE_Allocator is responsible for freeing this memory. Memory is _not_ allocated/freed if release is 0.
|
|
Constructor that copies len CHARs of s into dynamically allocated memory (will zero terminate the result). If release is non-0 then the ACE_allocator is responsible for freeing this memory. Memory is _not_ allocated/freed if release is 0.
|
|
Copy constructor.
|
|
Constructor that copies c into dynamically allocated memory.
|
|
Constructor that dynamically allocate len long of char array and initialize it to c using alloc to allocate the memory.
|
|
Deletes the memory... |
|
Assignment alternative method (does not copy memory).
|
|
Same as STL String's <c_str> and <fast_rep>. |
|
Clear this string. Memory is _not_ freed if <release> is 0.
|
|
Performs a strncmp comparison.
|
|
Dump the state of an object. |
|
Get at the underlying representation directly! _Don't_ even think about casting the result to (char *) and modifying it, if it has length 0!
|
|
Find c starting at pos. Returns the slot of the first location that matches (will be >= pos), else npos.
|
|
Find s starting at pos. Returns the slot of the first location that matches (will be >= pos), else npos.
|
|
Find <str> starting at pos. Returns the slot of the first location that matches (will be >= pos), else npos.
|
|
Returns a hash value for this string.
|
|
Return the length of the string.
|
|
Inequality comparison operator.
|
|
Concat operator (copies memory).
|
|
Less than comparison operator.
|
|
Assignment operator (does copy memory).
|
|
Equality comparison operator (must match entire string).
|
|
Greater than comparison operator.
|
|
Return the <slot'th> character by reference in the string (doesn't perform bounds checking).
|
|
Return the <slot'th> character in the string (doesn't perform bounds checking).
|
|
Get a copy of the underlying representation. This method allocates memory for a copy of the string and returns a pointer to the new area. The caller is responsible for freeing the memory when finished; use delete []
|
|
This method is designed for high-performance. Please use with care ;-) If the current size of the string is less than <len>, the string is resized to the new length. The data is zero'd out after this operation.
|
|
Find c starting at pos (counting from the end). Returns the slot of the first location that matches, else npos.
|
|
Copy len bytes of s (will zero terminate the result). Memory is _not_ allocated/freed if release is 0.
|
|
Copy s into this ACE_String_Base. Memory is _not_ allocated/freed if release is 0.
|
|
Comparison operator that will match substrings. Returns the slot of the first location that matches, else -1.
|
|
Same as <substring>.
|
|
Return a substring given an offset and length, if length == -1 use rest of str. Return empty substring if offset or offset/length are invalid.
|
|
Declare the dynamic allocation hooks. |
|
Pointer to a memory allocator. |
|
Length of the ACE_String_Base data buffer. Keeping track of the length allows to avoid unnecessary dynamic allocations. |
|
Length of the ACE_String_Base data (not counting the trailing '\0'). |
|
Represents the "NULL" string to simplify the internal logic. |
|
Flag that indicates if we own the memory |
|
Pointer to data. |