Simple argument handler.
More...
#include <args.h>
|
bool | parse (const std::vector< std::string > &arguments) noexcept |
| Parse program arguments from a vector of strings.
|
|
bool | parse (const std::string &arguments) noexcept |
| Parse program arguments from a string.
|
|
void | clear () noexcept |
| Clear the arguments map.
|
|
std::optional< std::string > | get (const std::string &key) const noexcept |
| Get a value from the args map.
|
|
const std::unordered_map< std::string, std::string > & | get () const noexcept |
| Get entire the args map.
|
|
void | set (const std::string &key, const std::string &value) noexcept |
| Set a value.
|
|
std::string | trim (const std::string &str) const noexcept |
| Remove whitespace or tabs from a string.
|
|
|
static std::string | to_str (const args &a) noexcept |
| Display the arguments to a string output.
|
|
|
std::unordered_map< std::string, std::string > | args_map |
|
◆ get() [1/2]
const std::unordered_map< std::string, std::string > & mazes::args::get |
( |
| ) |
const |
|
noexcept |
Get entire the args map.
- Returns
◆ get() [2/2]
std::optional< std::string > mazes::args::get |
( |
const std::string & | key | ) |
const |
|
noexcept |
Get a value from the args map.
- Parameters
-
- Returns
◆ parse() [1/2]
bool mazes::args::parse |
( |
const std::string & | arguments | ) |
|
|
noexcept |
Parse program arguments from a string.
- Parameters
-
- Returns
◆ parse() [2/2]
bool mazes::args::parse |
( |
const std::vector< std::string > & | arguments | ) |
|
|
noexcept |
Parse program arguments from a vector of strings.
- Parameters
-
- Returns
◆ set()
void mazes::args::set |
( |
const std::string & | key, |
|
|
const std::string & | value ) |
|
noexcept |
◆ to_str()
static std::string mazes::args::to_str |
( |
const args & | a | ) |
|
|
staticnoexcept |
Display the arguments to a string output.
- Returns
◆ trim()
std::string mazes::args::trim |
( |
const std::string & | str | ) |
const |
|
noexcept |
Remove whitespace or tabs from a string.
- Parameters
-
- Returns
The documentation for this class was generated from the following file: