Loading...
Searching...
No Matches
CLI::detail Namespace Reference

## Classes

struct | AppFriend
| This class is simply to allow tests access to App's protected functions. More...
class | IPV4Validator
| Validate the given string is a legal ipv4 address. More...
struct | has_find
struct | element_type
| not a pointer More...
struct | element_type< T, typename std::enable_if< is_copyable_ptr< T >::value >::type >
struct | element_value_type
struct | pair_adaptor
| Adaptor for set-like structure: This just wraps a normal container in a few utilities that do almost nothing. More...
struct | pair_adaptor< T, conditional_t< false, void_t< typename T::value_type::first_type, typename T::value_type::second_type >, void > >
class | is_direct_constructible
class | is_ostreamable
class | is_istreamable
| Check for input streamability. More...
class | is_complex
| Check for complex. More...
struct | is_mutable_container
struct | is_mutable_container< T, conditional_t< false, void_t< typename T::value_type, decltype(std::declval< T >().end()), decltype(std::declval< T >().clear()), decltype(std::declval< T >().insert(std::declval< decltype(std::declval< T >().end())>(), std::declval< const typename T::value_type & >()))>, void > >
struct | is_readable_container
struct | is_readable_container< T, conditional_t< false, void_t< decltype(std::declval< T >().end()), decltype(std::declval< T >().begin())>, void > >
struct | is_wrapper
struct | is_wrapper< T, conditional_t< false, void_t< typename T::value_type >, void > >
class | is_tuple_like
struct | type_count_base
| This will only trigger for actual void type. More...
struct | type_count_base< T, typename std::enable_if<!is_tuple_like< T >::value &&!is_mutable_container< T >::value &&!std::is_void< T >::value >::type >
| Type size for regular object types that do not look like a tuple. More...
struct | type_count_base< T, typename std::enable_if< is_tuple_like< T >::value &&!is_mutable_container< T >::value >::type >
| the base tuple size More...
struct | type_count_base< T, typename std::enable_if< is_mutable_container< T >::value >::type >
| Type count base for containers is the type_count_base of the individual element. More...
struct | wrapped_type
| template to get the underlying value type if it exists or use a default More...
struct | wrapped_type< T, def, typename std::enable_if< is_wrapper< T >::value >::type >
| Type size for regular object types that do not look like a tuple. More...
struct | subtype_count
| Set of overloads to get the type size of an object. More...
struct | subtype_count_min
| forward declare the subtype_count_min structure More...
struct | type_count
| This will only trigger for actual void type. More...
struct | type_count< T, typename std::enable_if<!is_wrapper< T >::value &&!is_tuple_like< T >::value &&!is_complex< T >::value &&!std::is_void< T >::value >::type >
| Type size for regular object types that do not look like a tuple. More...
struct | type_count< T, typename std::enable_if< is_complex< T >::value >::type >
| Type size for complex since it sometimes looks like a wrapper. More...
struct | type_count< T, typename std::enable_if< is_mutable_container< T >::value >::type >
| Type size of types that are wrappers,except complex and tuples(which can also be wrappers sometimes). More...
struct | type_count< T, typename std::enable_if< is_wrapper< T >::value &&!is_complex< T >::value &&!is_tuple_like< T >::value &&!is_mutable_container< T >::value >::type >
| Type size of types that are wrappers,except containers complex and tuples(which can also be wrappers sometimes). More...
class | ExistingFileValidator
| Check for an existing file (returns error message if check fails). More...
class | ExistingDirectoryValidator
| Check for an existing directory (returns error message if check fails). More...
class | ExistingPathValidator
| Check for an existing path. More...
class | NonexistentPathValidator
| Check for an non-existing path. More...
class | EscapedStringTransformer

## Enumerations

enum class | Classifier : std::uint8_t { NONE , POSITIONAL_MARK , SHORT , LONG , WINDOWS_STYLE , SUBCOMMAND , SUBCOMMAND_TERMINATOR }
enum class | enabler : std::uint8_t
| Simple empty scoped class. More...
enum class | path_type : std::uint8_t { nonexistent , file , directory }
| CLI enumeration of different file types. More...

## Functions

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 &section, std::string &name, char parentSeparator)
void | checkParentSegments (std::vector< ConfigItem > &output, const std::string &currentSection, char parentSeparator)
| assuming non default segments do a check on the close and open of the segments in a configItem structure
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.
CLI11_INLINE bool | split_short (const std::string &current, std::string &name, std::string &rest)
CLI11_INLINE bool | split_long (const std::string &current, std::string &name, std::string &value)
CLI11_INLINE bool | split_windows_style (const std::string &current, 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 | get_group_separators ()
| get valid group separators _' + local separator if different
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::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, bool force=false)
| 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 = '\'', bool disable_secondary_array_processing = false)
| 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 &&!is_tuple_like< 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>
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)

## Variables

constexpr int | expected_max_vector_size {1 << 29}
constexpr enabler | dummy = {}
| An instance to use in EnableIf.

## Enumeration Type Documentation

## Classifier

enum class CLI::detail::Classifier : std::uint8_t

strong

Enumerator
NONE |
POSITIONAL_MARK |
SHORT |
LONG |
WINDOWS_STYLE |
SUBCOMMAND |
SUBCOMMAND_TERMINATOR |

## enabler

enum class CLI::detail::enabler : std::uint8_t

strong

Simple empty scoped class.

## path_type

enum class CLI::detail::path_type : std::uint8_t

strong

CLI enumeration of different file types.

Enumerator
nonexistent |
file |
directory |

## Function Documentation

## add_escaped_characters()

CLI11_INLINE std::string CLI::detail::add_escaped_characters | ( | const std::string & | str | ) |

escape all escapable characters

Parameters

  str | the string to escape

Returns
  a string with the escapable characters escaped with '\'

## binary_escape_string()

CLI11_INLINE std::string CLI::detail::binary_escape_string | ( | const std::string & | string_to_escape,
|  | bool | force = false )

generate a string with all non printable characters escaped to hex codes

## check_path()

CLI11_INLINE path_type CLI::detail::check_path | ( | const char * | file | ) |

noexcept

get the type of the path from a file name

## checked_multiply() [1/2]

template<typename T>

std::enable_if< std::is_floating_point< T >::value, bool >::type CLI::detail::checked_multiply | ( | T & | a,
|  | T | b )

Performs a *= b; if it doesn't equal infinity. Returns false otherwise.

## checked_multiply() [2/2]

template<typename T>

std::enable_if< std::is_integral< T >::value, bool >::type CLI::detail::checked_multiply | ( | T & | a,
|  | T | b )

Performs a *= b; if it doesn't cause integer overflow. Returns false otherwise.

## checked_to_string() [1/2]

template<typename T1, typename T2, typename T, enable_if_t<!std::is_same< T1, T2 >::value, detail::enabler > = detail::dummy>

std::string CLI::detail::checked_to_string | ( | T && |  | ) |

special template overload

## checked_to_string() [2/2]

template<typename T1, typename T2, typename T, enable_if_t< std::is_same< T1, T2 >::value, detail::enabler > = detail::dummy>

auto CLI::detail::checked_to_string | ( | T && | value | ) | ->decltype(to_string(std::forward< T >(value)))

special template overload

## checkParentSegments()

void CLI::detail::checkParentSegments | ( | std::vector< ConfigItem > & | output,
|  | const std::string & | currentSection,
|  | char | parentSeparator )

assuming non default segments do a check on the close and open of the segments in a configItem structure

## clean_name_string()

void CLI::detail::clean_name_string | ( | std::string & | name,
|  | const std::string & | keyChars )

## convert_arg_for_ini()

std::string CLI::detail::convert_arg_for_ini | ( | const std::string & | arg,
|  | char | stringQuote = '"',
|  | char | literalQuote = '\'',
|  | bool | disable_multi_line = false )

## default_flag_modifiers() [1/2]

template<typename T, enable_if_t< std::is_integral< T >::value &&(sizeof(T) > 1U), detail::enabler > = detail::dummy>

Option * CLI::detail::default_flag_modifiers | ( | Option * | opt | ) |

summing modifiers

## default_flag_modifiers() [2/2]

template<typename T, enable_if_t<!std::is_integral< T >::value||(sizeof(T)<=1U), detail::enabler > = detail::dummy>

Option * CLI::detail::default_flag_modifiers | ( | Option * | opt | ) |

helper functions for adding in appropriate flag modifiers for add_flag

## escape_detect()

CLI11_INLINE std::size_t CLI::detail::escape_detect | ( | std::string & | str,
|  | std::size_t | offset )

close a sequence of characters indicated by a closure character. Brackets allows sub sequences recognized bracket sequences include "'`[(<{ other closure characters are assumed to be literal strings */ CLI11_INLINE std::size_t close_sequence(const std::string &str, std::size_t start, char closure_char); /** Split a string '"one two" "three"' into 'one two', 'three' Quote characters can be ` ' or " or bracket characters [{(< with matching to the matching bracket */ CLI11_INLINE std::vector<std::string> split_up(std::string str, char delimiter = '\0');

/ get the value of an environmental variable or empty string if empty CLI11_INLINE std::string get_environment_value(const std::string &env_name);

/** This function detects an equal or colon followed by an escaped quote after an argument then modifies the string to replace the equality with a space. This is needed to allow the split up function to work properly and is intended to be used with the find_and_modify function the return value is the offset+1 which is required by the find_and_modify function.

## extract_binary_string()

CLI11_INLINE std::string CLI::detail::extract_binary_string | ( | const std::string & | escaped_string | ) |

extract an escaped binary_string

## find_and_modify()

template<typename Callable>

std::string CLI::detail::find_and_modify | ( | std::string | str,
|  | std::string | trigger,
|  | Callable | modify )

inline

Find a trigger string and call a modify callable function that takes the current string and starting position of the trigger and returns the position in the string to search for the next trigger string

## find_and_replace()

CLI11_INLINE std::string CLI::detail::find_and_replace | ( | std::string | str,
|  | std::string | from,
|  | std::string | to )

Find and replace a substring with another substring.

## find_member()

CLI11_INLINE std::ptrdiff_t CLI::detail::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.

## fix_newlines()

CLI11_INLINE std::string CLI::detail::fix_newlines | ( | const std::string & | leader,
|  | std::string | input )

Add a leader to the beginning of all new lines (nothing is added at the start of the first line). "; " would be for ini files

Can't use Regex, or this would be a subs.

## format_aliases()

CLI11_INLINE std::ostream & CLI::detail::format_aliases | ( | std::ostream & | out,
|  | const std::vector< std::string > & | aliases,
|  | std::size_t | wid )

Print subcommand aliases.

## from_stream() [1/2]

template<typename T, enable_if_t<!is_istreamable< T >::value, detail::enabler > = detail::dummy>

bool CLI::detail::from_stream | ( | const std::string & | ,
|  | T & | )

## from_stream() [2/2]

template<typename T, enable_if_t< is_istreamable< T >::value, detail::enabler > = detail::dummy>

bool CLI::detail::from_stream | ( | const std::string & | istring,
|  | T & | obj )

Templated operation to get a value from a stream.

## generate_map()

template<typename T>

std::string CLI::detail::generate_map | ( | const T & | map,
|  | bool | key_only = false )

Generate a string representation of a map.

## generate_parents()

std::vector< std::string > CLI::detail::generate_parents | ( | const std::string & | section,
|  | std::string & | name,
|  | char | parentSeparator )

## generate_set()

template<typename T>

std::string CLI::detail::generate_set | ( | const T & | set | ) |

Generate a string representation of a set.

## get_default_flag_values()

CLI11_INLINE std::vector< std::pair< std::string, std::string > > CLI::detail::get_default_flag_values | ( | const std::string & | str | ) |

extract default flag values either {def} or starting with a !

## get_group_separators()

CLI11_INLINE std::string CLI::detail::get_group_separators | ( |  | ) |

get valid group separators _' + local separator if different

Returns
  a string containing the group separators

## get_names()

CLI11_INLINE std::tuple< std::vector< std::string >, std::vector< std::string >, std::string > CLI::detail::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.

## has_default_flag_values()

bool CLI::detail::has_default_flag_values | ( | const std::string & | flags | ) |

inline

check if the flag definitions has possible false flags

## has_escapable_character()

CLI11_INLINE bool CLI::detail::has_escapable_character | ( | const std::string & | str | ) |

detect if a string has escapable characters

Parameters

  str | the string to do the detection on

Returns
  true if the string has escapable characters

## ini_join()

std::string CLI::detail::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.

## is_binary_escaped_string()

CLI11_INLINE bool CLI::detail::is_binary_escaped_string | ( | const std::string & | escaped_string | ) |

## is_separator()

bool CLI::detail::is_separator | ( | const std::string & | str | ) |

inline

check if a string is a container segment separator (empty or "%%")

## isalpha()

bool CLI::detail::isalpha | ( | const std::string & | str | ) |

inline

Verify that str consists of letters only.

## join() [1/2]

template<typename T, typename Callable, typename = typename std::enable_if<!std::is_constructible<std::string, Callable>::value>::type>

std::string CLI::detail::join | ( | const T & | v,
|  | Callable | func,
|  | std::string | delim = "," )

Simple function to join a string from processed elements.

## join() [2/2]

template<typename T>

std::string CLI::detail::join | ( | const T & | v,
|  | std::string | delim = "," )

Simple function to join a string.

## ltrim() [1/2]

CLI11_INLINE std::string & CLI::detail::ltrim | ( | std::string & | str | ) |

Trim whitespace from left of string.

## ltrim() [2/2]

CLI11_INLINE std::string & CLI::detail::ltrim | ( | std::string & | str,
|  | const std::string & | filter )

Trim anything from left of string.

## overflowCheck() [1/2]

template<typename T>

std::enable_if<!std::is_signed< T >::value, T >::type CLI::detail::overflowCheck | ( | const T & | a,
|  | const T & | b )

inline

Do a check for overflow on unsigned numbers.

## overflowCheck() [2/2]

template<typename T>

std::enable_if< std::is_signed< T >::value, T >::type CLI::detail::overflowCheck | ( | const T & | a,
|  | const T & | b )

inline

Do a check for overflow on signed numbers.

## process_quoted_string()

CLI11_INLINE bool CLI::detail::process_quoted_string | ( | std::string & | str,
|  | char | string_char = '\"',
|  | char | literal_char = '\'',
|  | bool | disable_secondary_array_processing = false )

process a quoted string, remove the quotes and if appropriate handle escaped characters

## remove_default_flag_values()

CLI11_INLINE void CLI::detail::remove_default_flag_values | ( | std::string & | flags | ) |

## remove_escaped_characters()

CLI11_INLINE std::string CLI::detail::remove_escaped_characters | ( | const std::string & | str | ) |

replace the escaped characters with their equivalent

## remove_quotes() [1/2]

CLI11_INLINE std::string & CLI::detail::remove_quotes | ( | std::string & | str | ) |

remove quotes at the front and back of a string either '"' or '\''

## remove_quotes() [2/2]

CLI11_INLINE void CLI::detail::remove_quotes | ( | std::vector< std::string > & | args | ) |

remove quotes from all elements of a string vector and process escaped components

## remove_underscore()

std::string CLI::detail::remove_underscore | ( | std::string | str | ) |

inline

remove underscores from a string

## rjoin()

template<typename T>

std::string CLI::detail::rjoin | ( | const T & | v,
|  | std::string | delim = "," )

Join a string in reverse order.

## rtrim() [1/2]

CLI11_INLINE std::string & CLI::detail::rtrim | ( | std::string & | str | ) |

Trim whitespace from right of string.

## rtrim() [2/2]

CLI11_INLINE std::string & CLI::detail::rtrim | ( | std::string & | str,
|  | const std::string & | filter )

Trim anything from right of string.

## search() [1/3]

template<typename T, typename V, enable_if_t< has_find< T, V >::value, detail::enabler > = detail::dummy>

auto CLI::detail::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.

## search() [2/3]

template<typename T, typename V, enable_if_t<!has_find< T, V >::value, detail::enabler > = detail::dummy>

auto CLI::detail::search | ( | const T & | set,
|  | const V & | val )->std::pair< bool, decltype(std::begin(detail::smart_deref(set)))>

A search function.

## search() [3/3]

template<typename T, typename V>

auto CLI::detail::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.

## smart_deref() [1/2]

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 & CLI::detail::smart_deref | ( | T & | value | ) |

## smart_deref() [2/2]

template<typename T, enable_if_t< is_copyable_ptr< typename std::remove_reference< T >::type >::value, detail::enabler > = detail::dummy>

auto CLI::detail::smart_deref | ( | T | value | ) | ->decltype(*value)

## split()

CLI11_INLINE std::vector< std::string > CLI::detail::split | ( | const std::string & | s,
|  | char | delim )

Split a string by a delim.

## split_long()

CLI11_INLINE bool CLI::detail::split_long | ( | const std::string & | current,
|  | std::string & | name,
|  | std::string & | value )

## split_names()

CLI11_INLINE std::vector< std::string > CLI::detail::split_names | ( | std::string | current | ) |

## split_program_name()

CLI11_INLINE std::pair< std::string, std::string > CLI::detail::split_program_name | ( | std::string | commandline | ) |

Split a string into a program name and command line arguments the string is assumed to contain a file name followed by other arguments the return value contains is a pair with the first argument containing the program name and the second everything else.

## split_short()

CLI11_INLINE bool CLI::detail::split_short | ( | const std::string & | current,
|  | std::string & | name,
|  | std::string & | rest )

## split_windows_style()

CLI11_INLINE bool CLI::detail::split_windows_style | ( | const std::string & | current,
|  | std::string & | name,
|  | std::string & | value )

## streamOutAsParagraph()

CLI11_INLINE std::ostream & CLI::detail::streamOutAsParagraph | ( | std::ostream & | out,
|  | const std::string & | text,
|  | std::size_t | paragraphWidth,
|  | const std::string & | linePrefix = "",
|  | bool | skipPrefixOnFirstLine = false )

This function formats the given text as a paragraph with fixed width and applies correct line wrapping with a custom line prefix. The paragraph will get streamed to the given ostream.

## to_lower()

std::string CLI::detail::to_lower | ( | std::string | str | ) |

inline

Return a lower case version of a string.

## to_string() [1/8]

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 CLI::detail::to_string | ( | T && |  | ) |

inline

If conversion is not supported, return an empty string (streaming is not supported for that type).

## to_string() [2/8]

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 CLI::detail::to_string | ( | T && | value | ) |

inline

Print tuple value string for tuples of size > 1.

## to_string() [3/8]

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 CLI::detail::to_string | ( | T && | value | ) |

inline

Print tuple value string for tuples of size ==1.

## to_string() [4/8]

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 CLI::detail::to_string | ( | T && | value | ) |

inline

Print tuple value string for tuples of size > 1.

## to_string() [5/8]

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 CLI::detail::to_string | ( | T && | value | ) |

Convert an object to a string (streaming must be supported for that type).

## to_string() [6/8]

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 CLI::detail::to_string | ( | T && | value | ) |

inline

Construct a string from the object.

Print tuple value string for tuples of size ==1.

## to_string() [7/8]

template<typename T, enable_if_t< std::is_convertible< T, std::string >::value, detail::enabler > = detail::dummy>

auto CLI::detail::to_string | ( | T && | value | ) | ->decltype(std::forward< T >(value))

Convert an object to a string (directly forward if this can become a string).

## to_string() [8/8]

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 &&!is_tuple_like< T >::value, detail::enabler > = detail::dummy>

std::string CLI::detail::to_string | ( | T && | variable | ) |

inline

convert a readable container to a string

## trim() [1/2]

std::string & CLI::detail::trim | ( | std::string & | str | ) |

inline

Trim whitespace from string.

## trim() [2/2]

std::string & CLI::detail::trim | ( | std::string & | str,
|  | const std::string | filter )

inline

Trim anything from string.

## trim_copy() [1/2]

std::string CLI::detail::trim_copy | ( | const std::string & | str | ) |

inline

Make a copy of the string and then trim it.

## trim_copy() [2/2]

std::string CLI::detail::trim_copy | ( | const std::string & | str,
|  | const std::string & | filter )

inline

Make a copy of the string and then trim it, any filter string can be used (any char in string is filtered).

## tuple_type_size()

template<typename T, std::size_t I>

std::enable_if< I==type_count_base< T >::value, int >::type CLI::detail::tuple_type_size | ( |  | ) |

constexpr

0 if the index > tuple size

## tuple_value_string() [1/2]

template<typename T, std::size_t I>

std::enable_if< I==type_count_base< T >::value, std::string >::type CLI::detail::tuple_value_string | ( | T && |  | ) |

inline

Convert a tuple like object to a string.

Empty string if the index > tuple size.

forward declarations for tuple_value_strings

## tuple_value_string() [2/2]

template<typename T, std::size_t I>

std::enable_if<(I< type_count_base< T >::value), std::string >::type CLI::detail::tuple_value_string | ( | T && | value | ) |

inline

Recursively generate the tuple value string.

## valid_alias_name_string()

bool CLI::detail::valid_alias_name_string | ( | const std::string & | str | ) |

inline

Verify an app name.

## valid_first_char()

template<typename T>

bool CLI::detail::valid_first_char | ( | T | c | ) |

Verify the first character of an option

- is a trigger character, ! has special meaning and new lines would just be annoying to deal with

## valid_later_char()

template<typename T>

bool CLI::detail::valid_later_char | ( | T | c | ) |

Verify following characters of an option.

## valid_name_string()

CLI11_INLINE bool CLI::detail::valid_name_string | ( | const std::string & | str | ) |

Verify an option/subcommand name.

## value_string() [1/3]

template<typename T, enable_if_t< std::is_enum< T >::value, detail::enabler > = detail::dummy>

std::string CLI::detail::value_string | ( | const T & | value | ) |

get a string as a convertible value for enumerations

## value_string() [2/3]

template<typename T, enable_if_t< std::is_arithmetic< T >::value, detail::enabler > = detail::dummy>

std::string CLI::detail::value_string | ( | const T & | value | ) |

get a string as a convertible value for arithmetic types

## value_string() [3/3]

template<typename T, enable_if_t<!std::is_enum< T >::value &&!std::is_arithmetic< T >::value, detail::enabler > = detail::dummy>

auto CLI::detail::value_string | ( | const T & | value | ) | ->decltype(to_string(value))

for other types just use the regular to_string function

## Variable Documentation

## dummy

enabler CLI::detail::dummy = {}

constexpr

An instance to use in EnableIf.

## expected_max_vector_size

int CLI::detail::expected_max_vector_size {1 << 29}

constexpr

a constant defining an expected max vector size defined to be a big number that could be multiplied by 4 and not produce overflow for some expected uses