class String
|
String is a reference counted, copy on write string class
More... |
|
|
Public Methods
Public Members
Detailed Description
String is a reference counted, copy on write string class
NOTE: the void constructor gives a string with a NULL value as
opposed to an empty string. To build an empty String,
use String("").
String (const char* string)
|
String (unsigned int initialBufferSize)
|
String (unsigned int initialBufferSize, const char fill)
|
String (const char* string, unsigned int length)
|
[virtual]
Reimplemented from Hashable.
[const virtual]
Reimplemented from Hashable.
[const virtual]
Reimplemented from Hashable.
unsigned int getLength (bool force = false)
|
[const]
getLength() returns the length of the string (like strlen).
An attempt is made to cache the length of the string,
so the value returned by this method can be wrong if
a writable char* is used to change the string multiple times
combined with multiple uses of getLength(); Calling with
force = true can be used in these cases to ensure the correct value
at the cost of performance.
operator const char* (void)
|
[const]
char* writableCharPtr (void)
|
We can't use operator char*() since it will prevent
operator const char*() from being used most of the time.
Hence, we provide a functional interface for getting a
pointer to the non-const characters.
These two array operators function on logical characters in
the string. These take into account multi-byte issues.
XXX: I don't think that multi-byte is handled.
[const]
bool operator== (const Hashable & other)
|
[const virtual]
Reimplemented from Hashable.
bool operator!= (const Hashable & other)
|
[const virtual]
Reimplemented from Hashable.
bool isSame ( const String& other)
|
[const]
bool operator== (const String& other)
|
[const]
Reimplemented from Hashable.
bool operator!= (const String& other)
|
[const]
Reimplemented from Hashable.
bool operator< (const String& other)
|
[const]
bool operator> (const String& other)
|
[const]
bool operator<= (const String& other)
|
[const]
bool operator>= (const String& other)
|
[const]
bool isSame ( const char* other)
|
[const]
bool operator== (const char* other)
|
[const]
Reimplemented from Hashable.
bool operator!= (const char * other)
|
[const]
Reimplemented from Hashable.
bool operator< (const char * other)
|
[const]
bool operator> (const char * other)
|
[const]
bool operator<= (const char * other)
|
[const]
bool operator>= (const char * other)
|
[const]
[const]
String operator+ (const char* string)
|
[const]
String& operator+= (const char* string)
|
[const]
[const]
[const]
Returns a new string that is a substring of this string. The
substring begins at "startIndex" and extends to the character
index at "endIndex - 1".
long asLong (int base = 10)
|
[const]
[const]
void fromNum ( long num )
|
void fromNum ( double num )
|
A "null" string, as opposed to an empty string. Useful
for methods which return an String& to distinguish
between "no string" and "emtpy string". For example,
const String& str = func();
if (str == String::NUL) no_return_value();
The empty string, encourages string sharing
Generated by: rusty@irem on Mon Sep 18 18:07:52 2000, using kdoc 2.0a36. |