Stellarator-Tools
commandline_parser Class Reference

A radial quantity. More...

#include <commandline_parser.hpp>

Classes

type  commandline_parser_class
 Base class containing a parsed commandline. More...
 

Public Member Functions

 commandline_parser (const size_t argc, const char *argv[])
 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[])
 Factory method to parse the commandline and produce the arguments. More...
 
static void help ()
 Display help.
 

Public Attributes

const arg_map commands
 Parsed commands.
 
integer, parameter commandline_parser_no_error = 0
 Commandline argument not found.
 
integer, parameter commandline_parser_arg_not_found = -1
 Commandline argument not found.
 

Detailed Description

A radial quantity.

Constructor & Destructor Documentation

◆ commandline_parser()

commandline_parser::commandline_parser ( const size_t  argc,
const char *  argv[] 
)
inline

Construct a commandline_parser object by pasring command line arguments.

Parameters
[in]argcNumber of commandline arguments.
[in]argvCommandline strings.

Member Function Documentation

◆ get()

template<typename TYPE >
TYPE 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 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 commandline_parser::parse_commands ( const size_t  argc,
const char *  argv[] 
)
inlinestatic

Factory method to parse the commandline and produce the arguments.

Parameters
[in]argcNumber of commandline arguments.
[in]argvCommandline strings.
Returns
A constructed map of commandline argument key value pairs.

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