8#include <unordered_map>
21 using arg_map = std::unordered_map<std::string, std::string>;
23 static constexpr auto APP_KEY =
"app";
25 static constexpr auto ALGO_ID_FLAG_STR =
"-a";
26 static constexpr auto ALGO_ID_OPTION_STR =
"--algo";
27 static constexpr auto ALGO_ID_WORD_STR =
"algo";
29 static constexpr auto ROW_FLAG_STR =
"-r";
30 static constexpr auto ROW_OPTION_STR =
"--rows";
31 static constexpr auto ROW_WORD_STR =
"rows";
33 static constexpr auto COLUMN_FLAG_STR =
"-c";
34 static constexpr auto COLUMN_OPTION_STR =
"--columns";
35 static constexpr auto COLUMN_WORD_STR =
"columns";
37 static constexpr auto LEVEL_FLAG_STR =
"-l";
38 static constexpr auto LEVEL_OPTION_STR =
"--levels";
39 static constexpr auto LEVEL_WORD_STR =
"levels";
42 static constexpr auto JSON_FLAG_STR =
"-j";
43 static constexpr auto JSON_OPTION_STR =
"--json";
44 static constexpr auto JSON_WORD_STR =
"json";
47 static constexpr auto OUTPUT_ID_FLAG_STR =
"-o";
48 static constexpr auto OUTPUT_ID_OPTION_STR =
"--output";
49 static constexpr auto OUTPUT_ID_WORD_STR =
"output";
52 static constexpr auto SEED_FLAG_STR =
"-s";
53 static constexpr auto SEED_OPTION_STR =
"--seed";
54 static constexpr auto SEED_WORD_STR =
"seed";
57 static constexpr auto DISTANCES_FLAG_STR =
"-d";
58 static constexpr auto DISTANCES_OPTION_STR =
"--distances";
59 static constexpr auto DISTANCES_WORD_STR =
"distances";
60 static constexpr auto DISTANCES_START_VAL_STR =
"distances_start";
61 static constexpr auto DISTANCES_END_VAL_STR =
"distances_end";
64 static constexpr auto MASK_FLAG_STR =
"-m";
65 static constexpr auto MASK_OPTION_STR =
"--mask";
66 static constexpr auto MASK_WORD_STR =
"mask";
69 static constexpr auto RAW_WORD_STR =
"raw";
72 static constexpr auto TRUE_VALUE =
"true";
104 bool parse(const std::vector<std::
string> &arguments,
105 bool has_program_name_as_first_arg = false) const noexcept;
111 bool parse(const std::
string &arguments,
bool has_program_name_as_first_arg = false) const noexcept;
118 bool parse(
int argc,
char **argv,
bool has_program_name_as_first_arg = false) const noexcept;
122 void set(std::vector<arg_map> maps) const noexcept;
130 [[nodiscard]] std::optional<std::
string>
get(const std::
string &key) const noexcept;
134 [[nodiscard]] arg_map
front() const noexcept;
142 [[nodiscard]] std::vector<arg_map>
get() const noexcept;
146 [[nodiscard]] std::
size_t count() const noexcept;
150 std::unique_ptr<impl> pimpl;
bool pop_front() const noexcept
Remove the first parsed argument map.
arg_map front() const noexcept
Get args from front.
void clear() const noexcept
Clear the arguments map.
std::optional< std::string > get(const std::string &key) const noexcept
Get a value.
std::size_t count() const noexcept
Get the number of argument maps.
void set(std::vector< arg_map > maps) const noexcept
Replace all argument maps.
bool parse(const std::vector< std::string > &arguments, bool has_program_name_as_first_arg=false) const noexcept
Parse program arguments from a vector of strings.
args() noexcept
Default constructor.