#include <ArgumentParser.hpp>
Definition at line 25 of file ArgumentParser.hpp.
|
| ArgumentParser (int argumentCount, char **argumentCharArrays, std::string const inputTag="", std::string const fallbackInputFilename="") |
|
std::string | fromLiteral (std::string const &argumentName, std::string const defaultReturnString="") const |
|
std::string | fromTag (std::string const &tagString, std::string const defaultReturnString="") |
|
| ~ArgumentParser () |
|
◆ ArgumentParser()
BOL::ArgumentParser::ArgumentParser |
( |
int |
argumentCount, |
|
|
char ** |
argumentCharArrays, |
|
|
std::string const |
inputTag = "" , |
|
|
std::string const |
fallbackInputFilename = "" |
|
) |
| |
Definition at line 17 of file ArgumentParser.cpp.
26 for(
int whichArgument( 1 );
27 argumentCount > whichArgument;
31 argumentCharArrays[ whichArgument ] );
33 if( !(inputTag.empty()) )
35 std::string inputFilename(
fromTag( inputTag ) );
36 if( inputFilename.empty() )
38 inputFilename.assign( fallbackInputFilename );
44 if( !(inputFilename.empty()) )
51 if( !successfullyRead )
55 <<
"BOL::ArgumentParser constructor failed to open root element of"
56 <<
" \"" << inputFilename <<
"\"!";
57 std::cout << std::endl;
AsciiXmlParser inputXmlParser
std::string fromTag(std::string const &tagString, std::string const defaultReturnString="")
std::vector< std::string > argumentStrings
bool loadString(std::string const stringToParse)
std::string const & getCurrentElementContent() const
bool readAllOfRootElementOfFile(std::string const &fileName)
◆ ~ArgumentParser()
BOL::ArgumentParser::~ArgumentParser |
( |
| ) |
|
◆ fromLiteral()
std::string BOL::ArgumentParser::fromLiteral |
( |
std::string const & |
argumentName, |
|
|
std::string const |
defaultReturnString = "" |
|
) |
| const |
|
inline |
Definition at line 59 of file ArgumentParser.hpp.
65 for( std::vector< std::string >::const_iterator
70 if( 0 == whichArgument->compare( 0,
74 return whichArgument->substr( argumentName.size() );
77 return defaultReturnString;
◆ fromTag()
std::string BOL::ArgumentParser::fromTag |
( |
std::string const & |
tagString, |
|
|
std::string const |
defaultReturnString = "" |
|
) |
| |
|
inline |
Definition at line 81 of file ArgumentParser.hpp.
88 std::string argumentString(
"--" );
89 argumentString.append( tagString );
90 argumentString.append(
"=" );
91 argumentString.assign(
fromLiteral( argumentString ) );
92 if( !(argumentString.empty()) )
94 return argumentString;
106 return defaultReturnString;
std::string fromLiteral(std::string const &argumentName, std::string const defaultReturnString="") const
void returnToBeginningOfText()
bool currentElementNameMatches(std::string const &comparisonString) const
static std::string const whitespaceAndNewlineChars
static std::string trimFromFrontAndBack(std::string const &stringToTrim, std::string const &charsToTrim=whitespaceAndNewlineChars)
◆ argumentStrings
std::vector< std::string > BOL::ArgumentParser::argumentStrings |
|
protected |
◆ inputXmlParser
The documentation for this class was generated from the following files: