Cholla 3.0.1-dev
Cholla - Massively parallel hydro on GPUs
Loading...
Searching...
No Matches
Public Member Functions | List of all members
InputParser Class Reference

Class for parsing input flags. Modified from https://stackoverflow.com/questions/865668/parsing-command-line-arguments-in-c. More...

Public Member Functions

const std::string & Get_Cmd_Option (const std::string &option) const
 Get the option that follows the given flag. Also checks that the flag exists and is not empty.
 
bool Cmd_Option_Exists (const std::string &option) const
 Checks that an option exists. Returns True if it exists and False otherwise.
 
 InputParser (int &argc, char **argv)
 Construct a new Input Parser object.
 

Detailed Description

Class for parsing input flags. Modified from https://stackoverflow.com/questions/865668/parsing-command-line-arguments-in-c.

Constructor & Destructor Documentation

◆ InputParser()

InputParser::InputParser ( int &  argc,
char **  argv 
)
inline

Construct a new Input Parser object.

Parameters
argcargc from main
argvargv from main

Member Function Documentation

◆ Cmd_Option_Exists()

bool InputParser::Cmd_Option_Exists ( const std::string &  option) const
inline

Checks that an option exists. Returns True if it exists and False otherwise.

Parameters
optionThe option flag to search for
Returns
true The option flag exists in argv
false The option flage does not exist in argv

◆ Get_Cmd_Option()

const std::string & InputParser::Get_Cmd_Option ( const std::string &  option) const
inline

Get the option that follows the given flag. Also checks that the flag exists and is not empty.

Parameters
optionThe string option to look for
Returns
const std::string& The option the follows a given flag

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