header_utils
Loading...
Searching...
No Matches
ghassanpl::string_ops::split_range< SINGLE > Struct Template Reference

A very basic "range" (not really a C++ range yet) that can be iterated over as if its a range of elements in source split by split_on. More...

#include <string_ops.h>

Public Member Functions

 split_range (std::string_view source, char split_on)
 
split_range_iterator begin ()
 
split_range_iterator end ()
 
auto source () const
 Returns the source string we're splitting.
 
auto split_on () const
 Returns the character we're splitting on.
 

Detailed Description

template<bool SINGLE>
struct ghassanpl::string_ops::split_range< SINGLE >

A very basic "range" (not really a C++ range yet) that can be iterated over as if its a range of elements in source split by split_on.

Template Parameters
SINGLEif false, we ignore consecutive delimiters
Todo:
Make this an actual range

Definition at line 1552 of file string_ops.h.

Constructor & Destructor Documentation

◆ split_range()

template<bool SINGLE>
ghassanpl::string_ops::split_range< SINGLE >::split_range ( std::string_view  source,
char  split_on 
)
inline

Definition at line 1554 of file string_ops.h.

Member Function Documentation

◆ begin()

template<bool SINGLE>
split_range_iterator ghassanpl::string_ops::split_range< SINGLE >::begin ( )
inline

Definition at line 1598 of file string_ops.h.

◆ end()

template<bool SINGLE>
split_range_iterator ghassanpl::string_ops::split_range< SINGLE >::end ( )
inline

Definition at line 1604 of file string_ops.h.

◆ source()

template<bool SINGLE>
auto ghassanpl::string_ops::split_range< SINGLE >::source ( ) const
inline

Returns the source string we're splitting.

Definition at line 1610 of file string_ops.h.

◆ split_on()

template<bool SINGLE>
auto ghassanpl::string_ops::split_range< SINGLE >::split_on ( ) const
inline

Returns the character we're splitting on.

Definition at line 1612 of file string_ops.h.