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

#include <CommandLine.h>

Collaboration diagram for pool::CommandLine:

Public Types

typedef std::map< std::string, std::string > ARGMAPTYPE
 

Public Member Functions

 CommandLine (int argc, char *argv[])
 
 CommandLine (int argc, char *argv[], const std::string &strFileName)
 
 CommandLine (const std::string &strFileName)
 Command line arguments may also be supplied exclusively from a file. More...
 
virtual ~CommandLine ()
 
std::string GetByName (const std::string &strArgName) const
 
bool Exists (const std::string &strArgName) const
 
int Count () const
 
virtual std::string Usage ()
 
void DumpDiagnostics () const
 
std::string GetProgramName () const
 
virtual void CheckOptions (const char *opts[])
 

Private Member Functions

bool IsParamName (const std::string &strValue) const
 
std::string GetParamName (const std::string &strWord) const
 
void ParseCommandLine (int argc, char *argv[])
 
void ParseSettings (const std::string &strInput)
 
std::string LoadSettingsFile (const std::string &strFileName)
 
void TranslateQuotes (std::istringstream &ist, std::string &strWord)
 
 CommandLine (const CommandLine &)
 
CommandLineoperator= (const CommandLine &)
 

Private Attributes

int mnParameterCount
 
ARGMAPTYPE mArgMap
 
std::string mstrProgramName
 

Detailed Description

Definition at line 42 of file CommandLine.h.

Member Typedef Documentation

◆ ARGMAPTYPE

typedef std::map<std::string, std::string> pool::CommandLine::ARGMAPTYPE

Definition at line 45 of file CommandLine.h.

Constructor & Destructor Documentation

◆ CommandLine() [1/4]

pool::CommandLine::CommandLine ( int  argc,
char *  argv[] 
)

◆ CommandLine() [2/4]

pool::CommandLine::CommandLine ( int  argc,
char *  argv[],
const std::string &  strFileName 
)

◆ CommandLine() [3/4]

pool::CommandLine::CommandLine ( const std::string &  strFileName)

Command line arguments may also be supplied exclusively from a file.

◆ ~CommandLine()

virtual pool::CommandLine::~CommandLine ( )
virtual

◆ CommandLine() [4/4]

pool::CommandLine::CommandLine ( const CommandLine )
private

Member Function Documentation

◆ CheckOptions()

virtual void pool::CommandLine::CheckOptions ( const char *  opts[])
virtual

◆ Count()

int pool::CommandLine::Count ( ) const
inline

Definition at line 80 of file CommandLine.h.

81  {
82  return mnParameterCount;
83  }

◆ DumpDiagnostics()

void pool::CommandLine::DumpDiagnostics ( ) const

◆ Exists()

bool pool::CommandLine::Exists ( const std::string &  strArgName) const
inline

Definition at line 99 of file CommandLine.h.

100  {
101  return( mArgMap.find(strArgName) != mArgMap.end() );
102  }

◆ GetByName()

std::string pool::CommandLine::GetByName ( const std::string &  strArgName) const

◆ GetParamName()

std::string pool::CommandLine::GetParamName ( const std::string &  strWord) const
inlineprivate

Definition at line 90 of file CommandLine.h.

91  {
92  if (IsParamName(strWord) )
93  {
94  return strWord.substr(1, strWord.length() - 1);
95  }
96  return strWord;
97  }

◆ GetProgramName()

std::string pool::CommandLine::GetProgramName ( ) const
inline

Definition at line 104 of file CommandLine.h.

105  {
106  return mstrProgramName;
107  }

◆ IsParamName()

bool pool::CommandLine::IsParamName ( const std::string &  strValue) const
inlineprivate

Definition at line 85 of file CommandLine.h.

86  {
87  return ( (strWord.length()) > 1 && ( strWord[0] == '-' ) );
88  }

◆ LoadSettingsFile()

std::string pool::CommandLine::LoadSettingsFile ( const std::string &  strFileName)
private

◆ operator=()

CommandLine& pool::CommandLine::operator= ( const CommandLine )
private

◆ ParseCommandLine()

void pool::CommandLine::ParseCommandLine ( int  argc,
char *  argv[] 
)
private

◆ ParseSettings()

void pool::CommandLine::ParseSettings ( const std::string &  strInput)
private

◆ TranslateQuotes()

void pool::CommandLine::TranslateQuotes ( std::istringstream &  ist,
std::string &  strWord 
)
private

◆ Usage()

virtual std::string pool::CommandLine::Usage ( )
virtual

Member Data Documentation

◆ mArgMap

ARGMAPTYPE pool::CommandLine::mArgMap
private

Definition at line 70 of file CommandLine.h.

◆ mnParameterCount

int pool::CommandLine::mnParameterCount
private

Definition at line 69 of file CommandLine.h.

◆ mstrProgramName

std::string pool::CommandLine::mstrProgramName
private

Definition at line 71 of file CommandLine.h.


The documentation for this class was generated from the following file:
pool::CommandLine::mnParameterCount
int mnParameterCount
Definition: CommandLine.h:69
pool::CommandLine::mstrProgramName
std::string mstrProgramName
Definition: CommandLine.h:71
pool::CommandLine::mArgMap
ARGMAPTYPE mArgMap
Definition: CommandLine.h:70
pool::CommandLine::IsParamName
bool IsParamName(const std::string &strValue) const
Definition: CommandLine.h:85