Maze Builder Docs 6.0.1
All Classes Namespaces Files Functions Enumerations Friends Pages
args.h
Go to the documentation of this file.
1#ifndef ARGS_H
2#define ARGS_H
3
4#include <string>
5#include <unordered_map>
6#include <vector>
7#include <ostream>
8#include <optional>
9
10namespace mazes {
11
15struct args {
16public:
20 bool parse(const std::vector<std::string>& arguments) noexcept;
21
25 bool parse(const std::string& arguments) noexcept;
26
28 void clear() noexcept;
29
33 std::optional<std::string> get(const std::string& key) const noexcept;
34
37 const std::unordered_map<std::string, std::string>& get() const noexcept;
38
42 void set(const std::string& key, const std::string& value) noexcept;
43
47 std::string trim(const std::string& str) const noexcept;
48
51 static std::string to_str(const args& a) noexcept;
52public:
53 std::unordered_map<std::string, std::string> args_map;
54};
55
56}
57#endif // ARGS_H
Namespace for the maze builder.
Definition algo_interface.h:9
Simple argument handler.
Definition args.h:15
bool parse(const std::vector< std::string > &arguments) noexcept
Parse program arguments from a vector of strings.
const std::unordered_map< std::string, std::string > & get() const noexcept
Get entire the args map.
std::string trim(const std::string &str) const noexcept
Remove whitespace or tabs from a string.
void clear() noexcept
Clear the arguments map.
static std::string to_str(const args &a) noexcept
Display the arguments to a string output.
bool parse(const std::string &arguments) noexcept
Parse program arguments from a string.
void set(const std::string &key, const std::string &value) noexcept
Set a value.