|
ArKanjo 0.5.1
A tool for find code duplicated functions in codebases
|
#include <parser_options.hpp>
Public Member Functions | |
| bool | has (const std::string &name) const |
| Checks whether an option exists. More... | |
| std::optional< std::string_view > | get (const std::string &name) const |
| Returns the value of an option. More... | |
| template<typename T > | |
| std::optional< T > | get_as (const std::string &name) const |
| Returns the value of an option converted to the requested type. More... | |
Public Attributes | |
| std::map< std::string, std::string > | args |
| Map from option name to value. More... | |
| std::vector< std::string > | extra_args |
| List of extra arguments that are not options. More... | |
Definition at line 29 of file parser_options.hpp.
| std::optional< std::string_view > ParsedOptions::get | ( | const std::string & | name | ) | const |
Returns the value of an option.
| name | Option name. |
Definition at line 64 of file parser_options.hpp.
| std::optional< T > ParsedOptions::get_as | ( | const std::string & | name | ) | const |
Returns the value of an option converted to the requested type.
| T | Target type. |
| name | Option name. |
| std::invalid_argument | If the value cannot be converted. |
| std::out_of_range | If the value is outside the supported range. |
Definition at line 83 of file parser_options.hpp.
| bool ParsedOptions::has | ( | const std::string & | name | ) | const |
Checks whether an option exists.
| name | Option name. |
Definition at line 54 of file parser_options.hpp.
| std::map<std::string, std::string> ParsedOptions::args |
Map from option name to value.
"true".Definition at line 37 of file parser_options.hpp.
| std::vector<std::string> ParsedOptions::extra_args |
List of extra arguments that are not options.
Includes everything after a -- separator: getopt stops option parsing at --, so those tokens are kept unchanged here and can be forwarded directly to a method-specific backend.
Definition at line 46 of file parser_options.hpp.