Stellarator-Tools
vmec_test::commandline_parser Class Reference

A radial quantity. More...

#include <vmec_test_commandline_parser.hpp>

Public Member Functions

 commandline_parser (const size_t argc, const char *argv[], const std::function< void(void)> help)
 Construct a commandline_parser object by pasring command line arguments. More...
 
bool is_set (const std::string &key) const
 Check if command arg was set. More...
 
template<typename TYPE >
TYPE get (const std::string &key) const
 Get the value of the agument. More...
 

Static Public Member Functions

static arg_map parse_commands (const size_t argc, const char *argv[], const std::function< void(void)> help)
 Factory method to parse the commandline and produce the arguments. More...
 

Public Attributes

const arg_map commands
 Parsed commands.
 
const std::function< void(void)> help
 Help callback function.
 

Detailed Description

A radial quantity.

Constructor & Destructor Documentation

◆ commandline_parser()

vmec_test::commandline_parser::commandline_parser ( const size_t  argc,
const char *  argv[],
const std::function< void(void)>  help 
)
inline

Construct a commandline_parser object by pasring command line arguments.

Parameters
[in]argcNumber of commandline arguments.
[in]argvCommandline strings.
[in]helpCall back function to display the help message.

Member Function Documentation

◆ get()

template<typename TYPE >
TYPE vmec_test::commandline_parser::get ( const std::string &  key) const
inline

Get the value of the agument.

Parameters
[in]keyCommandline key to check.
Returns
Value of the argument.

◆ is_set()

bool vmec_test::commandline_parser::is_set ( const std::string &  key) const
inline

Check if command arg was set.

Parameters
[in]keyCommandline key to check.
Returns
True if the key was set.

◆ parse_commands()

static arg_map vmec_test::commandline_parser::parse_commands ( const size_t  argc,
const char *  argv[],
const std::function< void(void)>  help 
)
inlinestatic

Factory method to parse the commandline and produce the arguments.

Parameters
[in]argcNumber of commandline arguments.
[in]argvCommandline strings.
[in]helpCall back function to display the help message.
Returns
A constructed map of commandline argument key value pairs.

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