#include <EString.h>
Creating or assigning an EString never makes a copy of string data.
This class may be especially useful in conjuction with EStringPool.
Public Member Functions | |
EString () | |
Constructs an empty EString. data() will return a null pointer. | |
EString (const char *data, unsigned int length) | |
Constructs an EString with the given content. | |
EString (const string &str) | |
Constructs an EString with the given content. | |
const char * | data () |
Returns a pointer to the EString's character data. | |
unsigned int | length () |
Returns the length of the EString. | |
string | as_string () const |
Returns the contents of the EString as a string object. | |
int | compare (const EString &other) |
Performs a three-way lexicographical comparison with other. | |
EString | concat (const EString &other, EStringPool &pool) |
Concatenates this EString and other. | |
EString | save (EStringPool &pool) |
Copies this EString into the given pool and returns the resultant EString, which will remain valid until the pool is destroyed or reset. | |
char | operator[] (unsigned int index) const |
Returns the index'th character in the EString. | |
bool | operator== (const EString &other) |
Returns true iff the EStrings' contents are identical. | |
bool | operator!= (const EString &other) |
Returns true iff the EStrings's contents are not identical. | |
bool | operator< (const EString &other) |
Returns true iff this EString's contents are lexicographically less than other's. | |
bool | operator> (const EString &other) |
Returns true iff this EString's contents are lexicographically greater than other's. | |
bool | operator<= (const EString &other) |
Returns true iff this EString's contents are lexicographically less than or equal to other's. | |
bool | operator>= (const EString &other) |
Returns true iff this EString's contents are lexicographically greater than or equal to other's. | |
Static Public Member Functions | |
EString | save (const string &str, EStringPool &pool) |
Copies a string object into the given pool and returns the resultant EString, which will remain valid until the pool is destroyed or reset. | |
EString | coerce (bool b, EStringPool &pool) |
Creates a string representation of an integer in the given pool and returns the resultant EString, which will remain valid until the pool is destroyed or reset. | |
EString | coerce (int32 i, EStringPool &pool) |
Creates a string representation of an integer in the given pool and returns the resultant EString, which will remain valid until the pool is destroyed or reset. | |
EString | coerce (int64 i, EStringPool &pool) |
Creates a string representation of an integer in the given pool and returns the resultant EString, which will remain valid until the pool is destroyed or reset. | |
EString | coerce (single f, EStringPool &pool) |
Creates a string representation of a floating-point value in the given pool and returns the resultant EString, which will remain valid until the pool is destroyed or reset. | |
EString | coerce (double f, EStringPool &pool) |
Creates a string representation of a floating-point value in the given pool and returns the resultant EString, which will remain valid until the pool is destroyed or reset. |
|
Constructs an empty EString. data() will return a null pointer.
|
|
Constructs an EString with the given content. A copy of the data is not maintained, i.e., this EString will become invalid when the data pointer becomes invalid. |
|
Constructs an EString with the given content. A copy of the data is not maintained: this EString will become invalid as soon as the str object is destroyed. |
|
Returns the contents of the EString as a string object. (The string object does make a copy of the EString data.) |
|
Creates a string representation of a floating-point value in the given pool and returns the resultant EString, which will remain valid until the pool is destroyed or reset.
|
|
Creates a string representation of a floating-point value in the given pool and returns the resultant EString, which will remain valid until the pool is destroyed or reset.
|
|
Creates a string representation of an integer in the given pool and returns the resultant EString, which will remain valid until the pool is destroyed or reset.
|
|
Creates a string representation of an integer in the given pool and returns the resultant EString, which will remain valid until the pool is destroyed or reset.
|
|
Creates a string representation of an integer in the given pool and returns the resultant EString, which will remain valid until the pool is destroyed or reset.
|
|
Performs a three-way lexicographical comparison with other. Returns -1 if this EString's contents are less than other's, 0 if the EStrings are equivalent, or 1 if this EString's contents are greater than other's. |
|
Concatenates this EString and other. Copies the concatentation into the given pool and returns the resultant EString. This EString will remain valid until the pool is destroyed or reset. |
|
Returns a pointer to the EString's character data.
|
|
Returns the length of the EString.
|
|
Returns true iff the EStrings's contents are not identical.
|
|
Returns true iff this EString's contents are lexicographically less than other's.
|
|
Returns true iff this EString's contents are lexicographically less than or equal to other's.
|
|
Returns true iff the EStrings' contents are identical.
|
|
Returns true iff this EString's contents are lexicographically greater than other's.
|
|
Returns true iff this EString's contents are lexicographically greater than or equal to other's.
|
|
Returns the index'th character in the EString.
|
|
Copies this EString into the given pool and returns the resultant EString, which will remain valid until the pool is destroyed or reset.
|
|
Copies a string object into the given pool and returns the resultant EString, which will remain valid until the pool is destroyed or reset.
|