ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
pool::CmdLineArgs Class Reference

#include <CmdLineArgs.h>

Collaboration diagram for pool::CmdLineArgs:

Public Member Functions

 CmdLineArgs (int argc, const char *argv[])
 Constructor.
More...
 
bool hasQual (const std::string arg) const
 Check if argument is in command line. More...
 
std::string getArg (const std::string arg)
 Get argument from command line using qualifier. More...
 
std::string getArg (std::vector< std::string >::const_iterator itr)
 Get argument from command line using position. More...
 
std::vector< std::string >::const_iterator getPos () const
 Get position on command line. More...
 

Private Attributes

std::vector< std::string > argvVector
 
std::vector< std::string >::const_iterator vecItr
 

Detailed Description

Definition at line 15 of file CmdLineArgs.h.

Constructor & Destructor Documentation

◆ CmdLineArgs()

pool::CmdLineArgs::CmdLineArgs ( int  argc,
const char *  argv[] 
)
inline

Constructor.

Definition at line 41 of file CmdLineArgs.h.

42  : argvVector(argc)
43  {
44  for( int i=0; i < argc; ++i )
45  argvVector[i].assign( argv[i] );
46  vecItr = argvVector.begin();
47  }

Member Function Documentation

◆ getArg() [1/2]

std::string pool::CmdLineArgs::getArg ( const std::string  arg)
inline

Get argument from command line using qualifier.

Definition at line 57 of file CmdLineArgs.h.

58  {
59  std::vector<std::string>::const_iterator itr
60  = std::find( argvVector.begin(), argvVector.end(), arg );
61  return ( getArg( itr ) );
62  }

◆ getArg() [2/2]

std::string pool::CmdLineArgs::getArg ( std::vector< std::string >::const_iterator  itr)
inline

Get argument from command line using position.

Definition at line 65 of file CmdLineArgs.h.

67  {
68  vecItr = itr;
69  if ( vecItr != argvVector.end() )
70  {
71  vecItr++;
72  if ( vecItr != argvVector.end() )
73  {
74  return *vecItr;
75  }
76  else
77  {
78  return ("");
79  }
80  }
81  else
82  {
83  return ("");
84  }
85  }

◆ getPos()

std::vector< std::string >::const_iterator pool::CmdLineArgs::getPos ( ) const
inline

Get position on command line.

Definition at line 88 of file CmdLineArgs.h.

89  {
90  return vecItr;
91  }

◆ hasQual()

bool pool::CmdLineArgs::hasQual ( const std::string  arg) const
inline

Check if argument is in command line.

Definition at line 50 of file CmdLineArgs.h.

51  {
52  return ( std::find( argvVector.begin(), argvVector.end(), arg ) !=
53  argvVector.end() );
54  }

Member Data Documentation

◆ argvVector

std::vector<std::string> pool::CmdLineArgs::argvVector
private

Definition at line 36 of file CmdLineArgs.h.

◆ vecItr

std::vector<std::string>::const_iterator pool::CmdLineArgs::vecItr
private

Definition at line 37 of file CmdLineArgs.h.


The documentation for this class was generated from the following file:
pool::CmdLineArgs::getArg
std::string getArg(const std::string arg)
Get argument from command line using qualifier.
Definition: CmdLineArgs.h:57
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
pool::CmdLineArgs::argvVector
std::vector< std::string > argvVector
Definition: CmdLineArgs.h:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArCellNtuple.argv
argv
Definition: LArCellNtuple.py:152
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:20
create_dcsc_inputs_sqlite.arg
list arg
Definition: create_dcsc_inputs_sqlite.py:48
pool::CmdLineArgs::vecItr
std::vector< std::string >::const_iterator vecItr
Definition: CmdLineArgs.h:37