#include <stlsoft/string/simple_string.hpp>
C | The character type | |
T | The traits type. On translators that support default template arguments this is defaulted to char_traits<C> | |
A | The allocator type. On translators that support default template arguments this is defaulted to allocator_selector<C>::allocator_type |
Member Types | |
typedef C | value_type |
The value type. | |
typedef T | traits_type |
The traits type. | |
typedef A | allocator_type |
The allocator type. | |
typedef basic_simple_string< C, T, A > | class_type |
The current parameterisation of the type. | |
typedef value_type | char_type |
The character type. | |
typedef value_type * | pointer |
The pointer type. | |
typedef value_type const * | const_pointer |
The non-mutable (const) pointer type. | |
typedef value_type & | reference |
The reference type. | |
typedef value_type const & | const_reference |
The non-mutable (const) reference type. | |
typedef size_t | size_type |
The size type. | |
typedef ss_ptrdiff_t | difference_type |
The difference type. | |
typedef pointer_iterator < value_type, pointer, reference >::type | iterator |
The iterator type. | |
typedef pointer_iterator < value_type const , const_pointer, const_reference >::type | const_iterator |
The non-mutating (const) iterator type. | |
Public Member Functions | |
Construction | |
basic_simple_string () | |
Default constructor. | |
basic_simple_string (class_type const &rhs) | |
Copy constructor. | |
basic_simple_string (class_type const &s, size_type pos) | |
Construct from the given string at the specified position. | |
basic_simple_string (class_type const &s, size_type pos, size_type cch) | |
Construct with cch characters from the given string at the specified position. | |
basic_simple_string (char_type const *s) | |
Construct from the given character string. | |
basic_simple_string (char_type const *s, size_type cch) | |
Construct with cch characters from the given character string. | |
basic_simple_string (size_type cch, char_type ch) | |
Construct with cch characters each set to ch . | |
basic_simple_string (char_type const *first, char_type const *last) | |
Construct from the range [first:last). | |
~basic_simple_string () throw () | |
Destructor. | |
Assignment | |
class_type & | assign (char_type const *s) |
Assigns from the given character string. | |
class_type & | assign (char_type const *s, size_type cch) |
Assigns with cch characters from the given character string. | |
class_type & | assign (class_type const &str, size_type pos, size_type cch) |
Assigns with cch characters from the given character string at the specified position. | |
class_type & | assign (class_type const &str) |
Assigns from the given string. | |
class_type & | assign (size_type cch, char_type ch) |
Assigns cch characters with the value ch . | |
class_type & | assign (const_iterator first, const_iterator last) |
Assigns from the range [first:last). | |
class_type const & | operator= (class_type const &rhs) |
Copy assignment operator. | |
class_type const & | operator= (char_type const *s) |
Assignment operator. | |
class_type const & | operator= (char_type ch) |
Assignment operator. | |
Appending | |
class_type & | append (char_type const *s) |
Appends the given character string. | |
class_type & | append (char_type const *s, size_type cch) |
Appends cch characters from the given character string. | |
class_type & | append (class_type const &str, size_type pos, size_type cch) |
Assigns cch characters from the given character string at the specified position. | |
class_type & | append (class_type const &str) |
Appends the given string. | |
class_type & | append (size_type cch, char_type ch) |
Appends cch characters with the value ch . | |
class_type & | append (const_iterator first, const_iterator last) |
Appends the range [first:last). | |
class_type & | operator+= (char_type ch) |
Concatenation operator. | |
class_type & | operator+= (char_type const *s) |
Concatenation operator. | |
class_type & | operator+= (class_type const &rhs) |
Concatenation operator. | |
void | push_back (char_type ch) |
Appends a single character. | |
Operations | |
void | reserve (size_type cch) |
Reserves at least cch characters. | |
void | swap (class_type &other) |
Swaps the contents between this and other . | |
void | resize (size_type cch, value_type ch=value_type()) |
Resizes the string. | |
void | clear () |
Empties the string. | |
Attributes | |
size_type | size () const |
The number of elements in the string. | |
size_type | max_size () const |
The maximum number of elements that can be stored in the string. | |
size_type | length () const |
The number of elements in the string. | |
size_type | capacity () const |
The storage currently allocated by the string. | |
bool | empty () const |
Indicates whether the string is empty. | |
Comparison | |
ss_sint_t | compare (size_type pos, size_type cch, value_type const *s, size_type cchRhs) const |
Compares this with the given string. | |
ss_sint_t | compare (size_type pos, size_type cch, value_type const *s) const |
Compares this with the given string. | |
ss_sint_t | compare (value_type const *s) const |
Compares this with the given string. | |
ss_sint_t | compare (size_type pos, size_type cch, class_type const &rhs, size_type posRhs, size_type cchRhs) const |
Compares this with the given string. | |
ss_sint_t | compare (size_type pos, size_type cch, class_type const &rhs) const |
Compares this with the given string. | |
ss_sint_t | compare (class_type const &rhs) const |
Compares this with the given string. | |
Accessors | |
reference | operator[] (size_type index) |
Returns mutable reference at the given index. | |
const_reference | operator[] (size_type index) const |
Returns non-mutable (const) reference at the given index. | |
reference | at (size_type index) |
Returns mutable (non-const) reference at the given index. | |
const_reference | at (size_type index) const |
Returns non-mutable (const) reference at the given index. | |
class_type | substr (size_type pos, size_type cch) const |
Returns a string of maximum length cch, from the position pos. | |
class_type | substr (size_type pos) const |
class_type | substr () const |
value_type const * | c_str () const |
Returns null-terminated non-mutable (const) pointer to string data. | |
value_type const * | data () const |
Returns non-mutable (const) pointer to string data. | |
reference | front () |
Returns the first character in the string. | |
reference | back () |
Returns the last character in the string. | |
const_reference | front () const |
Returns the first character in the string. | |
const_reference | back () const |
Returns the last character in the string. | |
size_type | copy (value_type *dest, size_type cch, size_type pos=0) const |
Copies elements into the given destination. | |
Iteration | |
const_iterator | begin () const |
Begins the iteration. | |
const_iterator | end () const |
Ends the iteration. | |
iterator | begin () |
Begins the iteration. | |
iterator | end () |
Ends the iteration. | |
Classes | |
struct | string_buffer |
typedef C value_type |
The value type.
typedef T traits_type |
The traits type.
typedef A allocator_type |
The allocator type.
typedef basic_simple_string<C, T, A> class_type |
The current parameterisation of the type.
typedef value_type char_type |
The character type.
typedef value_type* pointer |
The pointer type.
typedef value_type const* const_pointer |
The non-mutable (const) pointer type.
typedef value_type& reference |
The reference type.
typedef value_type const& const_reference |
The non-mutable (const) reference type.
typedef ss_ptrdiff_t difference_type |
The difference type.
typedef pointer_iterator< value_type , pointer , reference >::type iterator |
The iterator type.
typedef pointer_iterator< value_type const , const_pointer , const_reference >::type const_iterator |
The non-mutating (const) iterator type.
Default constructor.
basic_simple_string | ( | class_type const & | rhs | ) |
Copy constructor.
basic_simple_string | ( | class_type const & | s, | |
size_type | pos | |||
) |
Construct from the given string at the specified position.
basic_simple_string | ( | class_type const & | s, | |
size_type | pos, | |||
size_type | cch | |||
) |
Construct with cch
characters from the given string at the specified position.
basic_simple_string | ( | char_type const * | s | ) |
Construct from the given character string.
basic_simple_string | ( | char_type const * | s, | |
size_type | cch | |||
) |
Construct with cch
characters from the given character string.
basic_simple_string | ( | size_type | cch, | |
char_type | ch | |||
) |
Construct with cch
characters each set to ch
.
basic_simple_string | ( | char_type const * | first, | |
char_type const * | last | |||
) |
Construct from the range [first:last).
~basic_simple_string | ( | ) | throw () |
Destructor.
class_type& assign | ( | char_type const * | s | ) |
Assigns from the given character string.
class_type& assign | ( | char_type const * | s, | |
size_type | cch | |||
) |
Assigns with cch
characters from the given character string.
class_type& assign | ( | class_type const & | str, | |
size_type | pos, | |||
size_type | cch | |||
) |
Assigns with cch
characters from the given character string at the specified position.
class_type& assign | ( | class_type const & | str | ) |
Assigns from the given string.
class_type& assign | ( | size_type | cch, | |
char_type | ch | |||
) |
Assigns cch
characters with the value ch
.
class_type& assign | ( | const_iterator | first, | |
const_iterator | last | |||
) |
Assigns from the range [first:last).
class_type const& operator= | ( | class_type const & | rhs | ) |
Copy assignment operator.
class_type const& operator= | ( | char_type const * | s | ) |
Assignment operator.
class_type const& operator= | ( | char_type | ch | ) |
Assignment operator.
class_type& append | ( | char_type const * | s | ) |
Appends the given character string.
class_type& append | ( | char_type const * | s, | |
size_type | cch | |||
) |
Appends cch
characters from the given character string.
class_type& append | ( | class_type const & | str, | |
size_type | pos, | |||
size_type | cch | |||
) |
Assigns cch
characters from the given character string at the specified position.
class_type& append | ( | class_type const & | str | ) |
Appends the given string.
class_type& append | ( | size_type | cch, | |
char_type | ch | |||
) |
Appends cch
characters with the value ch
.
class_type& append | ( | const_iterator | first, | |
const_iterator | last | |||
) |
Appends the range [first:last).
class_type& operator+= | ( | char_type | ch | ) |
Concatenation operator.
class_type& operator+= | ( | char_type const * | s | ) |
Concatenation operator.
class_type& operator+= | ( | class_type const & | rhs | ) |
Concatenation operator.
void push_back | ( | char_type | ch | ) |
Appends a single character.
void reserve | ( | size_type | cch | ) |
Reserves at least cch characters.
void swap | ( | class_type & | other | ) |
Swaps the contents between this
and other
.
void resize | ( | size_type | cch, | |
value_type | ch = value_type() | |||
) |
Resizes the string.
cch | The new size of the string | |
ch | The value with which to initialise additional items if the string is expanded |
void clear | ( | ) |
Empties the string.
size_type size | ( | ) | const |
The number of elements in the string.
size_type max_size | ( | ) | const |
The maximum number of elements that can be stored in the string.
size_type length | ( | ) | const |
The number of elements in the string.
Referenced by stlsoft::c_str_len(), and stlsoft::c_str_ptr_null().
size_type capacity | ( | ) | const |
The storage currently allocated by the string.
bool empty | ( | ) | const |
Indicates whether the string is empty.
ss_sint_t compare | ( | size_type | pos, | |
size_type | cch, | |||
value_type const * | s, | |||
size_type | cchRhs | |||
) | const |
Compares this
with the given string.
ss_sint_t compare | ( | size_type | pos, | |
size_type | cch, | |||
value_type const * | s | |||
) | const |
Compares this
with the given string.
ss_sint_t compare | ( | value_type const * | s | ) | const |
Compares this
with the given string.
ss_sint_t compare | ( | size_type | pos, | |
size_type | cch, | |||
class_type const & | rhs, | |||
size_type | posRhs, | |||
size_type | cchRhs | |||
) | const |
Compares this
with the given string.
ss_sint_t compare | ( | size_type | pos, | |
size_type | cch, | |||
class_type const & | rhs | |||
) | const |
Compares this
with the given string.
ss_sint_t compare | ( | class_type const & | rhs | ) | const |
Compares this
with the given string.
const_reference operator[] | ( | size_type | index | ) | const |
Returns non-mutable (const) reference at the given index.
Returns mutable (non-const) reference at the given index.
const_reference at | ( | size_type | index | ) | const |
Returns non-mutable (const) reference at the given index.
class_type substr | ( | size_type | pos, | |
size_type | cch | |||
) | const |
Returns a string of maximum length cch, from the position pos.
value_type const* c_str | ( | ) | const |
Returns null-terminated non-mutable (const) pointer to string data.
Referenced by searchspec_sequence::begin(), stlsoft::c_str_ptr(), and stlsoft::c_str_ptr_null().
value_type const* data | ( | ) | const |
reference front | ( | ) |
Returns the first character in the string.
reference back | ( | ) |
Returns the last character in the string.
const_reference front | ( | ) | const |
Returns the first character in the string.
const_reference back | ( | ) | const |
Returns the last character in the string.
size_type copy | ( | value_type * | dest, | |
size_type | cch, | |||
size_type | pos = 0 | |||
) | const |
Copies elements into the given destination.
const_iterator begin | ( | ) | const |
Begins the iteration.
const_iterator end | ( | ) | const |
Ends the iteration.
iterator begin | ( | ) |
Begins the iteration.
iterator end | ( | ) |
Ends the iteration.