|
template<typename T, enable_if_t<!std::is_integral< T >::value||(sizeof(T)<=1U), detail::enabler > = detail::dummy> |
Option * | default_flag_modifiers (Option *opt) |
| helper functions for adding in appropriate flag modifiers for add_flag
|
template<typename T, enable_if_t< std::is_integral< T >::value &&(sizeof(T) > 1U), detail::enabler > = detail::dummy> |
Option * | default_flag_modifiers (Option *opt) |
| summing modifiers
|
std::string | convert_arg_for_ini (const std::string &arg, char stringQuote='"', char literalQuote = '\'', bool disable_multi_line = false) |
std::string | ini_join (const std::vector< std::string > &args, char sepChar=',', char arrayStart='[', char arrayEnd=']', char stringQuote='"', char literalQuote = '\'') |
| Comma separated join, adds quotes if needed.
|
void | clean_name_string (std::string &name, const std::string &keyChars) |
std::vector< std::string > | generate_parents (const std::string §ion, std::string &name, char parentSeparator) |
void | checkParentSegments (std::vector< ConfigItem > &output, const std::string ¤tSection, char parentSeparator) |
| assuming non default segments do a check on the close and open of the segments in a configItem structure
|
CLI11_INLINE bool | split_short (const std::string ¤t, std::string &name, std::string &rest) |
CLI11_INLINE bool | split_long (const std::string ¤t, std::string &name, std::string &value) |
CLI11_INLINE bool | split_windows_style (const std::string ¤t, std::string &name, std::string &value) |
CLI11_INLINE std::vector< std::string > | split_names (std::string current) |
CLI11_INLINE 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 !
|
CLI11_INLINE std::tuple< std::vector< std::string >, std::vector< std::string >, std::string > | get_names (const std::vector< std::string > &input, bool allow_non_standard=false) |
| Get a vector of short names, one of long names, and a single name.
|
CLI11_INLINE std::vector< std::string > | split (const std::string &s, char delim) |
| Split a string by a delim.
|
template<typename T> |
std::string | join (const T &v, std::string delim=",") |
| Simple function to join a string.
|
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.
|
template<typename T> |
std::string | rjoin (const T &v, std::string delim=",") |
| Join a string in reverse order.
|
CLI11_INLINE std::string & | ltrim (std::string &str) |
| Trim whitespace from left of string.
|
CLI11_INLINE std::string & | ltrim (std::string &str, const std::string &filter) |
| Trim anything from left of string.
|
CLI11_INLINE std::string & | rtrim (std::string &str) |
| Trim whitespace from right of string.
|
CLI11_INLINE std::string & | rtrim (std::string &str, const std::string &filter) |
| Trim anything from right of string.
|
std::string & | trim (std::string &str) |
| Trim whitespace from string.
|
std::string & | trim (std::string &str, const std::string filter) |
| Trim anything from string.
|
std::string | trim_copy (const std::string &str) |
| Make a copy of the string and then trim it.
|
CLI11_INLINE std::string & | remove_quotes (std::string &str) |
| remove quotes at the front and back of a string either '"' or '\''
|
CLI11_INLINE void | remove_quotes (std::vector< std::string > &args) |
| remove quotes from all elements of a string vector and process escaped components
|
CLI11_INLINE std::string | fix_newlines (const std::string &leader, std::string input) |
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)
|
CLI11_INLINE std::ostream & | format_aliases (std::ostream &out, const std::vector< std::string > &aliases, std::size_t wid) |
| Print subcommand aliases.
|
template<typename T> |
bool | valid_first_char (T c) |
template<typename T> |
bool | valid_later_char (T c) |
| Verify following characters of an option.
|
CLI11_INLINE bool | valid_name_string (const std::string &str) |
| Verify an option/subcommand name.
|
bool | valid_alias_name_string (const std::string &str) |
| Verify an app name.
|
bool | is_separator (const std::string &str) |
| check if a string is a container segment separator (empty or "%%")
|
bool | isalpha (const std::string &str) |
| Verify that str consists of letters only.
|
std::string | to_lower (std::string str) |
| Return a lower case version of a string.
|
std::string | remove_underscore (std::string str) |
| remove underscores from a string
|
CLI11_INLINE std::string | find_and_replace (std::string str, std::string from, std::string to) |
| Find and replace a substring with another substring.
|
bool | has_default_flag_values (const std::string &flags) |
| check if the flag definitions has possible false flags
|
CLI11_INLINE void | remove_default_flag_values (std::string &flags) |
CLI11_INLINE 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.
|
template<typename Callable> |
std::string | find_and_modify (std::string str, std::string trigger, Callable modify) |
CLI11_INLINE std::vector< std::string > | split_up (std::string str, char delimiter='\0') |
CLI11_INLINE std::string | get_environment_value (const std::string &env_name) |
| get the value of an environmental variable or empty string if empty
|
CLI11_INLINE std::size_t | escape_detect (std::string &str, std::size_t offset) |
CLI11_INLINE bool | has_escapable_character (const std::string &str) |
| detect if a string has escapable characters
|
CLI11_INLINE std::string | add_escaped_characters (const std::string &str) |
| escape all escapable characters
|
CLI11_INLINE std::string | remove_escaped_characters (const std::string &str) |
| replace the escaped characters with their equivalent
|
CLI11_INLINE std::string | binary_escape_string (const std::string &string_to_escape) |
| generate a string with all non printable characters escaped to hex codes
|
CLI11_INLINE bool | is_binary_escaped_string (const std::string &escaped_string) |
CLI11_INLINE std::string | extract_binary_string (const std::string &escaped_string) |
| extract an escaped binary_string
|
CLI11_INLINE bool | process_quoted_string (std::string &str, char string_char='\"', char literal_char = '\'') |
| process a quoted string, remove the quotes and if appropriate handle escaped characters
|
CLI11_INLINE std::ostream & | streamOutAsParagraph (std::ostream &out, const std::string &text, std::size_t paragraphWidth, const std::string &linePrefix="", bool skipPrefixOnFirstLine=false) |
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.
|
template<typename T, enable_if_t<!is_istreamable< T >::value, detail::enabler > = detail::dummy> |
bool | from_stream (const std::string &, T &) |
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)
|
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 (T &&value) |
| Construct a string from the object.
|
template<typename T, enable_if_t<!std::is_convertible< T, std::string >::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)
|
template<typename T, enable_if_t<!std::is_convertible< T, std::string >::value &&!std::is_constructible< std::string, T >::value &&!is_ostreamable< T >::value &&is_tuple_like< T >::value &&type_count_base< T >::value==1, detail::enabler > = detail::dummy> |
std::string | to_string (T &&value) |
| Print tuple value string for tuples of size ==1.
|
template<typename T, enable_if_t<!std::is_convertible< T, std::string >::value &&!std::is_constructible< std::string, T >::value &&!is_ostreamable< T >::value &&is_tuple_like< T >::value &&type_count_base< T >::value > = 2, detail::enabler> |
std::string | to_string (T &&value) |
| Print tuple value string for tuples of size > 1.
|
template<typename T, enable_if_t<!std::is_convertible< T, std::string >::value &&!std::is_constructible< std::string, T >::value &&!is_ostreamable< T >::value &&!is_readable_container< typename std::remove_const< T >::type >::value &&!is_tuple_like< T >::value, detail::enabler > = detail::dummy> |
std::string | to_string (T &&) |
| If conversion is not supported, return an empty string (streaming is not supported for that type)
|
template<typename T, enable_if_t<!std::is_convertible< T, std::string >::value &&!std::is_constructible< std::string, T >::value &&!is_ostreamable< T >::value &&is_readable_container< T >::value, detail::enabler > = detail::dummy> |
std::string | to_string (T &&variable) |
| convert a readable container to a string
|
template<typename T, std::size_t I> |
std::enable_if< I==type_count_base< T >::value, std::string >::type | tuple_value_string (T &&) |
| Convert a tuple like object to a string.
|
template<typename T, std::size_t I> |
std::enable_if<(I< type_count_base< T >::value), std::string >::type | tuple_value_string (T &&value) |
| Recursively generate the tuple value string.
|
template<typename T, enable_if_t<!std::is_convertible< T, std::string >::value &&!std::is_constructible< std::string, T >::value &&!is_ostreamable< T >::value &&is_tuple_like< T >::value &&type_count_base< T >::value > = 2> |
std::string | to_string (T &&value) |
| Print tuple value string for tuples of size > 1.
|
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
|
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
|
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
|
template<typename T, enable_if_t< std::is_enum< T >::value, detail::enabler > = detail::dummy> |
std::string | value_string (const T &value) |
| get a string as a convertible value for enumerations
|
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
|
template<typename T, std::size_t I> |
constexpr std::enable_if< I==type_count_base< T >::value, int >::type | tuple_type_size () |
| 0 if the index > tuple size
|
CLI11_INLINE path_type | check_path (const char *file) noexcept |
| get the type of the path from a file name
|
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.
|
template<typename T> |
std::string | generate_map (const T &map, bool key_only=false) |
| Generate a string representation of a map.
|
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.
|
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 that uses the built in find function.
|
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.
|
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.
|
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.
|
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.
|
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.
|
CLI11_INLINE std::pair< std::string, std::string > | split_program_name (std::string commandline) |