|
guanaqo
1.0.0-alpha.27
Utilities for scientific software
|
String utilities and portable parsing helpers.
Files | |
| file | duration-parse.hpp |
| Duration parsing helpers. | |
| file | from_chars-wrapper.hpp |
| Portable wrapper around std::from_chars for integers and floats. | |
| file | string-util.hpp |
| String utilities for splitting, joining, and sorting. | |
Classes | |
| struct | guanaqo::invalid_duration_value |
| struct | guanaqo::invalid_duration_units |
| struct | guanaqo::join_opt |
| struct | guanaqo::join_quote_opt |
Functions | |
| template<class Rep, class Period> | |
| std::string_view | guanaqo::parse_single_duration (std::chrono::duration< Rep, Period > &t, std::string_view s) |
Adds the first duration in the string s to the duration t. | |
| template<class Rep, class Period> | |
| void | guanaqo::parse_duration (std::chrono::duration< Rep, Period > &t, std::string_view s) |
Adds the sum of the durations in the string s to the duration t. | |
| template<class T> | |
| std::from_chars_result | guanaqo::from_chars (const char *first, const char *last, T &value, std::chars_format fmt=std::chars_format::general) |
| template<class T> | |
| std::from_chars_result | guanaqo::from_chars (const char *first, const char *last, T &value, int base=10) |
| template<class T, class... Args> | |
| std::from_chars_result | guanaqo::from_chars (const char *first, const char *last, T &value, std::chars_format fmt=std::chars_format::general) |
| template<class T, class... Args> | |
| std::from_chars_result | guanaqo::from_chars (const char *first, const char *last, T &value, int base=10) |
| auto | guanaqo::split (std::string_view full, std::string_view tok) |
Split the string full on the first occurrence of tok. | |
| auto | guanaqo::split_second (std::string_view full, std::string_view tok) |
Split the string s on the first occurrence of tok. | |
| std::string | guanaqo::join (std::ranges::input_range auto strings, join_opt opt={}) |
Join the list of strings into a single string, using the separator given by opt. | |
| std::string | guanaqo::join_quote (std::ranges::input_range auto strings, join_quote_opt opt={}) |
Join the list of strings into a single string, using the separator given by opt. | |
| void | guanaqo::sort_case_insensitive (auto &range) |
| Sort the given range of strings in-place in a case-insensitive manner. | |
| struct guanaqo::join_opt |
| struct guanaqo::join_quote_opt |
| std::string_view guanaqo::parse_single_duration | ( | std::chrono::duration< Rep, Period > & | t, |
| std::string_view | s ) |
#include <guanaqo/duration-parse.hpp>
Adds the first duration in the string s to the duration t.
Definition at line 34 of file duration-parse.hpp.
| void guanaqo::parse_duration | ( | std::chrono::duration< Rep, Period > & | t, |
| std::string_view | s ) |
#include <guanaqo/duration-parse.hpp>
Adds the sum of the durations in the string s to the duration t.
Definition at line 77 of file duration-parse.hpp.
| std::from_chars_result guanaqo::from_chars | ( | const char * | first, |
| const char * | last, | ||
| T & | value, | ||
| std::chars_format | fmt = std::chars_format::general ) |
#include <guanaqo/from_chars-wrapper.hpp>
Definition at line 51 of file from_chars-wrapper.hpp.
| std::from_chars_result guanaqo::from_chars | ( | const char * | first, |
| const char * | last, | ||
| T & | value, | ||
| int | base = 10 ) |
#include <guanaqo/from_chars-wrapper.hpp>
Definition at line 63 of file from_chars-wrapper.hpp.
| std::from_chars_result guanaqo::from_chars | ( | const char * | first, |
| const char * | last, | ||
| T & | value, | ||
| std::chars_format | fmt = std::chars_format::general ) |
#include <guanaqo/from_chars-wrapper.hpp>
Definition at line 75 of file from_chars-wrapper.hpp.
| std::from_chars_result guanaqo::from_chars | ( | const char * | first, |
| const char * | last, | ||
| T & | value, | ||
| int | base = 10 ) |
#include <guanaqo/from_chars-wrapper.hpp>
Definition at line 112 of file from_chars-wrapper.hpp.
|
inline |
#include <guanaqo/string-util.hpp>
Split the string full on the first occurrence of tok.
Returns (s, "") if tok was not found.
Definition at line 21 of file string-util.hpp.
|
inline |
#include <guanaqo/string-util.hpp>
Split the string s on the first occurrence of tok.
Returns ("", s) if tok was not found.
Definition at line 37 of file string-util.hpp.
| std::string guanaqo::join | ( | std::ranges::input_range auto | strings, |
| join_opt | opt = {} ) |
#include <guanaqo/string-util.hpp>
Join the list of strings into a single string, using the separator given by opt.
Definition at line 60 of file string-util.hpp.
| std::string guanaqo::join_quote | ( | std::ranges::input_range auto | strings, |
| join_quote_opt | opt = {} ) |
#include <guanaqo/string-util.hpp>
Join the list of strings into a single string, using the separator given by opt.
Each original string is quoted using the quote strings specified by opt
Definition at line 87 of file string-util.hpp.
| void guanaqo::sort_case_insensitive | ( | auto & | range | ) |
#include <guanaqo/string-util.hpp>
Sort the given range of strings in-place in a case-insensitive manner.
Definition at line 109 of file string-util.hpp.