Ookii.CommandLine for C++  2.0.0
Classes | Namespaces | Functions
string_helper.h File Reference

Provides helper types and functions for working with strings. More...

#include <locale>
#include <sstream>
#include <optional>
#include <array>
#include <string>
#include <string_view>
#include <algorithm>
Include dependency graph for string_helper.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ookii::char_less
 A version of the std::less predicate for characters that supports case insensitive comparison. More...
 
struct  ookii::lexical_convert< T, CharType, Traits, Alloc >
 Template class used to convert strings to strongly typed argument values. More...
 
struct  ookii::lexical_convert< std::basic_string< CharType, Traits, Alloc >, CharType, Traits, Alloc >
 Specialization of lexical_convert for strings. More...
 
struct  ookii::string_convert< CharType, Traits, Alloc >
 Performs a simple conversion of a narrow character string to a specified character type. More...
 
struct  ookii::string_convert< char, Traits, Alloc >
 Specialization of string_convert where the target type is also char. More...
 
struct  ookii::string_less
 A version of the std::less predicate for strings that supports case insensitive comparison. More...
 
class  ookii::tokenize< CharType, Traits >
 A pseudo-range for string tokenization. More...
 

Namespaces

 ookii
 Namespace containing the core Ookii.CommandLine.Cpp types.
 

Functions

template<typename CharType , size_t Length>
constexpr const std::array< CharType, Length > ookii::literal_cast (const char(&value)[Length])
 Converts a simple ASCII string literal to the specified character type at compile time. More...
 
template<typename CharType , typename Traits >
std::tuple< std::basic_string_view< CharType, Traits >, std::optional< std::basic_string_view< CharType, Traits > > > ookii::split_once (std::basic_string_view< CharType, Traits > value, CharType separator)
 Splits a string on the first occurrence of a separator. More...
 
template<typename CharType , typename Traits >
bool ookii::string_equal_case_insensitive (std::basic_string_view< CharType, Traits > string1, std::basic_string_view< CharType, Traits > string2, const std::locale &locale={})
 Compares two strings, ignoring their case. More...
 
template<typename CharType , typename Traits >
std::optional< std::basic_string_view< CharType, Traits > > ookii::strip_prefix (std::basic_string_view< CharType, Traits > value, std::basic_string_view< CharType, Traits > prefix)
 Removes a prefix from a string. More...
 

Detailed Description

Provides helper types and functions for working with strings.