#include <stlsoft/string/charset_tokeniser.hpp>
strtok()
.
This class takes a string, and a character-set delimiter, and fashions a sequence from the given string, with each element determined with respect to the delimiter. It is derived from stlsoft::string_tokeniser, and effectively defines a specialisation of it, in order to make it simpler to specialise. All that's usually required is to specialise the string type and, optionally, the blanks policy.
S | The string type | |
B | The blank skipping policy type. Defaults to skip_blank_tokens<true> | |
V | The value type (the string type that will be used for the values). Defaults to S | |
T | The string type traits type. Defaults to string_tokeniser_type_traits<S, V> | |
D | The delimiter type (can be a string type or a character type). Defaults to S | |
P | The tokeniser comparator type. Defaults to string_tokeniser_comparator<D, S, T> |
Member Types | |
typedef charset_tokeniser< S, B, V, T, D, P > | class_type |
The current parameterisation of the type. | |
typedef parent_class_type::string_type | string_type |
The sequence string type. | |
typedef parent_class_type::delimiter_type | delimiter_type |
The delimiter type. | |
typedef parent_class_type::blanks_policy_type | blanks_policy_type |
The blanks policy type. | |
typedef parent_class_type::value_type | value_type |
The value type. | |
typedef parent_class_type::traits_type | traits_type |
The traits type. | |
typedef parent_class_type::comparator_type | comparator_type |
The tokeniser comparator type. | |
typedef parent_class_type::char_type | char_type |
The character type. | |
typedef parent_class_type::size_type | size_type |
The size type. | |
typedef parent_class_type::const_reference | const_reference |
The non-mutating (const) reference type. | |
typedef parent_class_type::const_iterator | const_iterator |
The non-mutating (const) iterator type. | |
Public Member Functions | |
Construction | |
charset_tokeniser (char_type const *psz, delimiter_type const &charSet) | |
Tokenise the given C-string with the given delimiter. | |
template<typename S1> | |
charset_tokeniser (S1 const &str, delimiter_type const &charSet) | |
Tokenise the given string with the given delimiter. | |
charset_tokeniser (char_type const *psz, size_type cch, delimiter_type const &charSet) | |
Tokenise the specified length of the given string with the given delimiter. | |
template<typename I> | |
charset_tokeniser (I from, I to, delimiter_type const &charSet) | |
Tokenise the given range with the given delimiter. |
typedef charset_tokeniser<S, B, V, T, D, P> class_type |
The non-mutating (const) iterator type.
charset_tokeniser | ( | char_type const * | psz, | |
delimiter_type const & | charSet | |||
) | [inline] |
Tokenise the given C-string with the given delimiter.
psz | Pointer to C-string whose contents will be tokenised | |
charSet | The delimiter to perform the tokenisation |
psz
. It does not alter the contents of psz
charset_tokeniser | ( | S1 const & | str, | |
delimiter_type const & | charSet | |||
) | [inline] |
Tokenise the given string with the given delimiter.
str | The string whose contents will be tokenised | |
charSet | The delimiter to perform the tokenisation |
str
. It does not alter the contents of str
charset_tokeniser | ( | char_type const * | psz, | |
size_type | cch, | |||
delimiter_type const & | charSet | |||
) | [inline] |
Tokenise the specified length of the given string with the given delimiter.
psz | Pointer to C-string whose contents will be tokenised | |
cch | The number of characters in psz to use | |
charSet | The delimiter to perform the tokenisation |
psz
. It does not alter the contents of psz
charset_tokeniser | ( | I | from, | |
I | to, | |||
delimiter_type const & | charSet | |||
) | [inline] |
Tokenise the given range with the given delimiter.
from | The start of the asymmetric range to tokenise | |
to | The start of the asymmetric range to tokenise | |
charSet | The delimiter to use |