String class with char character type.
More...
Public Types | |
| typedef char | value_type |
| Character type. More... |
|
| typedef Size | size_type |
| Size type. More... |
|
| typedef Difference | difference_type |
| Difference type. More... |
|
| typedef char & | reference |
| Reference type. More... |
|
| typedef const char & | const_reference |
| Const-reference type. More... |
|
| typedef char * | pointer |
| Pointer type. More... |
|
| typedef const char * | const_pointer |
| Const-pointer type. More... |
|
| typedef pointer | iterator |
| Random-access iterator type. More... |
|
| typedef const_pointer | const_iterator |
| Random-access const-iterator type. More... |
|
Public Member Functions | |
| String () | |
| Default constructor initializes to the empty string. More... |
|
| String (const char *str) | |
Constructor that copies the string str. More... |
|
| String (const String &str) | |
Copy constructor that copies the string str. More... |
|
| String & | operator= (const String &str) |
Assignment, assign str to this string. More... |
|
| ~String () | |
| Destructor. More... |
|
| bool | empty () const |
Returns true if this string is empty. More... |
|
| Size | size () const |
Returns the number of characters in the string (excluding the '\0' terminator) More... |
|
| Size | length () const |
Returns the number of characters in the string (excluding the '\0' terminator) More... |
|
| const char * | c_str () const |
| Returns a non-null pointer to the C-style terminated string representation of this string. More... |
|
| const char & | operator[] (Size i) const |
Returns the i-th character of the string. More... |
|
| char & | operator[] (Size i) |
Returns the i-th character of the string. More... |
|
| String & | operator+= (const String &str) |
Appends str to this string. More... |
|
Static Public Attributes | |
| static const Size | npos = Size(-1) |
| Null position. More... |
|
| static const Size | SHORT_SIZE = 24 |
Maximum length of strings (including trailing '\0' ) stored without additional dynamic memory allocation. More... |
|
String class with char character type.
The string class provides basic construction and conversion from and to const char* C-type strings and concatenation. The operations provided follow the definition for a std::string class.
The string class contains an optimization for short strings. It does not contain optimizations for copying strings, such as reference counting.
Random-access const-iterator type.
| typedef const char* mi::base::String::const_pointer |
Const-pointer type.
| typedef const char& mi::base::String::const_reference |
Const-reference type.
Difference type.
| typedef pointer mi::base::String::iterator |
Random-access iterator type.
| typedef char* mi::base::String::pointer |
Pointer type.
| typedef char& mi::base::String::reference |
Reference type.
| typedef Size mi::base::String::size_type |
Size type.
| typedef char mi::base::String::value_type |
Character type.
|
inline |
Default constructor initializes to the empty string.
|
inline |
Constructor that copies the string str.
|
inline |
Copy constructor that copies the string str.
|
inline |
Destructor.
|
inline |
Returns a non-null pointer to the C-style terminated string representation of this string.
|
inline |
Returns true if this string is empty.
A string is empty if size()==0 .
|
inline |
Returns the number of characters in the string (excluding the '\0' terminator)
Assignment, assign str to this string.
|
inline |
|
inline |
|
inline |
Returns the number of characters in the string (excluding the '\0' terminator)
|
static |
Maximum length of strings (including trailing '\0' ) stored without additional dynamic memory allocation.