![]() |
libfilezilla
|
Container-like class that can be used to iterate over tokens in a string. More...
#include <string.hpp>
Classes | |
| struct | iterator |
| struct | sentinel |
Public Types | |
| using | value_type = const view_type |
| using | pointer = value_type * |
| using | reference = value_type & |
| using | size_type = std::size_t |
| using | difference_type = std::ptrdiff_t |
| using | const_value_type = value_type |
| using | const_pointer = pointer |
| using | const_reference = reference |
| using | const_iterator = iterator |
Public Member Functions | |
| constexpr | strtokenizer (String &&string, Delims &&delims, bool ignore_empty) |
| strtokenizer class constructor. More... | |
| constexpr iterator | begin () const |
| constexpr sentinel | end () const |
| constexpr const_iterator | cbegin () const |
| constexpr sentinel | cend () const |
Public Attributes | |
| String | string_ |
| Delims | delims_ |
| bool | ignore_empty_ |
Container-like class that can be used to iterate over tokens in a string.
The class will keep a copy of any temporary constructor's parameter. strtokenizer must live longer than the iterators created from it.
Access through the iterators returns views, make sure non-temporary arguments to strtokenizer constructur live longer than the iterators.
Do not modify a string for which there is an strtokenizer instance.
Always use the construction guide for this class, never explictly use the template parameters.
Usage example:
|
inline |
strtokenizer class constructor.
| delims | the delimiters to look for |
| ignore_empty | If true, empty tokens are omitted in the output |
1.8.10