8#include <unordered_map>
20 static constexpr const char* ALGO_ID_FLAG_STR =
"-a";
21 static constexpr const char* ALGO_ID_OPTION_STR =
"--algo";
22 static constexpr const char* ALGO_ID_WORD_STR =
"algo";
23 static constexpr const char* ALGO_ID_SHORT_STR =
"a";
25 static constexpr const char* BLOCK_ID_FLAG_STR =
"-b";
26 static constexpr const char* BLOCK_ID_OPTION_STR =
"--block";
27 static constexpr const char* BLOCK_ID_WORD_STR =
"block";
28 static constexpr const char* BLOCK_ID_SHORT_STR =
"b";
30 static constexpr const char* ROW_FLAG_STR =
"-r";
31 static constexpr const char* ROW_OPTION_STR =
"--rows";
32 static constexpr const char* ROW_WORD_STR =
"rows";
33 static constexpr const char* ROW_SHORT_STR =
"r";
35 static constexpr const char* COLUMN_FLAG_STR =
"-c";
36 static constexpr const char* COLUMN_OPTION_STR =
"--columns";
37 static constexpr const char* COLUMN_WORD_STR =
"columns";
38 static constexpr const char* COLUMN_SHORT_STR =
"c";
40 static constexpr const char* LEVEL_FLAG_STR =
"-l";
41 static constexpr const char* LEVEL_OPTION_STR =
"--levels";
42 static constexpr const char* LEVEL_WORD_STR =
"levels";
43 static constexpr const char* LEVEL_SHORT_STR =
"l";
46 static constexpr const char* JSON_FLAG_STR =
"-j";
47 static constexpr const char* JSON_OPTION_STR =
"--json";
48 static constexpr const char* JSON_WORD_STR =
"json";
49 static constexpr const char* JSON_SHORT_STR =
"j";
52 static constexpr const char* OUTPUT_ID_FLAG_STR =
"-o";
53 static constexpr const char* OUTPUT_ID_OPTION_STR =
"--output";
54 static constexpr const char* OUTPUT_ID_WORD_STR =
"output";
55 static constexpr const char* OUTPUT_ID_SHORT_STR =
"o";
56 static constexpr const char* DEFAULT_OUTPUT_FILENAME =
"output.json";
59 static constexpr const char* SEED_FLAG_STR =
"-s";
60 static constexpr const char* SEED_OPTION_STR =
"--seed";
61 static constexpr const char* SEED_WORD_STR =
"seed";
62 static constexpr const char* SEED_SHORT_STR =
"s";
65 static constexpr const char* DISTANCES_FLAG_STR =
"-d";
66 static constexpr const char* DISTANCES_OPTION_STR =
"--distances";
67 static constexpr const char* DISTANCES_WORD_STR =
"distances";
68 static constexpr const char* DISTANCES_SHORT_STR =
"d";
69 static constexpr const char* DISTANCES_START_STR =
"distances_start";
70 static constexpr const char* DISTANCES_END_STR =
"distances_end";
71 static constexpr const char* DISTANCES_DEFAULT_START =
"0";
72 static constexpr const char* DISTANCES_DEFAULT_END =
"-1";
75 static constexpr const char* HELP_FLAG_STR =
"-h";
76 static constexpr const char* HELP_OPTION_STR =
"--help";
77 static constexpr const char* HELP_WORD_STR =
"help";
78 static constexpr const char* HELP_SHORT_STR =
"h";
81 static constexpr const char* VERSION_FLAG_STR =
"-v";
82 static constexpr const char* VERSION_OPTION_STR =
"--version";
83 static constexpr const char* VERSION_WORD_STR =
"version";
84 static constexpr const char* VERSION_SHORT_STR =
"v";
87 static constexpr const char* TRUE_VALUE =
"true";
118 bool parse(const std::vector<std::
string>& arguments) noexcept;
123 bool parse(const std::
string& arguments) noexcept;
129 bool parse(
int argc,
char** argv) noexcept;
137 std::optional<std::
string>
get(const std::
string& key) const noexcept;
141 const std::unordered_map<std::
string, std::
string>&
get() const noexcept;
154 std::optional<std::unordered_map<std::
string, std::
string>>
get_configuration(
size_t index) const noexcept;
164 bool add_option(const std::
string& flags, const std::
string& description) noexcept;
170 bool add_flag(const std::
string& flags, const std::
string& description) noexcept;
178 bool parse_sliced_array(const std::
string& value, std::unordered_map<std::
string, std::
string>& args_map) noexcept;
184 std::
string generate_output_filename(const std::
string& input_value,
bool is_string_input) const noexcept;
191 bool process_json_input(const std::
string& json_input,
bool is_string_input, const std::
string& key) noexcept;
195 std::unique_ptr<impl> pimpl;
Command-line argument handler with JSON support.
Definition args.h:17
bool parse(const std::vector< std::string > &arguments) noexcept
Parse program arguments from a vector of strings.
std::vector< std::unordered_map< std::string, std::string > > get_all_configurations() const noexcept
Get all configurations as a vector.
const std::unordered_map< std::string, std::string > & get() const noexcept
Get entire args map.
std::optional< std::unordered_map< std::string, std::string > > get_configuration(size_t index) const noexcept
Get configuration by index (0-based)
bool add_option(const std::string &flags, const std::string &description) noexcept
Add a new option to the CLI parser.
void clear() noexcept
Clear the arguments map.
args() noexcept
Default constructor.
bool add_flag(const std::string &flags, const std::string &description) noexcept
Add a new flag to the CLI parser.
size_t get_configuration_count() const noexcept
Get the number of configurations stored.
bool has_multiple_configurations() const noexcept
Check if we have multiple configurations (from JSON array)
Namespace for the maze builder.
Definition algo_interface.h:9