Belle II Software development
InputParser Class Reference

Public Member Functions

 InputParser (const int &argc, char **argv)
 
const std::string & getCmdOption (const std::string &option) const
 
bool cmdOptionExists (const std::string &option) const
 

Private Attributes

std::vector< std::string > tokens
 

Detailed Description

Definition at line 14 of file trg-cdc-neurotrigger-writedb.cc.

Constructor & Destructor Documentation

◆ InputParser()

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

Definition at line 16 of file trg-cdc-neurotrigger-writedb.cc.

17 {
18 for (int i = 1; i < argc; ++i)
19 this->tokens.push_back(std::string(argv[i]));
20 }

Member Function Documentation

◆ cmdOptionExists()

bool cmdOptionExists ( const std::string &  option) const
inline

Definition at line 31 of file trg-cdc-neurotrigger-writedb.cc.

32 {
33 return std::find(this->tokens.begin(), this->tokens.end(), option)
34 != this->tokens.end();
35 }

◆ getCmdOption()

const std::string & getCmdOption ( const std::string &  option) const
inline

Definition at line 21 of file trg-cdc-neurotrigger-writedb.cc.

22 {
23 std::vector<std::string>::const_iterator itr;
24 itr = std::find(this->tokens.begin(), this->tokens.end(), option);
25 if (itr != this->tokens.end() && ++itr != this->tokens.end()) {
26 return *itr;
27 }
28 static const std::string empty_string("");
29 return empty_string;
30 }

Member Data Documentation

◆ tokens

std::vector<std::string> tokens
private

Definition at line 37 of file trg-cdc-neurotrigger-writedb.cc.


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