BenBot 1.7.5
A chess engine
Loading...
Searching...
No Matches
util::strings Namespace Reference

Classes

class  string
 STL class. More...
class  string_view
 STL class. More...
struct  TextTable

Typedefs

using StringViewPair = std::pair<string_view, string_view>

Functions

template<std::integral Int>
constexpr Int int_from_string (const string_view text, Int defaultValue) noexcept
auto trim (string_view text) -> string_view
auto split_at_first_space (string_view input) -> StringViewPair
auto split_at_first_space_or_newline (string_view input) -> StringViewPair
auto find_matching_close_paren (string_view input) -> std::expected< size_t, std::string >
template<std::integral Int>
constexpr auto int_from_string (string_view text, Int defaultValue=0) noexcept -> Int
template<size_t MaxLen = 5uz>
void write_integer (std::integral auto value, std::string &output)
auto split_by_delim (string_view text, char delim)
auto lines_view (string_view text)
auto words_view (string_view text)

Detailed Description

This namespace string handling functions.

Function Documentation

◆ int_from_string()

template<std::integral Int>
Int util::strings::int_from_string ( string_view text,
Int defaultValue = 0 ) -> Int
nodiscardconstexprnoexcept

Reads an integer from the input string using std::from_chars.

See also
write_integer()

Definition at line 153 of file Strings.hpp.