OpenASIP  2.0
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
CmdLineParser Class Reference

#include <CmdLineParser.hh>

Inheritance diagram for CmdLineParser:
Inheritance graph
Collaboration diagram for CmdLineParser:
Collaboration graph

Public Member Functions

 CmdLineParser (std::string description)
 
virtual ~CmdLineParser ()
 
virtual void parse (char *argv[], int argc)
 
virtual void parse (std::vector< std::string > options)
 
virtual void storeOptions (Options &options)
 
virtual int numberOfArguments () const
 
virtual std::string argument (int index) const
 

Protected Member Functions

void addOption (CmdLineOptionParser *opt)
 
CmdLineOptionParserfindOption (std::string name) const
 
bool parseOption (std::string option, std::string &name, std::string &arguments, std::string &prefix, bool &hasArgument) const
 
bool readPrefix (std::string &option, std::string &prefix, bool &longOption) const
 
bool isPrefix (std::string name) const
 

Protected Attributes

std::map< std::string, CmdLineOptionParser * > optionLongNames_
 Database for holding options with their long names as a key. More...
 
std::map< std::string, CmdLineOptionParser * > optionShortNames_
 Database for holding options with their short names as a key. More...
 
std::vector< std::string > commandLine_
 Command line is stored here. More...
 
std::vector< std::string > arguments_
 Command line arguments are stored here. More...
 
std::vector< std::string > prefixes_
 Legal prefixes are stored here. More...
 

Private Types

typedef std::map< std::string, CmdLineOptionParser * >::value_type valType
 For adding new values to maps. More...
 
typedef std::map< std::string, CmdLineOptionParser * >::iterator mapIter
 For traversing non-const maps. More...
 
typedef std::map< std::string, CmdLineOptionParser * >::const_iterator constMapIter
 For traversing const maps. More...
 

Private Member Functions

 CmdLineParser (const CmdLineParser &)
 Copying not allowed. More...
 
CmdLineParseroperator= (const CmdLineParser &)
 Assignment not allowed. More...
 
void parseAll ()
 

Private Attributes

std::string progName_
 The name of the program. More...
 
std::string description_
 The description of usage of program. More...
 

Static Private Attributes

static const int SHORT_FLAG = 2
 Number of characters reserved for printing short version of commandline flag. More...
 
static const int LONG_FLAG = 22
 Number of characters reserved for printing long version of commandline flag. More...
 

Detailed Description

Abstract base class for command line parsers.

Is capable of storing and parsing commmand line options.

Definition at line 53 of file CmdLineParser.hh.

Member Typedef Documentation

◆ constMapIter

typedef std::map<std::string, CmdLineOptionParser*>::const_iterator CmdLineParser::constMapIter
private

For traversing const maps.

Definition at line 97 of file CmdLineParser.hh.

◆ mapIter

typedef std::map<std::string, CmdLineOptionParser*>::iterator CmdLineParser::mapIter
private

For traversing non-const maps.

Definition at line 94 of file CmdLineParser.hh.

◆ valType

typedef std::map<std::string, CmdLineOptionParser*>::value_type CmdLineParser::valType
private

For adding new values to maps.

Definition at line 92 of file CmdLineParser.hh.

Constructor & Destructor Documentation

◆ CmdLineParser() [1/2]

CmdLineParser::CmdLineParser ( std::string  description)

Constructor.

Parameters
descriptionBrief description of the program and how to use it. Only prefix is currently "no-".

Definition at line 59 of file CmdLineParser.cc.

59  :
60  progName_(""), description_(description) {
61 
62  prefixes_.push_back(string("no-"));
63 }

References prefixes_.

◆ ~CmdLineParser()

CmdLineParser::~CmdLineParser ( )
virtual

Destructor.

Definition at line 68 of file CmdLineParser.cc.

68  {
69  mapIter i;
70  for (i = optionLongNames_.begin(); i != optionLongNames_.end(); i++) {
71  delete (*i).second;
72  }
73  optionShortNames_.clear();
74  commandLine_.clear();
75 }

References commandLine_, optionLongNames_, and optionShortNames_.

◆ CmdLineParser() [2/2]

CmdLineParser::CmdLineParser ( const CmdLineParser )
private

Copying not allowed.

Member Function Documentation

◆ addOption()

void CmdLineParser::addOption ( CmdLineOptionParser opt)
protected

◆ argument()

virtual std::string CmdLineParser::argument ( int  index) const
virtual

◆ findOption()

CmdLineOptionParser * CmdLineParser::findOption ( std::string  name) const
protected

Try to find a particular option.

Parameters
nameThe name of the option.
Returns
The option if it is found.
Exceptions
IllegalCommandLineIf option is not found.

Definition at line 160 of file CmdLineParser.cc.

160  {
161  constMapIter i = optionLongNames_.find(name);
162  if (i != optionLongNames_.end()) {
163  return (*i).second;
164  }
165 
166  i = optionShortNames_.find(name);
167  if (i != optionShortNames_.end()) {
168  return (*i).second;
169  }
170 
171  string msg = "Unknown option: " + name;
172  string method = "CmdLineParser::findOption()";
173  throw IllegalCommandLine(__FILE__, __LINE__, method, msg);
174 }

References optionLongNames_, and optionShortNames_.

Referenced by ExplorerCmdLineOptions::adfFile(), TTAUnitTesterCmdLineOptions::adfFileName(), ExplorerCmdLineOptions::adfFileName(), ExplorerCmdLineOptions::adfOutFile(), ExplorerCmdLineOptions::adfOutFileName(), LLVMTCECmdLineOptions::analyzeInstructionPatterns(), ExplorerCmdLineOptions::applicationIDToRemove(), ExplorerCmdLineOptions::applicationIDToRemoveCount(), LLVMTCECmdLineOptions::assumeADFStackAlignment(), ProGeCmdLineOptions::asyncReset(), LLVMTCECmdLineOptions::backendCacheDir(), SimulatorCmdLineOptions::backendType(), PIGCmdLineOptions::bemFile(), ProGeCmdLineOptions::bemFile(), SchedulerCmdLineOptions::bypassDistance(), ProGeCmdLineOptions::clockFrequency(), ProGeCmdLineOptions::commaSeparatedList(), ExplorerCmdLineOptions::compilerOptions(), ExplorerCmdLineOptions::compilerOptionsString(), PIGCmdLineOptions::compressorParameter(), PIGCmdLineOptions::compressorParameterCount(), PIGCmdLineOptions::compressorPlugin(), ExplorerCmdLineOptions::configurationToWrite(), LLVMTCECmdLineOptions::conservativePreRAScheduler(), PIGCmdLineOptions::dataImageOutputFormat(), PIGCmdLineOptions::dataMemoryWidthInMAUs(), LLVMTCECmdLineOptions::dataStartAddress(), LLVMTCECmdLineOptions::debugFlag(), SimulatorCmdLineOptions::debugMode(), ProGeCmdLineOptions::deviceFamilyName(), ProGeCmdLineOptions::deviceName(), LLVMTCECmdLineOptions::disableAddressSpaceAA(), LLVMTCECmdLineOptions::disableDelaySlotFiller(), LLVMTCECmdLineOptions::disableHWLoops(), LLVMTCECmdLineOptions::disableLLVMAA(), ProGeCmdLineOptions::dmemType(), LLVMTCECmdLineOptions::dumpDDGsDot(), LLVMTCECmdLineOptions::dumpDDGsXML(), SchedulerCmdLineOptions::dumpIfConversionCFGs(), SchedulerCmdLineOptions::enableOffsetAA(), SchedulerCmdLineOptions::enableStackAA(), PIGCmdLineOptions::entityName(), ProGeCmdLineOptions::entityName(), ExplorerCmdLineOptions::explorerPlugin(), ExplorerCmdLineOptions::explorerPluginParameter(), ExplorerCmdLineOptions::explorerPluginParameterCount(), DisasmCmdLineOptions::flatFile(), ProGeCmdLineOptions::forceOutputDirectory(), TestHDBCmdLineOptions::fuEntryID(), PIGCmdLineOptions::generateDataImages(), PIGCmdLineOptions::generateDecompressor(), LLVMTCECmdLineOptions::generatePluginOnly(), ProGeCmdLineOptions::generateTestbench(), LLVMTCECmdLineOptions::getLLVMargv(), ExplorerCmdLineOptions::hdbFileName(), ExplorerCmdLineOptions::hdbFileNameCount(), ExplorerCmdLineOptions::hdbFileNames(), ProGeCmdLineOptions::hdl(), ProGeCmdLineOptions::idfFile(), ExplorerCmdLineOptions::idfFile(), ExplorerCmdLineOptions::idfFileName(), SchedulerCmdLineOptions::ifConversionThreshold(), BuildOpsetOptions::ignore(), ProGeCmdLineOptions::imemType(), LLVMTCECmdLineOptions::initialStackPointerValue(), ProGeCmdLineOptions::integratorName(), LLVMTCECmdLineOptions::isDataStartAddressSet(), TestHDBCmdLineOptions::isFUEntryIDGiven(), LLVMTCECmdLineOptions::isInitialStackPointerValueSet(), SchedulerCmdLineOptions::isLoopOptDefined(), SchedulerCmdLineOptions::isMachineFileDefined(), LLVMTCECmdLineOptions::isOptLevelDefined(), SchedulerCmdLineOptions::isOutputFileDefined(), TestHDBCmdLineOptions::isRFEntryIDGiven(), LLVMTCECmdLineOptions::isStandardEmulationLibDefined(), CmdLineOptions::isVerboseSpamSwitchDefined(), LLVMTCECmdLineOptions::isVerboseSwitchDefined(), CmdLineOptions::isVerboseSwitchDefined(), LLVMTCECmdLineOptions::isWorkItemAAFileDefined(), SchedulerCmdLineOptions::killDeadResults(), TTAUnitTesterCmdLineOptions::leaveDirty(), TestHDBCmdLineOptions::leaveDirty(), DisasmCmdLineOptions::lineNumbers(), ProGeCmdLineOptions::listAvailableIntegrators(), EstimatorCmdLineOptions::longestPath(), SchedulerCmdLineOptions::lowMemModeThreshold(), SchedulerCmdLineOptions::machineFile(), SimulatorCmdLineOptions::machineFile(), SchedulerCmdLineOptions::noaliasFunctions(), SchedulerCmdLineOptions::noDreBypassDistance(), ExplorerCmdLineOptions::numberOfConfigurations(), ExplorerCmdLineOptions::numberOfConfigurationsToWrite(), DumperCmdLineOptions::onlyLogicalInfo(), SchedulerCmdLineOptions::operandShareDistance(), CmdLineOptions::optionGiven(), LLVMTCECmdLineOptions::optLevel(), ProGeCmdLineOptions::outputDirectory(), BEMGeneratorCmdLineOptions::outputFile(), SchedulerCmdLineOptions::outputFile(), DisasmCmdLineOptions::outputFile(), DisasmCmdLineOptions::outputFileDefined(), MachInfoCmdLineOptions::outputFileNameSuffix(), MachInfoCmdLineOptions::outputFormat(), ExplorerCmdLineOptions::paretoSetValues(), CmdLineOptions::parseAll(), parseAll(), ExplorerCmdLineOptions::pluginInfo(), ProGeCmdLineOptions::pluginParametersQuery(), ProGeCmdLineOptions::preferHDLGeneration(), LLVMTCECmdLineOptions::primaryFunctions(), ExplorerCmdLineOptions::printApplications(), DumperCmdLineOptions::printFileHeaders(), CmdLineOptions::printHelp(), LLVMTCECmdLineOptions::printInlineAsmWarnings(), DumperCmdLineOptions::printMemoryInfo(), ExplorerCmdLineOptions::printPlugins(), DumperCmdLineOptions::printRelocations(), SchedulerCmdLineOptions::printResourceConstraints(), DumperCmdLineOptions::printSectionHeaders(), ExplorerCmdLineOptions::printSummary(), DumperCmdLineOptions::printSymbols(), DisasmCmdLineOptions::printToStdout(), PIGCmdLineOptions::progeOutputDirectory(), SimulatorCmdLineOptions::programFile(), PIGCmdLineOptions::programImageOutputFormat(), SchedulerCmdLineOptions::renameRegisters(), ProGeCmdLineOptions::resetAllRegisters(), TestHDBCmdLineOptions::rfEntryID(), EstimatorCmdLineOptions::runOnlyEstimations(), LLVMTCECmdLineOptions::saveBackendPlugin(), SchedulerCmdLineOptions::schedulingWindowSize(), SimulatorCmdLineOptions::scriptString(), DumperCmdLineOptions::sectionId(), DumperCmdLineOptions::sectionIdCount(), ProGeCmdLineOptions::sharedOutputDirectory(), PIGCmdLineOptions::showCompressors(), ProGeCmdLineOptions::simulationRuntime(), BuildOpsetOptions::sourceDir(), LLVMTCECmdLineOptions::standardEmulationLib(), ExplorerCmdLineOptions::startConfiguration(), ExplorerCmdLineOptions::summaryOrdering(), ProGeCmdLineOptions::syncReset(), LLVMTCECmdLineOptions::tempDir(), ExplorerCmdLineOptions::testApplicationDirectory(), ExplorerCmdLineOptions::testApplicationDirectoryCount(), EstimatorCmdLineOptions::totalArea(), EstimatorCmdLineOptions::totalEnergy(), EstimatorCmdLineOptions::TPEF(), PIGCmdLineOptions::tpefFile(), PIGCmdLineOptions::tpefFileCount(), ProGeCmdLineOptions::tpefName(), EstimatorCmdLineOptions::traceDB(), ProGeCmdLineOptions::useAbsolutePaths(), LLVMTCECmdLineOptions::useBubbleFish2Scheduler(), LLVMTCECmdLineOptions::useBUScheduler(), LLVMTCECmdLineOptions::useOldBackendSources(), SchedulerCmdLineOptions::useRestrictedAliasAnalyzer(), LLVMTCECmdLineOptions::useTDScheduler(), LLVMTCECmdLineOptions::useVectorBackend(), TTAUnitTesterCmdLineOptions::verbose(), TestHDBCmdLineOptions::verbose(), TTAUnitTesterCmdLineOptions::vhdlSim(), TestHDBCmdLineOptions::vhdlSim(), LLVMTCECmdLineOptions::workItemAAFile(), ExplorerCmdLineOptions::writeOutBestConfiguration(), and ExplorerCmdLineOptions::writeOutConfiguration().

◆ isPrefix()

bool CmdLineParser::isPrefix ( std::string  name) const
protected

◆ numberOfArguments()

virtual int CmdLineParser::numberOfArguments ( ) const
virtual

◆ operator=()

CmdLineParser& CmdLineParser::operator= ( const CmdLineParser )
private

Assignment not allowed.

◆ parse() [1/2]

void CmdLineParser::parse ( char *  argv[],
int  argc 
)
virtual

Loads all command line arguments and parses them.

Parameters
argvCommand line options.
argcThe number of command line options.
Exceptions
IllegalCommandLineIf parsing is not succesfull.
ParserStopRequestIf help or version option is found.

Reimplemented in CmdLineOptions.

Definition at line 109 of file CmdLineParser.cc.

109  {
110  // command line is emptied
111  commandLine_.clear();
112  progName_ = string(argv[0]);
113 
114  for (int i = 1; i < argc; i++) {
115  commandLine_.push_back(string(argv[i]));
116  }
117  parseAll();
118 }

References commandLine_, parseAll(), and progName_.

Here is the call graph for this function:

◆ parse() [2/2]

void CmdLineParser::parse ( std::vector< std::string >  options)
virtual

Loads all command line arguments and parses them.

Parameters
optionsCommand line options pre-parsed in vector.
argcThe number of command line options.
Exceptions
IllegalCommandLineIf parsing is not succesfull.
ParserStopRequestIf help or version option is found.

Reimplemented in CmdLineOptions.

Definition at line 129 of file CmdLineParser.cc.

129  {
130  // command line is emptied
131  commandLine_.clear();
132 
133  for (unsigned int i = 0; i < options.size(); i++) {
134  bool spaces = true;
135  string::size_type curPos = 0;
136  while (spaces) {
137  string::size_type pos = options[i].find(" ", curPos);
138  if (pos != string::npos) {
139  commandLine_.push_back(string(options[i].substr(pos, curPos)));
140  curPos = pos;
141  } else {
142  if (options[i].length() - curPos > 0) {
143  commandLine_.push_back(string(options[i].substr(curPos)));
144  }
145  spaces = false;
146  }
147  }
148  }
149  parseAll();
150 }

References commandLine_, options, and parseAll().

Here is the call graph for this function:

◆ parseAll()

void CmdLineParser::parseAll ( )
private

Parses all command line options.

Exceptions
IllegalCommandLineIf parsing fails.

Definition at line 182 of file CmdLineParser.cc.

182  {
183  // finished is set to true when options are parsed and the rest are
184  // command line arguments
185  bool finished = false;
186 
187  // checkArguments is set to false when command line arguments can start
188  // with "-" or "--"
189  bool checkArguments = true;
190  unsigned int i = 0;
191 
192  while (i < commandLine_.size()) {
193  string optString = commandLine_[i];
194 
195  if (!finished) {
196  string prefix = "";
197  string name = "";
198  string arguments = "";
199 
200  // hasArgument is true when option has argument
201  bool hasArgument = true;
202 
203  if (!parseOption(optString, name, arguments, prefix, hasArgument)) {
204  finished = true;
205  if (optString == "--") {
206  checkArguments = false;
207  i++;
208  continue;
209  } else {
210  arguments_.push_back(optString);
211  i++;
212  continue;
213  }
214  }
215 
216  CmdLineOptionParser* opt = findOption(name);
217 
218  if (arguments == "" &&
219  dynamic_cast<BoolCmdLineOptionParser*>(opt) == NULL) {
220 
221  // argument for an option may be separated with space
222  if (i < commandLine_.size() - 1 &&
223  commandLine_[i+1].substr(0, 1) != "-") {
224  hasArgument = true;
225  arguments = commandLine_[i+1];
226  i++;
227  }
228  }
229 
230  bool doneWithParsing = opt->parseValue(arguments, prefix);
231 
232  if (!doneWithParsing) {
233  if (hasArgument) {
234  // all the rest in command line are "extra" strings
235  arguments_.push_back(arguments);
236  finished = true;
237  i++;
238  } else {
239  // this is the situation when we have something like
240  // -abcd (multible flags put together)
241  for (unsigned int i = 0; i < arguments.length(); i++) {
242  opt = findOption(arguments.substr(i, 1));
243  opt->parseValue("", prefix);
244  }
245  }
246  }
247  } else {
248 
249  // finished reading options, all rest are command line arguments
250  if (checkArguments && optString[0] == '-') {
251  string msg = "Illegal command line argument: " + optString;
252  string method = "CmdLineParser::parse()";
253  throw IllegalCommandLine(__FILE__, __LINE__, method, msg);
254  }
255  arguments_.push_back(optString);
256  }
257  i++;
258  }
259 }

References arguments_, commandLine_, findOption(), parseOption(), and CmdLineOptionParser::parseValue().

Referenced by parse().

Here is the call graph for this function:

◆ parseOption()

bool CmdLineParser::parseOption ( std::string  option,
std::string &  name,
std::string &  arguments,
std::string &  prefix,
bool &  hasArgument 
) const
protected

Parses one option.

Each option should have name and prefix (-, –, -no, or –no). Arguments are mandatory for all except Boolean options.

Parameters
optionThe whole option.
nameThe name of the option.
argumentsThe arguments for option.
prefixThe prefix of option.
hasArgumentFalse if argument is part of option body (eg. -abc).
Returns
True if option is command line option, false if option is command line argument.
Exceptions
IllegalCommandLineIf option is illegal.

Definition at line 277 of file CmdLineParser.cc.

279  {
280  // first there is either '-' or '--'
281  bool longOption = false;
282  if (!readPrefix(option, prefix, longOption)) {
283  return false;
284  }
285 
286  if (longOption) {
287  // then there is the name of the option
288  unsigned int pos = 0;
289  while (pos < option.length() && option[pos] != '=') {
290  ++pos;
291  }
292  name = option.substr(0, pos);
293  option.erase(0, pos);
294  } else {
295  // option name is only one character
296  name = option.substr(0, 1);
297  option.erase(0, 1);
298  }
299 
300  // then there might be value
301  if (option.length() > 0 && option[0] == '=') {
302  if (!longOption) {
303  string method = "CmdLineParser::parseOption()";
304  string message = "Illegal short option: = not allowed.";
305  throw IllegalCommandLine(__FILE__, __LINE__, method, message);
306  }
307  option.erase(0, 1);
308  arguments = option;
309  } else {
310  arguments = option;
311  if (arguments == "" || !longOption) {
312  hasArgument = false;
313  }
314  }
315  return true;
316 }

References readPrefix().

Referenced by CmdLineOptions::parseAll(), and parseAll().

Here is the call graph for this function:

◆ readPrefix()

bool CmdLineParser::readPrefix ( std::string &  option,
std::string &  prefix,
bool &  longOption 
) const
protected

Reads prefix of option.

Parameters
optionThe whole option as a string.
prefixThe prefix of option.
longOptionTrue if option starts with "--".
Returns
True, if prefix is found, false otherwise.

Definition at line 327 of file CmdLineParser.cc.

330  {
331 
332  if (option == "--") {
333  return false;
334  } else if (option.substr(0, 1) != "-") {
335  return false;
336  } else {
337  option.erase(0, 1);
338  if (option.substr(0, 1) == "-") {
339  longOption = true;
340  option.erase(0, 1);
341  }
342 
343  // then there might be also something else in the prefix
344  // (eg. --no-print, prefix is --no)
345  for (unsigned int i = 0; i < prefixes_.size(); i++) {
346 
347  if (option.length() > prefixes_[i].length() &&
348  option.substr(0, prefixes_[i].length()) == prefixes_[i]) {
349 
350  prefix = prefixes_[i];
351  option.erase(0, prefix.length());
352  break;
353  }
354  }
355  }
356  return true;
357 }

References prefixes_.

Referenced by parseOption().

◆ storeOptions()

void CmdLineParser::storeOptions ( Options options)
virtual

Stores options to Options class.

Parameters
optionsOptions-object where the options are stored.

Definition at line 83 of file CmdLineParser.cc.

83  {
84 
85  mapIter i = optionLongNames_.begin();
86  for (; i != optionLongNames_.end(); i++) {
87  string name = (*i).first;
88  CmdLineOptionParser* current = (*i).second;
89  options.addOptionValue(name, current->copy());
90  }
91 
92  i = optionShortNames_.begin();
93  for (; i != optionShortNames_.end(); i++) {
94  string name = (*i).first;
95  CmdLineOptionParser* current = (*i).second;
96  options.addOptionValue(name, current->copy());
97  }
98 }

References CmdLineOptionParser::copy(), optionLongNames_, options, and optionShortNames_.

Here is the call graph for this function:

Member Data Documentation

◆ arguments_

std::vector<std::string> CmdLineParser::arguments_
protected

Command line arguments are stored here.

Definition at line 86 of file CmdLineParser.hh.

Referenced by CmdLineOptions::parseAll(), and parseAll().

◆ commandLine_

std::vector<std::string> CmdLineParser::commandLine_
protected

Command line is stored here.

Definition at line 84 of file CmdLineParser.hh.

Referenced by parse(), CmdLineOptions::parse(), CmdLineOptions::parseAll(), parseAll(), and ~CmdLineParser().

◆ description_

std::string CmdLineParser::description_
private

The description of usage of program.

Definition at line 109 of file CmdLineParser.hh.

◆ LONG_FLAG

const int CmdLineParser::LONG_FLAG = 22
staticprivate

Number of characters reserved for printing long version of commandline flag.

Definition at line 117 of file CmdLineParser.hh.

◆ optionLongNames_

std::map<std::string, CmdLineOptionParser*> CmdLineParser::optionLongNames_
protected

Database for holding options with their long names as a key.

Definition at line 79 of file CmdLineParser.hh.

Referenced by findOption(), CmdLineOptions::printHelp(), storeOptions(), and ~CmdLineParser().

◆ optionShortNames_

std::map<std::string, CmdLineOptionParser*> CmdLineParser::optionShortNames_
protected

Database for holding options with their short names as a key.

Definition at line 81 of file CmdLineParser.hh.

Referenced by findOption(), storeOptions(), and ~CmdLineParser().

◆ prefixes_

std::vector<std::string> CmdLineParser::prefixes_
protected

Legal prefixes are stored here.

Definition at line 88 of file CmdLineParser.hh.

Referenced by CmdLineParser(), and readPrefix().

◆ progName_

std::string CmdLineParser::progName_
private

The name of the program.

Definition at line 107 of file CmdLineParser.hh.

Referenced by parse().

◆ SHORT_FLAG

const int CmdLineParser::SHORT_FLAG = 2
staticprivate

Number of characters reserved for printing short version of commandline flag.

Definition at line 113 of file CmdLineParser.hh.


The documentation for this class was generated from the following files:
IllegalCommandLine
Definition: Exception.hh:438
CmdLineParser::constMapIter
std::map< std::string, CmdLineOptionParser * >::const_iterator constMapIter
For traversing const maps.
Definition: CmdLineParser.hh:97
CmdLineParser::commandLine_
std::vector< std::string > commandLine_
Command line is stored here.
Definition: CmdLineParser.hh:84
CmdLineParser::optionLongNames_
std::map< std::string, CmdLineOptionParser * > optionLongNames_
Database for holding options with their long names as a key.
Definition: CmdLineParser.hh:79
CmdLineParser::parseAll
void parseAll()
Definition: CmdLineParser.cc:182
CmdLineOptionParser::parseValue
virtual bool parseValue(std::string arguments, std::string prefix)=0
Pure virtual function that parses the value of option.
CmdLineParser::parseOption
bool parseOption(std::string option, std::string &name, std::string &arguments, std::string &prefix, bool &hasArgument) const
Definition: CmdLineParser.cc:277
CmdLineParser::mapIter
std::map< std::string, CmdLineOptionParser * >::iterator mapIter
For traversing non-const maps.
Definition: CmdLineParser.hh:94
CmdLineOptionParser::copy
virtual OptionValue * copy() const =0
CmdLineOptionParser
Definition: CmdLineOptionParser.hh:56
CmdLineParser::arguments_
std::vector< std::string > arguments_
Command line arguments are stored here.
Definition: CmdLineParser.hh:86
BoolCmdLineOptionParser
Definition: CmdLineOptionParser.hh:278
CmdLineParser::readPrefix
bool readPrefix(std::string &option, std::string &prefix, bool &longOption) const
Definition: CmdLineParser.cc:327
CmdLineParser::description_
std::string description_
The description of usage of program.
Definition: CmdLineParser.hh:109
CmdLineParser::progName_
std::string progName_
The name of the program.
Definition: CmdLineParser.hh:107
options
static MachInfoCmdLineOptions options
Definition: MachInfo.cc:46
CmdLineParser::optionShortNames_
std::map< std::string, CmdLineOptionParser * > optionShortNames_
Database for holding options with their short names as a key.
Definition: CmdLineParser.hh:81
CmdLineParser::findOption
CmdLineOptionParser * findOption(std::string name) const
Definition: CmdLineParser.cc:160
CmdLineParser::prefixes_
std::vector< std::string > prefixes_
Legal prefixes are stored here.
Definition: CmdLineParser.hh:88