String is a thread safe wrapper around std::string that uses implicit sharing. More...
#include <acedia_string.hpp>
Public Member Functions | |
| String () | |
| Creates an empty string. | |
| String (const String &other) | |
Creates a string that's a copy of other. | |
| String (const std::string &str) | |
Creates a string that's a copy of str. | |
| String (const char *cstr) | |
Creates a string that's a copy of cstr. | |
| String (const char *cstr,::size_t n) | |
Creates a string from the first n character from cstr. | |
| ::size_t | length () const |
| Return length of string. | |
| inline::size_t | size () const |
| Return length of string (alias of length). | |
| const char & | operator[] (::size_t pos) const |
| const char & | at (::size_t pos) const |
| const char * | c_str () const |
| bool | empty () const |
| Test if string is empty. | |
| const std::string & | const_str () const |
| Get this string as a const std::string &. | |
| bool | operator< (const String &other) const |
| Implicit conversion operator to std::string &. | |
| const_iterator | begin () const |
| const_iterator | end () const |
| String & | operator= (const String &other) |
| Assignment operator. | |
| bool | operator== (const String &other) const |
Test if this string is equal other. | |
| bool | operator!= (const String &other) const |
Test if this string is not equal other. | |
| String & | append (const String &str) |
Append str to this string. | |
| String & | append (const String &str,::size_t pos,::size_t n) |
Append a substring of str to this string. | |
| String & | append (char c) |
Append c to this string. | |
| String & | append (const char *cstr) |
Append cstr to this string. | |
| String & | append (const char *cstr,::size_t n) |
Append the first n characters of cstr to this string. | |
| String & | append (const std::string &str) |
Append str to this string. | |
| String & | operator+= (const String &str) |
Append str to this string. | |
| String & | operator+= (const char *cstr) |
Append cstr to this string. | |
| String & | operator+= (char c) |
Append c to this string. | |
| void | serialize (boost::archive::text_oarchive &ar, const unsigned int unused) const |
Serialize string to ar. | |
| void | serialize (boost::archive::text_iarchive &ar, const unsigned int unused) |
Deserialize string from ar. | |
| void | reserve (::size_t n) |
Reserve at least n bytes. | |
| bool | startsWith (const char *cString) const |
Check if this strings starts with cString. | |
| bool | startsWith (const String &str) const |
Check if this strings starts with str. | |
String is a thread safe wrapper around std::string that uses implicit sharing.
Definition at line 49 of file acedia_string.hpp.
| acedia::String::String | ( | const String & | other | ) |
Creates a string that's a copy of other.
This constructor does not cause a deep copy, because String is implicit shared.
Definition at line 127 of file acedia_string.cpp.
| const char& acedia::String::at | ( | ::size_t | pos | ) | const [inline] |
Definition at line 109 of file acedia_string.hpp.
| std::string::const_iterator acedia::String::begin | ( | ) | const |
Definition at line 153 of file acedia_string.cpp.
| const char * acedia::String::c_str | ( | ) | const |
Definition at line 149 of file acedia_string.cpp.
| std::string::const_iterator acedia::String::end | ( | ) | const |
Definition at line 158 of file acedia_string.cpp.
| const char & acedia::String::operator[] | ( | ::size_t | pos | ) | const |
Definition at line 147 of file acedia_string.cpp.
1.6.2