 |
PhoenixMock
1.8.7
Tools to split/merge/print mock used in Phoenix
|
Go to the documentation of this file.
48 if(
parser.isEndOfOption()){
return true;}
56 if(
parser.getCurrentOption() ==
"--help" ||
parser.getCurrentOption() ==
"-h"){
62 if(
parser.getCurrentOption() ==
"--version" ||
parser.getCurrentOption() ==
"-v"){
67 isSearch = !it->parseOption(
parser);
80 if(
parser.isEndOfOption()){
return true;}
92 isSearch = !it->parseOption(
parser);
93 }
catch(
const std::runtime_error & e){
94 partialOption = &(*it);
105 std::string indentation(
"\t");
107 cout <<
"\tMode '" <<
p_name <<
"' :" << endl;
111 it->print(indentation);
171 isArgOk = it->checkArgument();
198 if(it->getLongName() == optionName || it->getShortName() == optionName){
199 return it->isParsed();
214 possibleOption +=
p_name +
" ";
228 possibleOption +=
p_name +
" ";
260 if(it->getLongName() == optionName || it->getShortName() == optionName){
275 it->getPossibleOption(possibleOption, cursorOption);
bool p_isCurrentlyParsed
True if the OptionMode is currently parsed but not totally.
const VecOption & getVecOption() const
Get the vector of options of the OptionMode.
bool checkArgument() const
Check the argument of the parser.
void iterGetPossibleOption(std::string &possibleOption, const std::string &cursorOption) const
Iterates over the possible options of the current mode.
std::string p_name
name of the OptionMode
virtual ~OptionMode()
Destructeur of OptionMode.
bool p_isParsed
Say if the mode contains options which are parsed.
std::vector< Option > VecOption
Vector of option.
VecOption p_vecOption
Vector of all the options of the OptionMode.
const std::string & getName() const
Get the name of the OptionMode.
void setProgramVersion(const std::string &programVersion)
Set the program version.
void setVecOption(const VecOption &vecOption)
Set the vector of options of the OptionMode.
void addOption(const Option &option)
Add an option into the OptionMode.
OptionMode(const std::string &name="")
Default constructeur of OptionMode.
bool parseOption(ArgParser &parser)
Parse the options in the current OptionMode.
bool getOption(Option &option, const std::string &optionName) const
Get the option with its name.
void print() const
Print the option of the mode.
void setName(const std::string &name)
Set the name of the OptionMode.
bool isSameBegining(const std::string &str, const std::string &beginig)
Check if two string start the same way.
void getPossibleOption(std::string &possibleOption, const std::string &cursorOption) const
Get the possible options for the bash completion.
bool isCurrentlyParsed() const
Say if the OptionMode is currently parsed (but maybe not totally)
bool isParsed() const
Say if the OptionMode contains option which are parsed.
void initialisationOptionMode()
Initialisation function of the class OptionMode.
std::string p_programVersion
Program version to be printed on –version or -v option.
bool p_enableHelpOption
True to enable automatically the printing of the help option when the program is called with –help or...
void setEnableHelpOption(bool b)
Set the attribtue which enables help option.
void clearOption()
Remove all the options of the OptionMode.
bool isOptionExist(const std::string &optionName) const
Say if the given option has been passed to the program.
Parse the list of arguments passed to a program.
OptionMode & operator=(const OptionMode &other)
Definition of equal operator of OptionMode.
void copyOptionMode(const OptionMode &other)
Copy function of OptionMode.
Describe a mode in the program arguments.
void getPossibleMode(std::string &possibleOption, const std::string &cursorOption) const
Get the possible mode.