#include <ustring.hpp>
Inheritance diagram for ufo::UString:
Public Member Functions | |
UString (char *str) | |
UString (const char *str) | |
UString (const std::string &str) | |
bool | operator== (UString &str) const |
bool | operator== (const UString &str) const |
bool | operator== (const std::string &str) const |
UString & | operator= (char *str) |
UString & | operator= (const char *str) |
UString & | operator= (const std::string &str) |
operator std::string () const | |
const std::string & | str () const |
std::string & | str () |
const char * | c_str () const |
void | detach () |
std::vector< std::string > | tokenize (char delimiter) const |
UString | upperCase () const |
UString | lowerCase () const |
virtual unsigned int | hashCode () const |
virtual bool | equals (const UString *str) const |
virtual bool | equals (const UObject *obj) const |
virtual std::string | toString () const |
virtual UObject * | clone () const |
Static Public Member Functions | |
template<typename TYPE> std::string | toString (const TYPE &t) |
int | toInt (const std::string &str) |
unsigned int | toUnsignedInt (const std::string &str) |
double | toDouble (const std::string &str) |
unsigned int | hash (const char *cstr) |
Protected Member Functions | |
virtual std::ostream & | paramString (std::ostream &os) const |
Uses implicit data sharing. Implements some usefule functions like toString(Type & T), tokenize(), unsigned int hash(const char*), etc.
|
Returns a const char pointer to the shared string object. |
|
tries to make a new object with the same internal data. Reimplemented from ufo::UObject.
|
|
Creates a local copy of the shared string. |
|
checks if this object is the same object than obj Reimplemented from ufo::UObject.
|
|
checks if this object is the same object than obj |
|
Computes a hash value using horner's rule. |
|
returns a std::size_t which is used when UObject pointers are the keys for UHashMap. If equals(UObject*) returns true, these two objects should return the same hash code. If these objects are different, the hash code may be equal.
Reimplemented from ufo::UObject.
|
|
Returns a new string with all characters in lower case. |
|
Prints some useful internal data to the ostream os. This method is meant only for debugging purposes. Reimplemented from ufo::UObject.
|
|
Returns a reference to the internal string. Be careful, this changes the internal string for all UString objects which are using the shared string. Use detach() if you want to modify only this UString object. This string should not be stored as it may be invalid when the UString objet gets out of scope.
|
|
Returns a const ref to the internal string. This string should not be stored as it may be invalid when the UString objet gets out of scope. |
|
The string is cut at every occurence of the character delimiter. The resulting array of strings (without delimiter) is returned.
|
|
Returns only the string Reimplemented from ufo::UObject.
|
|
returns a string representation of the given type |
|
Returns a new string with all characters in upper case. |