WarpX
|
Typedefs | |
using | ArgVal = std::optional< std::variant< int, double, std::string > > |
using | Key = std::tuple< std::string, ArgType, std::string > |
using | ParsedArgs = std::unordered_map< std::string, ArgVal > |
Enumerations | |
enum class | ArgType { NoArg , Integer , Double , String } |
Functions | |
template<typename T > | |
T | GetVal (const ArgVal &arg_val) |
Gets the value out of an ArgVal (std::optional<std::variant<int, double, std::string>>) object. More... | |
ParsedArgs | ParseArgs (const std::vector< Key > &keys, const int argc, char const *const *argv) |
Function to parse the command line arguments. More... | |
void | PrintHelp (const std::vector< Key > &cmd_list) |
Prints the command line options. More... | |
using ArgParser::ArgVal = typedef std::optional<std::variant<int, double, std::string> > |
using ArgParser::Key = typedef std::tuple<std::string, ArgType, std::string> |
using ArgParser::ParsedArgs = typedef std::unordered_map<std::string, ArgVal> |
|
strong |
T ArgParser::GetVal | ( | const ArgVal & | arg_val | ) |
Gets the value out of an ArgVal (std::optional<std::variant<int, double, std::string>>) object.
T | the type to return (must be int, double, or std::string) |
[in] | arg_val | the ArgVal object |
ParsedArgs ArgParser::ParseArgs | ( | const std::vector< Key > & | keys, |
const int | argc, | ||
char const *const * | argv | ||
) |
Function to parse the command line arguments.
[in] | keys | the list of possible command line arguments |
[in] | argc | the number of command line arguments |
[in] | argv | all the command line arguments |
void ArgParser::PrintHelp | ( | const std::vector< Key > & | cmd_list | ) |
Prints the command line options.
[in] | cmd_list | the list of possible command line arguments |