OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
detail::SplitView Class Reference

#include <Split.h>

Inheritance diagram for detail::SplitView:
FileSystemPathSplit

Public Member Functions

 SplitView ()
 
 SplitView (std::string_view s, char sep)
 
auto begin () const
 
auto end () const
 
std::string_view string () const
 
char separator () const
 
template<class Container >
requires std::is_same_v<std::remove_cv_t<typename Container::value_type::value_type>, char>
 operator Container () const
 

Private Attributes

const char * _begin = nullptr
 
const char * _end = nullptr
 
char _sep = '\0'
 

Detailed Description

We use C++ and this is why we can't have nice things. It's 2024, we still can't split a string w/o jumping through hoops. Just look at this: https://cplusplus.github.io/LWG/issue4017. One option is to use std::views::drop in a hacky way to fix this. But then we run into the fact that std::views::split isn't even implemented in AppleClang 14...

So here is our own implementation. More user-friendly, and more efficient.

Constructor & Destructor Documentation

◆ SplitView() [1/2]

detail::SplitView::SplitView ( )
inline

◆ SplitView() [2/2]

detail::SplitView::SplitView ( std::string_view  s,
char  sep 
)
inline

Member Function Documentation

◆ begin()

auto detail::SplitView::begin ( ) const
inline

◆ end()

auto detail::SplitView::end ( ) const
inline

◆ operator Container()

template<class Container >
requires std::is_same_v<std::remove_cv_t<typename Container::value_type::value_type>, char>
detail::SplitView::operator Container ( ) const
inline

◆ separator()

char detail::SplitView::separator ( ) const
inline

◆ string()

std::string_view detail::SplitView::string ( ) const
inline

Member Data Documentation

◆ _begin

const char* detail::SplitView::_begin = nullptr
private

◆ _end

const char* detail::SplitView::_end = nullptr
private

◆ _sep

char detail::SplitView::_sep = '\0'
private

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