Ookii.CommandLine for C++  2.0.0
Classes | Public Member Functions | List of all members
ookii::tokenize< CharType, Traits > Class Template Reference

A pseudo-range for string tokenization. More...

#include <ookii/string_helper.h>

Public Member Functions

 tokenize (typename iterator::value_type value, CharType separator) noexcept
 Initializes a new instance of the tokenize class. More...
 
iterator begin () const noexcept
 Gets a forward iterator to the first token.
 
iterator end () const noexcept
 Gets an iterator that will compare equal once the iterator returned by begin() no longer has any tokens to return.
 

Detailed Description

template<typename CharType, typename Traits = std::char_traits<CharType>>
class ookii::tokenize< CharType, Traits >

A pseudo-range for string tokenization.

This type lets the user tokenize a string and iterate over the results. It's not quite a real range, so cannot be used with view adapters.

Template Parameters
CharTypeThe character type of the string to tokenize.
TraitsThe character traits of the string to tokenize. Defaults to std::char_traits<CharType>.

Constructor & Destructor Documentation

◆ tokenize()

template<typename CharType , typename Traits = std::char_traits<CharType>>
ookii::tokenize< CharType, Traits >::tokenize ( typename iterator::value_type  value,
CharType  separator 
)
inlinenoexcept

Initializes a new instance of the tokenize class.

Parameters
valueThe string to tokenize.
separatorThe separator that divides the tokens.

The documentation for this class was generated from the following file: