CLI11
1.9.1
|
#include "StringTools.hpp"
#include <cstdint>
#include <exception>
#include <memory>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
Go to the source code of this file.
Namespaces | |
CLI | |
CLI::detail | |
Typedefs | |
template<bool B, class T = void> | |
using | CLI::enable_if_t = typename std::enable_if< B, T >::type |
template<typename... Ts> | |
using | CLI::void_t = typename make_void< Ts... >::type |
A copy of std::void_t from C++17 - same reasoning as enable_if_t, it does not hurt to redefine. More... | |
template<bool B, class T , class F > | |
using | CLI::conditional_t = typename std::conditional< B, T, F >::type |
A copy of std::conditional_t from C++14 - same reasoning as enable_if_t, it does not hurt to redefine. More... | |
Enumerations | |
enum class | CLI::detail::enabler |
Simple empty scoped class. More... | |
enum class | CLI::detail::object_category : int { CLI::detail::integral_value = 2 , CLI::detail::unsigned_integral = 4 , CLI::detail::enumeration = 6 , CLI::detail::boolean_value = 8 , CLI::detail::floating_point = 10 , CLI::detail::number_constructible = 12 , CLI::detail::double_constructible = 14 , CLI::detail::integer_constructible = 16 , CLI::detail::vector_value = 30 , CLI::detail::tuple_value = 35 , CLI::detail::string_assignable = 50 , CLI::detail::string_constructible = 60 , CLI::detail::other = 200 } |
Functions | |
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. More... | |
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) 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 | CLI::detail::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 | CLI::detail::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 | CLI::detail::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 | CLI::detail::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 | CLI::detail::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 | CLI::detail::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 * | CLI::detail::type_name () |
Print name for enumeration types. More... | |
std::size_t I std::enable_if< I==type_count< T >::value, std::string >::type | CLI::detail::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 | CLI::detail::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 | CLI::detail::type_name () |
This one should not be used normally, since vector types print the internal type. More... | |
std::int64_t | CLI::detail::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 | CLI::detail::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 | CLI::detail::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 | CLI::detail::lexical_conversion (const std::vector< std ::string > &strings, T &output) |
Lexical conversion if there is only one element. More... | |
bool ::type | CLI::detail::tuple_conversion (const std::vector< std::string > &, T &) |
Variables | |
constexpr enabler | CLI::detail::dummy = {} |
An instance to use in EnableIf. More... | |