48 #include <meta/meta.hpp> 68 template <
typename value_type>
69 static std::string get_type_name_as_string(value_type
const & )
71 using type = std::decay_t<value_type>;
72 using types = meta::list<int8_t,
85 std::vector<std::string> names{
"INT (8 bit)",
99 if constexpr (meta::in<types, type>::value)
100 return names[meta::find_index<types, type>::value];
102 return "UNKNOWN_TYPE";
109 template <sequence_container_concept container_type>
111 requires !std::is_same_v<container_type, std::string>
113 static std::string get_type_name_as_string(container_type
const & )
115 typename container_type::value_type tmp;
116 return get_type_name_as_string(tmp);
124 template <
typename option_value_type>
125 static std::string option_type_and_list_info(option_value_type
const & value)
127 return (
"\\fI" + get_type_name_as_string(value) +
"\\fP");
136 template <
typename container_type>
138 requires sequence_container_concept<container_type> && !std::is_same_v<container_type, std::string>
140 static std::string option_type_and_list_info(container_type
const & container)
142 return (
"List of \\fI" + get_type_name_as_string(container) +
"\\fP's");
152 static std::string prep_id_for_help(
char const short_id, std::string
const & long_id)
156 if (short_id !=
'\0')
157 term =
"\\fB-" + std::string(1, short_id) +
"\\fP";
159 if (short_id !=
'\0' && !long_id.empty())
162 if (!long_id.empty())
163 term.append(
"\\fB--" + long_id +
"\\fP");
174 std::string escape_special_xml_chars(std::string
const & original)
177 escaped.resize(original.size());
179 for (
auto c : original)
182 escaped.append(
""");
184 escaped.append(
"'");
186 escaped.append(
"&");
188 escaped.append(
"<");
190 escaped.append(
">");
192 escaped.push_back(c);
204 static std::string expand_multiple_flags(std::string
const & flag_cluster)
207 auto it{flag_cluster.begin()};
209 if (flag_cluster[0] ==
'-')
212 for (; it != flag_cluster.end() - 1; ++it)
213 tmp.append(
"-" + std::string(1, *it) +
", ");
215 tmp.erase(tmp.find_last_of(
','));
216 tmp.append(
" and -" + std::string(1, flag_cluster[flag_cluster.size() - 1]));
Contains some standard validators for (positional) options.
Contains parser related exceptions.
Definition: aligned_sequence_concept.hpp:288
Contains auxiliary information.