FastJet 3.4.1
Public Member Functions | List of all members
CmdLine Class Reference

More...

#include </home/greg/work/fastjet/top-level/release-helpers/fastjet/example/CmdLine.hh>

Public Member Functions

 CmdLine (const int argc, char **argv)
 initialise a CmdLine from a C-style array of command-line arguments More...
 
 CmdLine (const vector< string > &args)
 initialise a CmdLine from a C++ vector of arguments More...
 
bool present (const string &opt) const
 true if the option is present More...
 
bool present_and_set (const string &opt) const
 true if the option is present and corresponds to a value More...
 
const vector< string > & arguments () const
 return a reference to the vector of command-line arguments (0 is command). More...
 
template<class T >
value (const string &opt) const
 returns the value of the argument converted to type T More...
 
template<class T >
value (const string &opt, const T &defval) const
 
int int_val (const string &opt) const
 return the integer value corresponding to the given option More...
 
int int_val (const string &opt, const int &defval) const
 return the integer value corresponding to the given option or default if option is absent More...
 
double double_val (const string &opt) const
 return the double value corresponding to the given option More...
 
double double_val (const string &opt, const double &defval) const
 return the double value corresponding to the given option or default if option is absent More...
 
string string_val (const string &opt) const
 return the string value corresponding to the given option More...
 
string string_val (const string &opt, const string &defval) const
 return the string value corresponding to the given option or default if option is absent More...
 
string command_line () const
 return the full command line More...
 
bool all_options_used () const
 return true if all options have been asked for at some point or other More...
 
template<>
string value (const string &opt) const
 for the string case, just copy the string... More...
 

Detailed Description

Definition at line 53 of file CmdLine.hh.

Constructor & Destructor Documentation

◆ CmdLine() [1/3]

CmdLine::CmdLine ( )
inline

Definition at line 61 of file CmdLine.hh.

◆ CmdLine() [2/3]

CmdLine::CmdLine ( const int  argc,
char **  argv 
)

initialise a CmdLine from a C-style array of command-line arguments

Definition at line 41 of file CmdLine.cc.

◆ CmdLine() [3/3]

CmdLine::CmdLine ( const vector< string > &  args)

initialise a CmdLine from a C++ vector of arguments

constructor from a vector of strings, one argument per string

Definition at line 50 of file CmdLine.cc.

Member Function Documentation

◆ present()

bool CmdLine::present ( const string &  opt) const

true if the option is present

Definition at line 89 of file CmdLine.cc.

◆ present_and_set()

bool CmdLine::present_and_set ( const string &  opt) const

true if the option is present and corresponds to a value

Definition at line 96 of file CmdLine.cc.

◆ arguments()

const vector< string > & CmdLine::arguments ( ) const
inline

return a reference to the vector of command-line arguments (0 is command).

Definition at line 74 of file CmdLine.hh.

◆ value() [1/3]

template<class T >
T CmdLine::value ( const string &  opt) const

returns the value of the argument converted to type T

Definition at line 116 of file CmdLine.hh.

◆ value() [2/3]

template<class T >
T CmdLine::value ( const string &  opt,
const T &  defval 
) const

Definition at line 131 of file CmdLine.hh.

◆ int_val() [1/2]

int CmdLine::int_val ( const string &  opt) const

return the integer value corresponding to the given option

Definition at line 125 of file CmdLine.cc.

◆ int_val() [2/2]

int CmdLine::int_val ( const string &  opt,
const int &  defval 
) const

return the integer value corresponding to the given option or default if option is absent

Definition at line 138 of file CmdLine.cc.

◆ double_val() [1/2]

double CmdLine::double_val ( const string &  opt) const

return the double value corresponding to the given option

Definition at line 147 of file CmdLine.cc.

◆ double_val() [2/2]

double CmdLine::double_val ( const string &  opt,
const double &  defval 
) const

return the double value corresponding to the given option or default if option is absent

Definition at line 160 of file CmdLine.cc.

◆ string_val() [1/2]

string CmdLine::string_val ( const string &  opt) const

return the string value corresponding to the given option

Definition at line 103 of file CmdLine.cc.

◆ string_val() [2/2]

string CmdLine::string_val ( const string &  opt,
const string &  defval 
) const

return the string value corresponding to the given option or default if option is absent

Definition at line 117 of file CmdLine.cc.

◆ command_line()

string CmdLine::command_line ( ) const

return the full command line

Definition at line 167 of file CmdLine.cc.

◆ all_options_used()

bool CmdLine::all_options_used ( ) const

return true if all options have been asked for at some point or other

Definition at line 173 of file CmdLine.cc.

◆ value() [3/3]

template<>
string CmdLine::value ( const string &  opt) const
inline

for the string case, just copy the string...

Definition at line 126 of file CmdLine.hh.


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