Sharg 1.1.2-rc.1
The argument parser for bio-c++ tools.
|
The Misc Module. More...
Topics | |
std | |
The <charconv> header from C++17's standard library. | |
Concepts | |
concept | sharg::istreamable |
Concept for types that can be parsed from a std::istream via the stream operator. | |
concept | sharg::ostreamable |
Concept for types that can be parsed into a std::ostream via the stream operator. | |
concept | sharg::parsable |
Checks whether the the type can be used in an add_(positional_)option call on the parser. | |
concept | sharg::named_enumeration |
Checks whether the free function sharg::enumeration_names can be called on the type. | |
Classes | |
struct | sharg::custom::parsing< t > |
A type that can be specialised to provide customisation point implementations for the sharg::parser such that third party types may be adapted. More... | |
Enumerations | |
enum class | sharg::update_notifications { update_notifications::on , update_notifications::off } |
Indicates whether application allows automatic update notifications by the sharg::parser. More... | |
Customisation Points | |
template<typename option_type > | |
auto const | sharg::enumeration_names = detail::adl_only::enumeration_names_cpo<option_type>{}() |
Return a conversion map from std::string_view to option_type. | |
The Misc Module.
|
strong |
Indicates whether application allows automatic update notifications by the sharg::parser.
Enumerator | |
---|---|
on | Automatic update notifications should be enabled. |
off | Automatic update notifications should be disabled. |
|
inline |
Return a conversion map from std::string_view to option_type.
your_type | Type of the value to retrieve the conversion map for. |
value | The value is not accessed, only its type is used. |
This is a function object. Invoke it with the parameter(s) specified above.
It acts as a wrapper and looks for two possible implementations (in this order):
enumeration_names
in sharg::custom::parsing<your_type>
that is of type std::unordered_map<std::string_view, your_type>>
.enumeration_names(your_type const a)
in the namespace of your type (or as friend
) which returns a std::unordered_map<std::string_view, your_type>>
.If you are working on a type in your namespace, you should implement a free function like this:
Only if you cannot access the namespace of your type to customize you may specialize the sharg::custom::parsing struct like this:
This is a customisation point (see Customisation). To specify the behaviour for your type, simply provide one of the two functions specified above.