Maze Builder Docs 6.0.1
All Classes Namespaces Files Functions Enumerations Friends Pages
mazes::args Class Reference

Simple argument handler. More...

#include <args.h>

Public Member Functions

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 Public Member Functions

static std::string to_str (const args &a) noexcept
 Display the arguments to a string output.
 

Public Attributes

std::unordered_map< std::string, std::string > args_map
 

Detailed Description

Simple argument handler.

Member Function Documentation

◆ 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
key
Returns

◆ parse() [1/2]

bool mazes::args::parse ( const std::string & arguments)
noexcept

Parse program arguments from a string.

Parameters
arguments
Returns

◆ parse() [2/2]

bool mazes::args::parse ( const std::vector< std::string > & arguments)
noexcept

Parse program arguments from a vector of strings.

Parameters
arguments
Returns

◆ set()

void mazes::args::set ( const std::string & key,
const std::string & value )
noexcept

Set a value.

Parameters
key
value

◆ 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
str
Returns


The documentation for this class was generated from the following file: