|
std::string | convert_arg_for_ini (const std::string &arg) |
|
std::string | ini_join (const std::vector< std::string > &args, char sepChar=',', char arrayStart='[', char arrayEnd=']') |
| Comma separated join, adds quotes if needed. More...
|
|
std::vector< std::string > | generate_parents (const std::string §ion, std::string &name) |
|
void | checkParentSegments (std::vector< ConfigItem > &output, const std::string ¤tSection) |
| assuming non default segments do a check on the close and open of the segments in a configItem structure More...
|
|
bool | split_short (const std::string ¤t, std::string &name, std::string &rest) |
|
bool | split_long (const std::string ¤t, std::string &name, std::string &value) |
|
bool | split_windows_style (const std::string ¤t, std::string &name, std::string &value) |
|
std::vector< std::string > | split_names (std::string current) |
|
std::vector< std::pair< std::string, std::string > > | get_default_flag_values (const std::string &str) |
| extract default flag values either {def} or starting with a ! More...
|
|
std::tuple< std::vector< std::string >, std::vector< std::string >, std::string > | get_names (const std::vector< std::string > &input) |
| Get a vector of short names, one of long names, and a single name. More...
|
|
std::vector< std::string > | split (const std::string &s, char delim) |
| Split a string by a delim. More...
|
|
template<typename T > |
std::string | join (const T &v, std::string delim=",") |
| Simple function to join a string. More...
|
|
template<typename T , typename Callable , typename = typename std::enable_if<!std::is_constructible<std::string, Callable>::value>::type> |
std::string | join (const T &v, Callable func, std::string delim=",") |
| Simple function to join a string from processed elements. More...
|
|
template<typename T > |
std::string | rjoin (const T &v, std::string delim=",") |
| Join a string in reverse order. More...
|
|
std::string & | ltrim (std::string &str) |
| Trim whitespace from left of string. More...
|
|
std::string & | ltrim (std::string &str, const std::string &filter) |
| Trim anything from left of string. More...
|
|
std::string & | rtrim (std::string &str) |
| Trim whitespace from right of string. More...
|
|
std::string & | rtrim (std::string &str, const std::string &filter) |
| Trim anything from right of string. More...
|
|
std::string & | trim (std::string &str) |
| Trim whitespace from string. More...
|
|
std::string & | trim (std::string &str, const std::string filter) |
| Trim anything from string. More...
|
|
std::string | trim_copy (const std::string &str) |
| Make a copy of the string and then trim it. More...
|
|
std::string & | remove_quotes (std::string &str) |
| remove quotes at the front and back of a string either '"' or '\'' More...
|
|
std::string | trim_copy (const std::string &str, const std::string &filter) |
| Make a copy of the string and then trim it, any filter string can be used (any char in string is filtered) More...
|
|
std::ostream & | format_help (std::ostream &out, std::string name, std::string description, std::size_t wid) |
| Print a two part "help" string. More...
|
|
template<typename T > |
bool | valid_first_char (T c) |
| Verify the first character of an option. More...
|
|
template<typename T > |
bool | valid_later_char (T c) |
| Verify following characters of an option. More...
|
|
bool | valid_name_string (const std::string &str) |
| Verify an option name. More...
|
|
bool | isalpha (const std::string &str) |
| Verify that str consists of letters only. More...
|
|
std::string | to_lower (std::string str) |
| Return a lower case version of a string. More...
|
|
std::string | remove_underscore (std::string str) |
| remove underscores from a string More...
|
|
std::string | find_and_replace (std::string str, std::string from, std::string to) |
| Find and replace a substring with another substring. More...
|
|
bool | has_default_flag_values (const std::string &flags) |
| check if the flag definitions has possible false flags More...
|
|
void | remove_default_flag_values (std::string &flags) |
|
std::ptrdiff_t | find_member (std::string name, const std::vector< std::string > names, bool ignore_case=false, bool ignore_underscore=false) |
| Check if a string is a member of a list of strings and optionally ignore case or ignore underscores. More...
|
|
template<typename Callable > |
std::string | find_and_modify (std::string str, std::string trigger, Callable modify) |
|
std::vector< std::string > | split_up (std::string str, char delimiter='\0') |
|
std::string | fix_newlines (const std::string &leader, std::string input) |
|
std::size_t | escape_detect (std::string &str, std::size_t offset) |
|
std::string & | add_quotes_if_needed (std::string &str) |
| Add quotes if the string contains spaces. More...
|
|
template<typename T , enable_if_t< is_istreamable< T >::value, detail::enabler > = detail::dummy> |
bool | from_stream (const std::string &istring, T &obj) |
| Templated operation to get a value from a stream. More...
|
|
template<typename T , enable_if_t< std::is_convertible< T, std::string >::value, detail::enabler > = detail::dummy> |
auto | to_string (T &&value) -> decltype(std::forward< T >(value)) |
| Convert an object to a string (directly forward if this can become a string) More...
|
|
template<typename T , enable_if_t< std::is_constructible< std::string, T >::value &&!std::is_convertible< T, std::string >::value, detail::enabler > = detail::dummy> |
std::string | to_string (const T &value) |
| Construct a string from the object. More...
|
|
template<typename T , enable_if_t<!std::is_convertible< std::string, T >::value &&!std::is_constructible< std::string, T >::value &&is_ostreamable< T >::value, detail::enabler > = detail::dummy> |
std::string | to_string (T &&value) |
| Convert an object to a string (streaming must be supported for that type) More...
|
|
template<typename T1 , typename T2 , typename T , enable_if_t< std::is_same< T1, T2 >::value, detail::enabler > = detail::dummy> |
auto | checked_to_string (T &&value) -> decltype(to_string(std::forward< T >(value))) |
| special template overload More...
|
|
template<typename T1 , typename T2 , typename T , enable_if_t<!std::is_same< T1, T2 >::value, detail::enabler > = detail::dummy> |
std::string | checked_to_string (T &&) |
| special template overload More...
|
|
template<typename T , enable_if_t< std::is_arithmetic< T >::value, detail::enabler > = detail::dummy> |
std::string | value_string (const T &value) |
| get a string as a convertible value for arithmetic types More...
|
|
template<typename T , enable_if_t<!std::is_enum< T >::value &&!std::is_arithmetic< T >::value, detail::enabler > = detail::dummy> |
auto | value_string (const T &value) -> decltype(to_string(value)) |
| for other types just use the regular to_string function More...
|
|
template<typename T , enable_if_t< classify_object< T >::value==object_category::integral_value||classify_object< T >::value==object_category::integer_constructible, detail::enabler > = detail::dummy> |
constexpr const char * | type_name () |
| Print name for enumeration types. More...
|
|
std::size_t I std::enable_if< I==type_count< T >::value, std::string >::type | tuple_name () |
|
template<typename T , std::size_t I> |
std::enable_if< I< type_count< T >::value, std::string >::type tuple_name() { std::string str=std::string(type_name< typename std::tuple_element< I, T >::type >))+','+tuple_name< T, I+1 >);if(str.back()==',') str.pop_back();return str;}template< typename T, enable_if_t< classify_object< T >::value==object_category::tuple_value &&type_count< T >::value >=2, detail::enabler >=detail::dummy > std::string | type_name () |
| Recursively generate the tuple type name. More...
|
|
template<typename T , enable_if_t< classify_object< T >::value==object_category::vector_value, detail::enabler > = detail::dummy> |
std::string | type_name () |
| This one should not be used normally, since vector types print the internal type. More...
|
|
std::int64_t | to_flag_value (std::string val) |
| Convert a flag into an integer value typically binary flags. More...
|
|
template<typename T , enable_if_t< classify_object< T >::value==object_category::integral_value, detail::enabler > = detail::dummy> |
bool | lexical_cast (const std::string &input, T &output) |
| Signed integers. More...
|
|
template<typename T , typename XC , enable_if_t< std::is_same< T, XC >::value &&(classify_object< T >::value==object_category::string_assignable||classify_object< T >::value==object_category::string_constructible), detail::enabler > = detail::dummy> |
bool | lexical_assign (const std::string &input, T &output) |
| Assign a value through lexical cast operations. More...
|
|
template<typename T , typename XC , enable_if_t<!is_tuple_like< T >::value &&!is_tuple_like< XC >::value &&!is_vector< T >::value &&!is_vector< XC >::value, detail::enabler > = detail::dummy> |
bool | lexical_conversion (const std::vector< std ::string > &strings, T &output) |
| Lexical conversion if there is only one element. More...
|
|
bool ::type | tuple_conversion (const std::vector< std::string > &, T &) |
|
path_type | check_path (const char *file) noexcept |
| get the type of the path from a file name More...
|
|
template<typename T , enable_if_t< is_copyable_ptr< typename std::remove_reference< T >::type >::value, detail::enabler > = detail::dummy> |
auto | smart_deref (T value) -> decltype(*value) |
|
template<typename T , enable_if_t<!is_copyable_ptr< typename std::remove_reference< T >::type >::value, detail::enabler > = detail::dummy> |
std::remove_reference< T >::type & | smart_deref (T &value) |
|
template<typename T > |
std::string | generate_set (const T &set) |
| Generate a string representation of a set. More...
|
|
template<typename T > |
std::string | generate_map (const T &map, bool key_only=false) |
| Generate a string representation of a map. More...
|
|
template<typename T , typename V , enable_if_t<!has_find< T, V >::value, detail::enabler > = detail::dummy> |
auto | search (const T &set, const V &val) -> std::pair< bool, decltype(std::begin(detail::smart_deref(set)))> |
| A search function. More...
|
|
template<typename T , typename V > |
auto | search (const T &set, const V &val, const std::function< V(V)> &filter_function) -> std::pair< bool, decltype(std::begin(detail::smart_deref(set)))> |
| A search function with a filter function. More...
|
|
template<typename T > |
std::enable_if< std::is_signed< T >::value, T >::type | overflowCheck (const T &a, const T &b) |
| Do a check for overflow on signed numbers. More...
|
|
template<typename T > |
std::enable_if<!std::is_signed< T >::value, T >::type | overflowCheck (const T &a, const T &b) |
| Do a check for overflow on unsigned numbers. More...
|
|
template<typename T > |
std::enable_if< std::is_integral< T >::value, bool >::type | checked_multiply (T &a, T b) |
| Performs a *= b; if it doesn't cause integer overflow. Returns false otherwise. More...
|
|
template<typename T > |
std::enable_if< std::is_floating_point< T >::value, bool >::type | checked_multiply (T &a, T b) |
| Performs a *= b; if it doesn't equal infinity. Returns false otherwise. More...
|
|
std::pair< std::string, std::string > | split_program_name (std::string commandline) |
|