The Zorba string class. More...
#include <zorba/zorba_string.h>
Public Types | |
| typedef std::allocator < value_type > | allocator_type |
| typedef const_pointer | const_iterator |
| typedef value_type const * | const_pointer |
| typedef value_type const & | const_reference |
| typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
| typedef allocator_type::difference_type | difference_type |
| typedef pointer | iterator |
| typedef value_type * | pointer |
| typedef value_type & | reference |
| typedef std::reverse_iterator < iterator > | reverse_iterator |
| typedef allocator_type::size_type | size_type |
| typedef std::char_traits < value_type > | traits_type |
| typedef char | value_type |
Public Member Functions | |
| String & | append (String const &s) |
| Appends the given string to this string. More... | |
| String & | append (String const &s, size_type s_pos, size_type s_n) |
| Appends a substring of the given string to this string. More... | |
| String & | append (std::string const &s) |
| Appends the given string to this string. More... | |
| String & | append (std::string const &s, size_type s_pos, size_type s_n) |
| Appends a substring of the given string to this string. More... | |
| String & | append (const_pointer s) |
| Appends the given C string to this string. More... | |
| String & | append (const_pointer s, size_type s_n) |
| Appends the given C string to this string. More... | |
| String & | append (size_type n, value_type c) |
| Appends n copies of c to this string. More... | |
| String & | assign (String const &s) |
| Assigns another string to this string. More... | |
| String & | assign (std::string const &s) |
| Assigns a std::string to this string. More... | |
| String & | assign (String const &s, size_type pos, size_type n) |
| Assigns a substring of a string to this string. More... | |
| String & | assign (std::string const &s, size_type pos, size_type n) |
| Assigns a substring of a std::string to this string. More... | |
| String & | assign (const_pointer s) |
| Assigns a C to this string. More... | |
| String & | assign (const_pointer s, size_type n) |
| Assigns a substring of a C to this string. More... | |
| String & | assign (size_type n, value_type c) |
| Assigned n copies of a character to this string. More... | |
| String & | assign (const_iterator i, const_iterator j) |
| Assigns characters from a range of characters [i,j). More... | |
| reference | at (size_type pos) |
| References a particular character within the string. More... | |
| value_type | at (size_type pos) const |
| References a particular character within the string. More... | |
| iterator | begin () |
| Returns a read/write iterator positioned at the first character of the string. More... | |
| const_iterator | begin () const |
| Returns a read-only iterator positioned at the first character of the string. More... | |
| const_pointer | c_str () const |
| Gets a pointer to a null-terminated array of characters representing the string's contents. More... | |
| size_type | capacity () const |
| Gets the capacity of this string. More... | |
| void | clear () |
| Erases the string making it empty. More... | |
| int | compare (String const &s) const |
| Compares this string against another. More... | |
| int | compare (std::string const &s) const |
| Compares this string against another. More... | |
| int | compare (const_pointer s) const |
| Compares this string against a C string. More... | |
| int | compare (size_type pos, size_type n, String const &s) const |
| Compares a substring of this string against another. More... | |
| int | compare (size_type pos, size_type n, std::string const &s) const |
| Compares a substring of this string against another. More... | |
| int | compare (size_type pos, size_type n, const_pointer s) const |
| Compares a substring of this string against a C string. More... | |
| int | compare (size_type pos, size_type n, String const &s, size_type s_pos, size_type s_n) const |
| Compares a substring of this string against a substring of another. More... | |
| int | compare (size_type pos, size_type n, std::string const &s, size_type s_pos, size_type s_n) const |
| Compares a substring of this string against a substring of another. More... | |
| int | compare (size_type pos, size_type n, const_pointer s, size_type s_n) const |
| Compares a substring of this string against a C string. More... | |
| size_type | copy (pointer buf, size_type n, size_type pos=0) const |
| Copies a substring to a C string buffer. More... | |
| const_pointer | data () const |
| Gets a pointer to the raw character data comprising the string, not necessarily null-terminated. More... | |
| bool | empty () const |
| Checks whether the string is empty. More... | |
| iterator | end () |
| Returns a read/write iterator positioned at one past the last character of the string. More... | |
| const_iterator | end () const |
| Returns a read-only iterator positioned at one past the last character of the string. More... | |
| String & | erase (size_type pos=0, size_type n=npos) |
| Erases the given number of characters starting at the given position. More... | |
| iterator | erase (iterator i) |
| Erases the character at the given iterator's position. More... | |
| iterator | erase (iterator i, iterator j) |
| Erases a range of characters [i,j). More... | |
| size_type | find (String const &s, size_type pos=0) const |
| Searches this string for the given string starting at the given position. More... | |
| size_type | find (std::string const &s, size_type pos=0) const |
| Searches this string for the given string starting at the given position. More... | |
| size_type | find (const_pointer s, size_type pos=0) const |
| Searches this string for the given string starting at the given position. More... | |
| size_type | find (const_pointer s, size_type pos, size_type s_n) const |
| Searches this string for the given string starting at the given position. More... | |
| size_type | find (value_type c, size_type pos=0) const |
| Searches this string for the given character staring at the given position. More... | |
| size_type | find_first_not_of (String const &s, size_type pos=0) const |
| Searches this string for any one of the characters not in s starting at the given position. More... | |
| size_type | find_first_not_of (std::string const &s, size_type pos=0) const |
| Searches this string for any one of the characters not in s starting at the given position. More... | |
| size_type | find_first_not_of (const_pointer s, size_type pos=0) const |
| Searches this string for any one of the characters not in s starting at the given position. More... | |
| size_type | find_first_not_of (const_pointer s, size_type pos, size_type s_n) const |
| Searches this string for any one of the first s_n characters not in s starting at the given position. More... | |
| size_type | find_first_not_of (value_type c, size_type pos=0) const |
| Searches this string for any character except the given character starting at the given position. More... | |
| size_type | find_first_of (String const &s, size_type pos=0) const |
| Searches this string for any one of the characters in s starting at the given position. More... | |
| size_type | find_first_of (std::string const &s, size_type pos=0) const |
| Searches this string for any one of the characters in s starting at the given position. More... | |
| size_type | find_first_of (const_pointer s, size_type pos=0) const |
| Searches this string for any one of the characters in s starting at the given position. More... | |
| size_type | find_first_of (const_pointer s, size_type pos, size_type s_n) const |
| Searches this string for any one of the first s_n characters in s starting at the given position. More... | |
| size_type | find_first_of (value_type c, size_type pos=0) const |
| Searches this string for the given character starting at the given position. More... | |
| size_type | find_last_not_of (String const &s, size_type pos=npos) const |
| Searches this string backwards for any one of the characters not in s starting at the given position. More... | |
| size_type | find_last_not_of (std::string const &s, size_type pos=npos) const |
| Searches this string backwards for any one of the characters not in s starting at the given position. More... | |
| size_type | find_last_not_of (const_pointer s, size_type pos=npos) const |
| Searches this string backwards for any one of the characters not in s starting at the given position. More... | |
| size_type | find_last_not_of (const_pointer s, size_type pos, size_type s_n) const |
| Searches this string backwards for any one of the first s_n characters not in s starting at the given position. More... | |
| size_type | find_last_not_of (value_type c, size_type pos=npos) const |
| Searches this string backwards for any character except the given character starting at the given position. More... | |
| size_type | find_last_of (String const &s, size_type pos=npos) const |
| Searches this string backwards for any one of the characters in s starting at the given position. More... | |
| size_type | find_last_of (std::string const &s, size_type pos=npos) const |
| Searches this string backwards for any one of the characters in s starting at the given position. More... | |
| size_type | find_last_of (const_pointer s, size_type pos=npos) const |
| Searches this string backwards for any one of the characters in s starting at the given position. More... | |
| size_type | find_last_of (const_pointer s, size_type pos, size_type s_n) const |
| Searches this string backwards for any one of the first s_n characters in s starting at the given position. More... | |
| size_type | find_last_of (value_type c, size_type pos=npos) const |
| Searches this string backwards for the given character starting at the given position. More... | |
| String & | insert (size_type pos, String const &s) |
| Inserts the given string into this string at the given position. More... | |
| String & | insert (size_type pos, std::string const &s) |
| Inserts the given string into this string at the given position. More... | |
| String & | insert (size_type pos, const_pointer s) |
| Inserts the given string into this string at the given position. More... | |
| String & | insert (size_type pos, String const &s, size_type s_pos, size_type s_n) |
| Inserts a substring of the given string into this string at the given position. More... | |
| String & | insert (size_type pos, std::string const &s, size_type s_pos, size_type s_n) |
| Inserts a substring of the given string into this string at the given position. More... | |
| String & | insert (size_type pos, const_pointer s, size_type s_n) |
| Inserts a substring of the given string into this string at the given position. More... | |
| String & | insert (size_type pos, size_type n, value_type c) |
| Inserts n copies of c into this string at the given position. More... | |
| iterator | insert (iterator pos, value_type c) |
| Inserts the given character into this string at the given position. More... | |
| void | insert (iterator pos, size_type n, value_type c) |
| Inserts n copies of c into this string at the given position. More... | |
| size_type | length () const |
| Gets the number of characters in this string. More... | |
| String & | operator+= (String const &s) |
| Appends the given string to this string. More... | |
| String & | operator+= (std::string const &s) |
| Appends the given std::string to this string. More... | |
| String & | operator+= (const_pointer s) |
| Appends the given C string to this string. More... | |
| String & | operator+= (value_type c) |
| Appends the given character to this string. More... | |
| String & | operator= (String const &s) |
| Assigns another string to this string. More... | |
| String & | operator= (std::string const &s) |
| Assigns a std::string to this string. More... | |
| String & | operator= (const_pointer s) |
| Assigns a C string to this string. More... | |
| String & | operator= (value_type c) |
| Assigns a character to this string. More... | |
| const_reference | operator[] (size_type pos) const |
| References a particular character within the string. More... | |
| void | push_back (value_type c) |
| Appends the given character to this string. More... | |
| reverse_iterator | rbegin () |
| Returns a read/write reverse iterator positioned at the first character of the reversed string. More... | |
| const_reverse_iterator | rbegin () const |
| Returns a read-only reverse iterator positioned at the first character of the reversed string. More... | |
| reverse_iterator | rend () |
| Returns a read/write reverse iterator positioned at one past the last character of the reversed string. More... | |
| const_reverse_iterator | rend () const |
| Returns a read-only reverse iterator positioned at one past the last character of the reversed string. More... | |
| String & | replace (size_type pos, size_type n, String const &s) |
| Replaces n characters of this string starting at the given position with the given string. More... | |
| String & | replace (size_type pos, size_type n, std::string const &s) |
| Replaces n characters of this string starting at the given position with the given string. More... | |
| String & | replace (size_type pos, size_type n, const_pointer s) |
| Replaces n characters of this string starting at the given position with the given string. More... | |
| String & | replace (size_type pos, size_type n, String const &s, size_type s_pos, size_type s_n) |
| Replaces n characters of this string starting at the given position with a substring of the given string. More... | |
| String & | replace (size_type pos, size_type n, std::string const &s, size_type s_pos, size_type s_n) |
| Replaces n characters of this string starting at the given position with a substring of the given string. More... | |
| String & | replace (size_type pos, size_type n, const_pointer s, size_type s_n) |
| Replaces n characters of this string starting at the given position with a substring of the given string. More... | |
| String & | replace (size_type pos, size_type n, size_type c_n, value_type c) |
| Replaces n characters of this string starting at the given position with c_n copies of c. More... | |
| String & | replace (iterator i, iterator j, String const &s) |
| Replaces the range of characters [i,j) of this string with the given string. More... | |
| String & | replace (iterator i, iterator j, std::string const &s) |
| Replaces the range of characters [i,j) of this string with the given string. More... | |
| String & | replace (iterator i, iterator j, const_pointer s) |
| Replaces the range of characters [i,j) of this string with the given string. More... | |
| String & | replace (iterator i, iterator j, const_pointer s, size_type s_n) |
| Replaces the range of characters [i,j) of this string with a substring of the given string. More... | |
| String & | replace (iterator i, iterator j, size_type n, value_type c) |
| Replaces the range of characters [i,j) of this string with c_n copies of c. More... | |
| String & | replace (iterator i, iterator j, iterator si, iterator sj) |
| Replaces the range of characters [i,j) of this string with the range of characters [si,sj). More... | |
| void | reserve (size_type n) |
| Attemts to pre-allocated enough memory to contain the given number of bytes. More... | |
| void | resize (size_type n, value_type c=value_type()) |
| Resizes the string to the given number of characters. More... | |
| size_type | rfind (String const &s, size_type pos=npos) const |
| Searches this backwards string for the given string starting at the given position. More... | |
| size_type | rfind (std::string const &s, size_type pos=npos) const |
| Searches this backwards string for the given string starting at the given position. More... | |
| size_type | rfind (const_pointer s, size_type pos=npos) const |
| Searches this backwards string for the given string starting at the given position. More... | |
| size_type | rfind (const_pointer s, size_type pos, size_type s_n) const |
| Searches this string backwards for the given string starting at the given position. More... | |
| size_type | rfind (value_type c, size_type pos=npos) const |
| Searches this string backwards for the given character staring at the given position. More... | |
| size_type | size () const |
| Gets the number of characters in this string. More... | |
| std::string | str () const |
Gets a std::string equivalent of this string. More... | |
| String () | |
| Constructs an empty string. More... | |
| String (String const &s) | |
| Copy constructs a new string from an existing string. More... | |
| String (std::string const &s) | |
| Constructs a new string from an existing std::string. More... | |
| String (const_pointer s) | |
| Constructs a string from the given C string. More... | |
| String (String const &s, size_type pos, size_type n=npos) | |
| Copy constructs a new string from a substring of an existing string. More... | |
| String (std::string const &s, size_type pos, size_type n=npos) | |
| Constructs a new string from a substring of an existing std::string. More... | |
| String (const_pointer s, size_type n) | |
| Constructs a string from the given C string. More... | |
| String (size_type n, value_type c) | |
| Constructs a new string as n copies of c. More... | |
| String (const_iterator i, const_iterator j) | |
| Constructs a string from a range of characters [i,j). More... | |
| String | substr (size_type pos=0, size_type n=npos) const |
| Creates a new string that is a substring of this string. More... | |
| void | swap (String &s) |
| Swaps the contents of this string with another. More... | |
| ~String () | |
| Destructs this string. More... | |
Static Public Attributes | |
| static size_type const | npos = static_cast<size_type>( -1 ) |
| The special value used to denote either (a) the maximum possible number as input or (b) "not found" as a result. More... | |
Friends | |
| ZORBA_DLL_PUBLIC String | operator+ (String const &, String const &) |
| ZORBA_DLL_PUBLIC String | operator+ (String const &, std::string const &) |
| ZORBA_DLL_PUBLIC String | operator+ (String const &, const_pointer) |
| ZORBA_DLL_PUBLIC String | operator+ (std::string const &, String const &) |
| ZORBA_DLL_PUBLIC String | operator+ (const_pointer, String const &) |
| ZORBA_DLL_PUBLIC bool | operator< (String const &, String const &) |
| ZORBA_DLL_PUBLIC bool | operator< (String const &, std::string const &) |
| ZORBA_DLL_PUBLIC bool | operator< (String const &, const_pointer) |
| ZORBA_DLL_PUBLIC bool | operator< (std::string const &, String const &) |
| ZORBA_DLL_PUBLIC bool | operator< (const_pointer, String const &) |
| ZORBA_DLL_PUBLIC std::ostream & | operator<< (std::ostream &, String const &) |
| ZORBA_DLL_PUBLIC bool | operator<= (String const &, String const &) |
| ZORBA_DLL_PUBLIC bool | operator<= (String const &, std::string const &) |
| ZORBA_DLL_PUBLIC bool | operator<= (String const &, const_pointer) |
| ZORBA_DLL_PUBLIC bool | operator<= (std::string const &, String const &) |
| ZORBA_DLL_PUBLIC bool | operator<= (const_pointer, String const &) |
| ZORBA_DLL_PUBLIC bool | operator== (String const &, String const &) |
| ZORBA_DLL_PUBLIC bool | operator== (String const &, std::string const &) |
| ZORBA_DLL_PUBLIC bool | operator== (String const &, const_pointer) |
| class | Unmarshaller |
The Zorba string class.
Its API is mostly compatible with that of std::string.
Definition at line 33 of file zorba_string.h.
| typedef std::allocator<value_type> zorba::String::allocator_type |
Definition at line 37 of file zorba_string.h.
Definition at line 47 of file zorba_string.h.
| typedef value_type const* zorba::String::const_pointer |
Definition at line 42 of file zorba_string.h.
| typedef value_type const& zorba::String::const_reference |
Definition at line 44 of file zorba_string.h.
| typedef std::reverse_iterator<const_iterator> zorba::String::const_reverse_iterator |
Definition at line 49 of file zorba_string.h.
| typedef allocator_type::difference_type zorba::String::difference_type |
Definition at line 38 of file zorba_string.h.
| typedef pointer zorba::String::iterator |
Definition at line 46 of file zorba_string.h.
| typedef value_type* zorba::String::pointer |
Definition at line 41 of file zorba_string.h.
| typedef value_type& zorba::String::reference |
Definition at line 43 of file zorba_string.h.
| typedef std::reverse_iterator<iterator> zorba::String::reverse_iterator |
Definition at line 48 of file zorba_string.h.
| typedef allocator_type::size_type zorba::String::size_type |
Definition at line 39 of file zorba_string.h.
| typedef std::char_traits<value_type> zorba::String::traits_type |
Definition at line 36 of file zorba_string.h.
| typedef char zorba::String::value_type |
Definition at line 35 of file zorba_string.h.
| zorba::String::String | ( | ) |
Constructs an empty string.
| zorba::String::String | ( | String const & | s | ) |
Copy constructs a new string from an existing string.
| s | The string to copy from. |
| zorba::String::String | ( | std::string const & | s | ) |
Constructs a new string from an existing std::string.
| s | The string to copy from. |
| zorba::String::String | ( | const_pointer | s | ) |
Constructs a string from the given C string.
| s | The null-terminated C string. |
Copy constructs a new string from a substring of an existing string.
| s | The string to copy from. |
| pos | The position of the first character to copy. |
| n | The number of characters to copy. |
Constructs a new string from a substring of an existing std::string.
| s | The string to copy from. |
| pos | The starting position of the substring. |
| n | The number of characters of the substring. |
| zorba::String::String | ( | const_pointer | s, |
| size_type | n | ||
| ) |
Constructs a string from the given C string.
| s | The C string. |
| n | The number of characters to copy. |
| zorba::String::String | ( | size_type | n, |
| value_type | c | ||
| ) |
Constructs a new string as n copies of c.
| n | The number of times to repeat the character. |
| c | The character to repeat. |
| zorba::String::String | ( | const_iterator | i, |
| const_iterator | j | ||
| ) |
Constructs a string from a range of characters [i,j).
| i | The iterator marking the first character of the range. |
| j | The iterator marking one past the last character of the range. |
| zorba::String::~String | ( | ) |
Destructs this string.
Appends the given string to this string.
| s | The string to append. |
Appends a substring of the given string to this string.
| s | The string to append. |
| s_pos | The starting position is s. |
| s_n | The number of characters of s to append. |
| String& zorba::String::append | ( | std::string const & | s | ) |
Appends the given string to this string.
| s | The string to append. |
Appends a substring of the given string to this string.
| s | The string to append. |
| s_pos | The starting position is s. |
| s_n | The number of characters of s to append. |
| String& zorba::String::append | ( | const_pointer | s | ) |
Appends the given C string to this string.
| s | The null-terminated C string to append. |
| String& zorba::String::append | ( | const_pointer | s, |
| size_type | s_n | ||
| ) |
Appends the given C string to this string.
| s | The C string to append. |
| s_n | The number of characters of s to append. |
| String& zorba::String::append | ( | size_type | n, |
| value_type | c | ||
| ) |
Appends n copies of c to this string.
| n | The numer of copies of c to append. |
| c | The character to append. |
Assigns another string to this string.
| s | The string to assign from. |
| String& zorba::String::assign | ( | std::string const & | s | ) |
Assigns a std::string to this string.
| s | The string to assign from. |
Assigns a substring of a string to this string.
| s | The string to assign from. |
| pos | The starting position withing s. |
| n | The number of characters to assign. |
Assigns a substring of a std::string to this string.
| s | The string to assign from. |
| pos | The starting position withing s. |
| n | The number of characters to assign. |
| String& zorba::String::assign | ( | const_pointer | s | ) |
Assigns a C to this string.
| s | The null-terminated C string to assign from. |
| String& zorba::String::assign | ( | const_pointer | s, |
| size_type | n | ||
| ) |
Assigns a substring of a C to this string.
| s | The C string to assign from. |
| n | The number of characters to assign. |
| String& zorba::String::assign | ( | size_type | n, |
| value_type | c | ||
| ) |
Assigned n copies of a character to this string.
| n | The number of copies of the character. |
| c | The character. |
| String& zorba::String::assign | ( | const_iterator | i, |
| const_iterator | j | ||
| ) |
Assigns characters from a range of characters [i,j).
| i | The iterator marking the first character of the range. |
| j | The iterator marking one past the last character of the range. |
References a particular character within the string.
| pos | The index of the character. The index is bounds-checked. |
| std::out_of_range | if pos >= size(). |
| value_type zorba::String::at | ( | size_type | pos | ) | const |
References a particular character within the string.
| pos | The index of the character. The index is bounds-checked. |
| iterator zorba::String::begin | ( | ) |
Returns a read/write iterator positioned at the first character of the string.
| const_iterator zorba::String::begin | ( | ) | const |
Returns a read-only iterator positioned at the first character of the string.
| const_pointer zorba::String::c_str | ( | ) | const |
Gets a pointer to a null-terminated array of characters representing the string's contents.
Referenced by zorba::fn::tokenize().
| size_type zorba::String::capacity | ( | ) | const |
Gets the capacity of this string.
| void zorba::String::clear | ( | ) |
Erases the string making it empty.
| int zorba::String::compare | ( | String const & | s | ) | const |
Compares this string against another.
| s | The string to compare to. |
| int zorba::String::compare | ( | std::string const & | s | ) | const |
Compares this string against another.
| s | The string to compare to. |
| int zorba::String::compare | ( | const_pointer | s | ) | const |
Compares this string against a C string.
| s | The null-terminated C string to compare to. |
Compares a substring of this string against another.
| pos | The starting position within this string. |
| n | The number of characters to compare. |
| s | The string to compare to. |
Compares a substring of this string against another.
| pos | The starting position within this string. |
| n | The number of characters to compare. |
| s | The string to compare to. |
| int zorba::String::compare | ( | size_type | pos, |
| size_type | n, | ||
| const_pointer | s | ||
| ) | const |
Compares a substring of this string against a C string.
| pos | The starting position within this string. |
| n | The number of characters to compare. |
| s | The null-terminated C string to compare to. |
| int zorba::String::compare | ( | size_type | pos, |
| size_type | n, | ||
| String const & | s, | ||
| size_type | s_pos, | ||
| size_type | s_n | ||
| ) | const |
Compares a substring of this string against a substring of another.
| pos | The starting position within this string. |
| n | The number of characters to compare. |
| s | The string to compare to. |
| s_pos | The starting position within s. |
| s_n | The number of characters of s to compare. |
| int zorba::String::compare | ( | size_type | pos, |
| size_type | n, | ||
| std::string const & | s, | ||
| size_type | s_pos, | ||
| size_type | s_n | ||
| ) | const |
Compares a substring of this string against a substring of another.
| pos | The starting position within this string. |
| n | The number of characters to compare. |
| s | The string to compare to. |
| s_pos | The starting position within s. |
| s_n | The number of characters of s to compare. |
| int zorba::String::compare | ( | size_type | pos, |
| size_type | n, | ||
| const_pointer | s, | ||
| size_type | s_n | ||
| ) | const |
Compares a substring of this string against a C string.
| pos | The starting position within this string. |
| n | The number of characters to compare. |
| s | The C string to compare to. |
| s_n | The number of characters of s to compare. |
Copies a substring to a C string buffer.
| buf | The buffer to copy into. |
| n | The number of characters to copy. It's the caller's responsibility to ensure that the size of buf <= n. |
| pos | The position of the first character to copy. |
| std::out_of_range | if pos >= size(). |
| const_pointer zorba::String::data | ( | ) | const |
Gets a pointer to the raw character data comprising the string, not necessarily null-terminated.
|
inline |
Checks whether the string is empty.
Definition at line 180 of file zorba_string.h.
| iterator zorba::String::end | ( | ) |
Returns a read/write iterator positioned at one past the last character of the string.
| const_iterator zorba::String::end | ( | ) | const |
Returns a read-only iterator positioned at one past the last character of the string.
Erases the given number of characters starting at the given position.
| pos | The position of the first character to erase. |
| n | The number of characters to erase. |
| std::out_of_range | if pos is beyond the end of the string. |
Erases the character at the given iterator's position.
| i | The iterator marking the position of the character to erase. |
Erases a range of characters [i,j).
| i | The iterator marking the first character of the range. |
| j | The iterator marking one past the last character of the range. |
Searches this string for the given string starting at the given position.
| s | The string to search for. |
| pos | The starting position within this string. |
npos if not found. Searches this string for the given string starting at the given position.
| s | The string to search for. |
| pos | The starting position within this string. |
npos if not found. | size_type zorba::String::find | ( | const_pointer | s, |
| size_type | pos = 0 |
||
| ) | const |
Searches this string for the given string starting at the given position.
| s | The null-terminated C string to search for. |
| pos | The starting position within this string. |
npos if not found. | size_type zorba::String::find | ( | const_pointer | s, |
| size_type | pos, | ||
| size_type | s_n | ||
| ) | const |
Searches this string for the given string starting at the given position.
| s | The C string to search for. |
| pos | The starting position within this string. |
| s_n | The number of characters to compare. |
npos if not found. | size_type zorba::String::find | ( | value_type | c, |
| size_type | pos = 0 |
||
| ) | const |
Searches this string for the given character staring at the given position.
| c | The character to search for. |
| pos | The starting position within this string. |
npos if not found. Searches this string for any one of the characters not in s starting at the given position.
| s | The set of characters not to search for. |
| pos | The starting position within this string. |
npos if not found. Searches this string for any one of the characters not in s starting at the given position.
| s | The set of characters not to search for. |
| pos | The starting position within this string. |
npos if not found. | size_type zorba::String::find_first_not_of | ( | const_pointer | s, |
| size_type | pos = 0 |
||
| ) | const |
Searches this string for any one of the characters not in s starting at the given position.
| s | The set of characters not to search for. |
| pos | The starting position within this string. |
npos if not found. | size_type zorba::String::find_first_not_of | ( | const_pointer | s, |
| size_type | pos, | ||
| size_type | s_n | ||
| ) | const |
Searches this string for any one of the first s_n characters not in s starting at the given position.
| s | The set of characters not to search for. |
| pos | The starting position within this string. |
| s_n | The number of characters of s to consider. |
npos if not found. | size_type zorba::String::find_first_not_of | ( | value_type | c, |
| size_type | pos = 0 |
||
| ) | const |
Searches this string for any character except the given character starting at the given position.
| c | The character not to search for. |
| pos | The starting position within this string. |
npos if not found. Searches this string for any one of the characters in s starting at the given position.
| s | The set of characters to search for. |
| pos | The starting position within this string. |
npos if not found. Searches this string for any one of the characters in s starting at the given position.
| s | The set of characters to search for. |
| pos | The starting position within this string. |
npos if not found. | size_type zorba::String::find_first_of | ( | const_pointer | s, |
| size_type | pos = 0 |
||
| ) | const |
Searches this string for any one of the characters in s starting at the given position.
| s | The set of characters to search for. |
| pos | The starting position within this string. |
npos if not found. | size_type zorba::String::find_first_of | ( | const_pointer | s, |
| size_type | pos, | ||
| size_type | s_n | ||
| ) | const |
Searches this string for any one of the first s_n characters in s starting at the given position.
| s | The set of characters to search for. |
| pos | The starting position within this string. |
| s_n | The number of characters of s to consider. |
npos if not found. | size_type zorba::String::find_first_of | ( | value_type | c, |
| size_type | pos = 0 |
||
| ) | const |
Searches this string for the given character starting at the given position.
| c | The character to search for. |
| pos | The starting position within this string. |
npos if not found. Searches this string backwards for any one of the characters not in s starting at the given position.
| s | The set of characters to not search for. |
| pos | The starting position within this string. |
npos if not found. Searches this string backwards for any one of the characters not in s starting at the given position.
| s | The set of characters to not search for. |
| pos | The starting position within this string. |
npos if not found. | size_type zorba::String::find_last_not_of | ( | const_pointer | s, |
| size_type | pos = npos |
||
| ) | const |
Searches this string backwards for any one of the characters not in s starting at the given position.
| s | The set of characters to not search for. |
| pos | The starting position within this string. |
npos if not found. | size_type zorba::String::find_last_not_of | ( | const_pointer | s, |
| size_type | pos, | ||
| size_type | s_n | ||
| ) | const |
Searches this string backwards for any one of the first s_n characters not in s starting at the given position.
| s | The set of characters to not search for. |
| pos | The starting position within this string. |
| s_n | The number of characters of s to consider. |
npos if not found. | size_type zorba::String::find_last_not_of | ( | value_type | c, |
| size_type | pos = npos |
||
| ) | const |
Searches this string backwards for any character except the given character starting at the given position.
| c | The character to search for. |
| pos | The starting position within this string. |
npos if not found. Searches this string backwards for any one of the characters in s starting at the given position.
| s | The set of characters to search for. |
| pos | The starting position within this string. |
npos if not found. Searches this string backwards for any one of the characters in s starting at the given position.
| s | The set of characters to search for. |
| pos | The starting position within this string. |
npos if not found. | size_type zorba::String::find_last_of | ( | const_pointer | s, |
| size_type | pos = npos |
||
| ) | const |
Searches this string backwards for any one of the characters in s starting at the given position.
| s | The set of characters to search for. |
| pos | The starting position within this string. |
npos if not found. | size_type zorba::String::find_last_of | ( | const_pointer | s, |
| size_type | pos, | ||
| size_type | s_n | ||
| ) | const |
Searches this string backwards for any one of the first s_n characters in s starting at the given position.
| s | The set of characters to search for. |
| pos | The starting position within this string. |
| s_n | The number of characters of s to consider. |
npos if not found. | size_type zorba::String::find_last_of | ( | value_type | c, |
| size_type | pos = npos |
||
| ) | const |
Searches this string backwards for the given character starting at the given position.
| c | The character to search for. |
| pos | The starting position within this string. |
npos if not found. Inserts the given string into this string at the given position.
| pos | The position within this string to insert at. |
| s | The string to insert. |
Inserts the given string into this string at the given position.
| pos | The position within this string to insert at. |
| s | The string to insert. |
| String& zorba::String::insert | ( | size_type | pos, |
| const_pointer | s | ||
| ) |
Inserts the given string into this string at the given position.
| pos | The position within this string to insert at. |
| s | The null-terminated string to insert. |
Inserts a substring of the given string into this string at the given position.
| pos | The position within this string to insert at. |
| s | The null-terminated C string to insert. |
| s_pos | The starting position within s. |
| s_n | The numer of characters of s to insert. |
| String& zorba::String::insert | ( | size_type | pos, |
| std::string const & | s, | ||
| size_type | s_pos, | ||
| size_type | s_n | ||
| ) |
Inserts a substring of the given string into this string at the given position.
| pos | The position within this string to insert at. |
| s | The null-terminated C string to insert. |
| s_pos | The starting position within s. |
| s_n | The numer of characters of s to insert. |
| String& zorba::String::insert | ( | size_type | pos, |
| const_pointer | s, | ||
| size_type | s_n | ||
| ) |
Inserts a substring of the given string into this string at the given position.
| pos | The position within this string to insert at. |
| s | The C string to insert. |
| s_n | The numer of characters of s to insert. |
| String& zorba::String::insert | ( | size_type | pos, |
| size_type | n, | ||
| value_type | c | ||
| ) |
Inserts n copies of c into this string at the given position.
| pos | The position within this string to insert at. |
| n | The number of copies of c to insert. |
| c | The character to insert. |
| iterator zorba::String::insert | ( | iterator | pos, |
| value_type | c | ||
| ) |
Inserts the given character into this string at the given position.
| pos | The iterator marking the position within this string to insert at. |
| c | The character to insert. |
| void zorba::String::insert | ( | iterator | pos, |
| size_type | n, | ||
| value_type | c | ||
| ) |
Inserts n copies of c into this string at the given position.
| pos | The iterator marking the position within this string to insert at. |
| n | The number of copies of c to insert. |
| c | The character to insert. |
| size_type zorba::String::length | ( | ) | const |
Gets the number of characters in this string.
Appends the given string to this string.
| s | The string to append. |
Definition at line 305 of file zorba_string.h.
|
inline |
Appends the given std::string to this string.
| s | The string to append. |
Definition at line 315 of file zorba_string.h.
|
inline |
Appends the given C string to this string.
| s | The null-terminated C string to append. |
Definition at line 325 of file zorba_string.h.
|
inline |
Appends the given character to this string.
| c | The character to append. |
Definition at line 335 of file zorba_string.h.
Assigns another string to this string.
| s | The string to assign from. |
| String& zorba::String::operator= | ( | std::string const & | s | ) |
Assigns a std::string to this string.
| s | The string to assign from. |
| String& zorba::String::operator= | ( | const_pointer | s | ) |
Assigns a C string to this string.
| s | The null-terminated C string to assign from. |
| String& zorba::String::operator= | ( | value_type | c | ) |
Assigns a character to this string.
| c | The character to assign. |
| const_reference zorba::String::operator[] | ( | size_type | pos | ) | const |
References a particular character within the string.
| pos | The index of the character. The index is not bounds-checked. |
| void zorba::String::push_back | ( | value_type | c | ) |
Appends the given character to this string.
| c | The character to append. |
| reverse_iterator zorba::String::rbegin | ( | ) |
Returns a read/write reverse iterator positioned at the first character of the reversed string.
| const_reverse_iterator zorba::String::rbegin | ( | ) | const |
Returns a read-only reverse iterator positioned at the first character of the reversed string.
| reverse_iterator zorba::String::rend | ( | ) |
Returns a read/write reverse iterator positioned at one past the last character of the reversed string.
| const_reverse_iterator zorba::String::rend | ( | ) | const |
Returns a read-only reverse iterator positioned at one past the last character of the reversed string.
Replaces n characters of this string starting at the given position with the given string.
| pos | The position within this string to replace at. |
| n | The number of characters to replace. |
| s | The replacement string. |
Replaces n characters of this string starting at the given position with the given string.
| pos | The position within this string to replace at. |
| n | The number of characters to replace. |
| s | The replacement string. |
| String& zorba::String::replace | ( | size_type | pos, |
| size_type | n, | ||
| const_pointer | s | ||
| ) |
Replaces n characters of this string starting at the given position with the given string.
| pos | The position within this string to replace at. |
| n | The number of characters to replace. |
| s | The null-terminated replacement C string. |
| String& zorba::String::replace | ( | size_type | pos, |
| size_type | n, | ||
| String const & | s, | ||
| size_type | s_pos, | ||
| size_type | s_n | ||
| ) |
Replaces n characters of this string starting at the given position with a substring of the given string.
| pos | The position within this string to replace at. |
| n | The number of characters to replace. |
| s | The replacement string. |
| s_pos | The starting position is s. |
| s_n | The number of characters of s to use. |
| String& zorba::String::replace | ( | size_type | pos, |
| size_type | n, | ||
| std::string const & | s, | ||
| size_type | s_pos, | ||
| size_type | s_n | ||
| ) |
Replaces n characters of this string starting at the given position with a substring of the given string.
| pos | The position within this string to replace at. |
| n | The number of characters to replace. |
| s | The replacement string. |
| s_pos | The starting position is s. |
| s_n | The number of characters of s to use. |
| String& zorba::String::replace | ( | size_type | pos, |
| size_type | n, | ||
| const_pointer | s, | ||
| size_type | s_n | ||
| ) |
Replaces n characters of this string starting at the given position with a substring of the given string.
| pos | The position within this string to replace at. |
| n | The number of characters to replace. |
| s | The replacement C string. |
| s_n | The number of characters of s to use. |
| String& zorba::String::replace | ( | size_type | pos, |
| size_type | n, | ||
| size_type | c_n, | ||
| value_type | c | ||
| ) |
Replaces n characters of this string starting at the given position with c_n copies of c.
| pos | The position within this string to replace at. |
| n | The number of characters to replace. |
| c_n | The number of copies of to replace with. |
| c | The character to replace with. |
Replaces the range of characters [i,j) of this string with the given string.
| i | The iterator marking the first character of the range. |
| j | The iterator marking one past the last character of the range. |
| s | The replacement string. |
Replaces the range of characters [i,j) of this string with the given string.
| i | The iterator marking the first character of the range. |
| j | The iterator marking one past the last character of the range. |
| s | The replacement string. |
| String& zorba::String::replace | ( | iterator | i, |
| iterator | j, | ||
| const_pointer | s | ||
| ) |
Replaces the range of characters [i,j) of this string with the given string.
| i | The iterator marking the first character of the range. |
| j | The iterator marking one past the last character of the range. |
| s | The null-terminated replacement C string. |
| String& zorba::String::replace | ( | iterator | i, |
| iterator | j, | ||
| const_pointer | s, | ||
| size_type | s_n | ||
| ) |
Replaces the range of characters [i,j) of this string with a substring of the given string.
| i | The iterator marking the first character of the range. |
| j | The iterator marking one past the last character of the range. |
| s | The replacement C string. |
| s_n | The number of characters of s to use. |
| String& zorba::String::replace | ( | iterator | i, |
| iterator | j, | ||
| size_type | n, | ||
| value_type | c | ||
| ) |
Replaces the range of characters [i,j) of this string with c_n copies of c.
| i | The iterator marking the first character of the range. |
| j | The iterator marking one past the last character of the range. |
| n | The number of copies of to replace with. |
| c | The character to replace with. |
Replaces the range of characters [i,j) of this string with the range of characters [si,sj).
| i | The iterator marking the first character of the range. |
| j | The iterator marking one past the last character of the range. |
| si | The iterator marking the first character of the range. |
| sj | The iterator marking one past the last character of the range. |
| void zorba::String::reserve | ( | size_type | n | ) |
Attemts to pre-allocated enough memory to contain the given number of bytes.
| n | The number of bytes. |
| void zorba::String::resize | ( | size_type | n, |
| value_type | c = value_type() |
||
| ) |
Searches this backwards string for the given string starting at the given position.
| s | The string to search for. |
| pos | The starting position within this string. |
npos if not found. Searches this backwards string for the given string starting at the given position.
| s | The string to search for. |
| pos | The starting position within this string. |
npos if not found. | size_type zorba::String::rfind | ( | const_pointer | s, |
| size_type | pos = npos |
||
| ) | const |
Searches this backwards string for the given string starting at the given position.
| s | The string to search for. |
| pos | The starting position within this string. |
npos if not found. | size_type zorba::String::rfind | ( | const_pointer | s, |
| size_type | pos, | ||
| size_type | s_n | ||
| ) | const |
Searches this string backwards for the given string starting at the given position.
| s | The C string to search for. |
| pos | The starting position within this string. |
| s_n | The number of characters to compare. |
npos if not found. | size_type zorba::String::rfind | ( | value_type | c, |
| size_type | pos = npos |
||
| ) | const |
Searches this string backwards for the given character staring at the given position.
| c | The character to search for. |
| pos | The starting position within this string. |
npos if not found.
|
inline |
Gets the number of characters in this string.
(This is a synonym for length().)
Definition at line 197 of file zorba_string.h.
| std::string zorba::String::str | ( | ) | const |
Gets a std::string equivalent of this string.
(There intentionally is no operator std::string() const since its convenient use would mask the expense of creating a new std::string.) This function is an extension to the std::string API.
std::string. Creates a new string that is a substring of this string.
| pos | The position in this string for first character of the new string. |
| n | The number of characters to extract. |
| std::out_of_range | if pos >= size(). |
| void zorba::String::swap | ( | String & | s | ) |
Swaps the contents of this string with another.
This is an O(1) operation.
| s | The string to swap with. |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Definition at line 1321 of file zorba_string.h.
The special value used to denote either (a) the maximum possible number as input or (b) "not found" as a result.
Definition at line 55 of file zorba_string.h.