PhoenixMock  1.8.7
Tools to split/merge/print mock used in Phoenix
Option Class Reference

#include <Option.h>

+ Collaboration diagram for Option:

Public Member Functions

bool checkArgument () const
 Check the argument of the parser. More...
 
std::string & getDocString ()
 
const std::string & getDocString () const
 Get the documentation string of the Option. More...
 
std::string & getLongName ()
 
const std::string & getLongName () const
 Get the long name of the Option. More...
 
void getPossibleOption (std::string &possibleOption, const std::string &cursorOption) const
 Get the possible options for the bash completion. More...
 
void getPossibleValue (std::string &possibleValue, const std::string &cursorOption) const
 Complete the possible values of the Option. More...
 
std::string & getShortName ()
 
const std::string & getShortName () const
 Get the short name of the Option. More...
 
OptionValuegetValue ()
 
const OptionValuegetValue () const
 Get the value of the Option. More...
 
bool & isAllowEmpty ()
 
bool isAllowEmpty () const
 Get if the option value can be empty. More...
 
bool & isParsed ()
 
bool isParsed () const
 Say if the Option has been parsed or not. More...
 
bool & isRequired ()
 
bool isRequired () const
 Get if the option is required. More...
 
Optionoperator= (const Option &other)
 Definition of equal operator of Option. More...
 
 Option (const Option &other)
 Copy constructor of Option. More...
 
 Option (const std::string &longName, const std::string &shortName, bool isRequired, const std::string &docString="")
 Constructor of Option. More...
 
 Option (const std::string &longName, const std::string &shortName, const OptionValue &value, bool isRequired, const std::string &docString="")
 Constructor of Option. More...
 
 Option (const std::string &longName, const std::string &shortName, const OptionValue &value, const std::string &docString="")
 Constructor of Option. More...
 
 Option (const std::string &longName="", const std::string &shortName="", const std::string &docString="")
 Default constructor of Option. More...
 
bool parseOption (ArgParser &parser)
 Parse the current option with the given parser. More...
 
void print (const std::string &indentation="") const
 Print an option. More...
 
void setDocString (const std::string &docString)
 Set the documentation string of the Option. More...
 
void setIsAllowEmpty (bool isAllowEmpty)
 Say if the option can be empty or not. More...
 
void setIsParsed (bool isParsed)
 Say if the Option has been parsed or not. More...
 
void setIsRequired (bool isRequired)
 Set if the option is required. More...
 
void setLongName (const std::string &longName)
 Set the long name of the option. More...
 
void setShortName (const std::string &shortName)
 Set the short name of the option. More...
 
void setValue (const OptionValue &value)
 Set the value of the option. More...
 
virtual ~Option ()
 Destructeur of Option. More...
 

Protected Member Functions

void copyOption (const Option &other)
 Copy function of Option. More...
 

Private Member Functions

void checkAlreadyParsed (const std::string &longOption)
 Check if the Option has been already parsed. More...
 
void initialisationOption ()
 Initialisation function of the class Option. More...
 
bool parsePartOption (ArgParser &parser, const std::string &prefix, const std::string &optionName)
 Parse the given option with the parser. More...
 

Private Attributes

std::string p_docString
 Documentation string of the current Option. More...
 
std::string p_firstPartParsedOption
 First paet of parsed option (needed for bash completion) More...
 
bool p_isAllowEmpty
 The option can be empty and can have a value. More...
 
bool p_isParsed
 Say if the option has been parsed or not. More...
 
bool p_isRequired
 True if the option is required, false if it is optionnal. More...
 
std::string p_longName
 Long name of the Option. More...
 
std::string p_shortName
 Short name of the Option. More...
 
OptionValue p_value
 Value of the Option. More...
 

Detailed Description

Definition at line 13 of file Option.h.

Constructor & Destructor Documentation

◆ Option() [1/5]

Option::Option ( const std::string &  longName = "",
const std::string &  shortName = "",
const std::string &  docString = "" 
)

Default constructor of Option.

Parameters
longName: long name of the option
shortName: long name of the option
docString: documentation string of the Option

Definition at line 15 of file Option.cpp.

16  :p_longName(longName), p_shortName(shortName), p_value(""), p_isRequired(false), p_docString(docString)
17 {
19 }

References initialisationOption().

+ Here is the call graph for this function:

◆ Option() [2/5]

Option::Option ( const std::string &  longName,
const std::string &  shortName,
const OptionValue value,
const std::string &  docString = "" 
)

Constructor of Option.

Parameters
longName: long name of the option
shortName: long name of the option
value: value of the Option
docString: documentation string of the Option

Definition at line 27 of file Option.cpp.

28  :p_longName(longName), p_shortName(shortName), p_value(value), p_isRequired(false), p_docString(docString)
29 {
31 }

References initialisationOption().

+ Here is the call graph for this function:

◆ Option() [3/5]

Option::Option ( const std::string &  longName,
const std::string &  shortName,
const OptionValue value,
bool  isRequired,
const std::string &  docString = "" 
)

Constructor of Option.

Parameters
longName: long name of the option
shortName: long name of the option
value: value of the Option
isRequired: true if the option is required, false if it is optionnal
docString: documentation string of the Option

Definition at line 40 of file Option.cpp.

41  :p_longName(longName), p_shortName(shortName), p_value(value), p_isRequired(isRequired), p_docString(docString)
42 {
44 }

References initialisationOption().

+ Here is the call graph for this function:

◆ Option() [4/5]

Option::Option ( const std::string &  longName,
const std::string &  shortName,
bool  isRequired,
const std::string &  docString = "" 
)

Constructor of Option.

Parameters
longName: long name of the option
shortName: long name of the option
isRequired: true if the option is required, false if it is optionnal
docString: documentation string of the Option

Definition at line 52 of file Option.cpp.

53  :p_longName(longName), p_shortName(shortName), p_isRequired(isRequired), p_docString(docString)
54 {
56 }

References initialisationOption().

+ Here is the call graph for this function:

◆ Option() [5/5]

Option::Option ( const Option other)

Copy constructor of Option.

Parameters
other: class to copy

Definition at line 61 of file Option.cpp.

61  {
62  copyOption(other);
63 }

References copyOption().

+ Here is the call graph for this function:

◆ ~Option()

Option::~Option ( )
virtual

Destructeur of Option.

Definition at line 66 of file Option.cpp.

66  {
67 
68 }

Member Function Documentation

◆ checkAlreadyParsed()

void Option::checkAlreadyParsed ( const std::string &  longOption)
private

Check if the Option has been already parsed.

Parameters
longOption: used option

Definition at line 408 of file Option.cpp.

408  {
409  if(p_isParsed){ //The option has already been parsed, there is a mistake
410  throw std::runtime_error("Option::checkAlreadyParsed : option '" + longOption + "' already exists");
411  }
412 }

References p_isParsed.

Referenced by parsePartOption().

+ Here is the caller graph for this function:

◆ checkArgument()

bool Option::checkArgument ( ) const

Check the argument of the parser.

Returns
true if the arguments is required and is set, false otherwise

Definition at line 252 of file Option.cpp.

252  {
253  if(p_isRequired){
254  if(!p_isParsed){
256  std::cerr << termRed() << "Missing arguement ";
257  if(p_longName != ""){
258  std::cerr << "--" << p_longName;
259  if(type != OptionType::NONE){
260  std::cout << "=" << convertOptionTypeToString(type);
261  }
262  }
263  if(p_shortName != ""){
264  if(p_longName != ""){std::cerr << " , ";}
265  std::cerr << "-" << p_shortName;
266  if(type != OptionType::NONE){
267  std::cout << " " << convertOptionTypeToString(type);
268  }
269  }
270  std::cerr << termDefault() << std::endl;
271  }
272  return p_isParsed;
273  }else{return true;}
274 }

References convertOptionTypeToString(), OptionValue::getType(), OptionType::NONE, p_isParsed, p_isRequired, p_longName, p_shortName, p_value, termDefault(), termRed(), and createReleaseCurl::type.

+ Here is the call graph for this function:

◆ copyOption()

void Option::copyOption ( const Option other)
protected

Copy function of Option.

Parameters
other: class to copy

Definition at line 315 of file Option.cpp.

315  {
316  p_longName = other.p_longName;
317  p_shortName = other.p_shortName;
318  p_value = other.p_value;
319  p_isRequired = other.p_isRequired;
320  p_docString = other.p_docString;
321  p_isParsed = other.p_isParsed;
324 }

References p_docString, p_firstPartParsedOption, p_isAllowEmpty, p_isParsed, p_isRequired, p_longName, p_shortName, and p_value.

Referenced by operator=(), and Option().

+ Here is the caller graph for this function:

◆ getDocString() [1/2]

std::string& Option::getDocString ( )

◆ getDocString() [2/2]

std::string & Option::getDocString ( ) const

Get the documentation string of the Option.

Returns
documentation string of the Option

Definition at line 232 of file Option.cpp.

232 {return p_docString;}

References p_docString.

Referenced by printValueOfOpt(), and printValueOfOptConst().

+ Here is the caller graph for this function:

◆ getLongName() [1/2]

std::string& Option::getLongName ( )

◆ getLongName() [2/2]

std::string & Option::getLongName ( ) const

Get the long name of the Option.

Returns
long name of the Option

Definition at line 182 of file Option.cpp.

182 {return p_longName;}

References p_longName.

Referenced by printValueOfOpt(), and printValueOfOptConst().

+ Here is the caller graph for this function:

◆ getPossibleOption()

void Option::getPossibleOption ( std::string &  possibleOption,
const std::string &  cursorOption 
) const

Get the possible options for the bash completion.

Parameters
[out]possibleOption: possible options for the bash completion
cursorOption: option of the cursor which is currently completed

Definition at line 280 of file Option.cpp.

280  {
281  if(p_isParsed){return;}
282  if(p_longName != ""){
283  std::string longOption("--" + p_longName);
284  if(cursorOption == ""){
285  possibleOption += longOption + " ";
286  }else{
287  if(isSameBegining(longOption, cursorOption)){
288  possibleOption += longOption + " ";
289  }
290  }
291  }
292  if(p_shortName != ""){
293  std::string shortOption("-" + p_shortName);
294  if(cursorOption == ""){
295  possibleOption += shortOption + " ";
296  }else{
297  if(isSameBegining(shortOption, cursorOption)){
298  possibleOption += shortOption + " ";
299  }
300  }
301  }
302 }

References isSameBegining(), p_isParsed, p_longName, and p_shortName.

+ Here is the call graph for this function:

◆ getPossibleValue()

void Option::getPossibleValue ( std::string &  possibleValue,
const std::string &  cursorOption 
) const

Complete the possible values of the Option.

Parameters
[out]possibleValue: possible value of the option
cursorOption: option of the cursor which is currently completed

Definition at line 308 of file Option.cpp.

308  {
309  p_value.bashCompletionValue(possibleValue, cursorOption);
310 }

References OptionValue::bashCompletionValue(), and p_value.

Referenced by OptionParser::completeOptionValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getShortName() [1/2]

std::string& Option::getShortName ( )

◆ getShortName() [2/2]

std::string & Option::getShortName ( ) const

Get the short name of the Option.

Returns
short name of the Option

Definition at line 192 of file Option.cpp.

192 {return p_shortName;}

References p_shortName.

Referenced by printValueOfOpt(), and printValueOfOptConst().

+ Here is the caller graph for this function:

◆ getValue() [1/2]

OptionValue& Option::getValue ( )

◆ getValue() [2/2]

OptionValue & Option::getValue ( ) const

Get the value of the Option.

Returns
value of the Option

Definition at line 202 of file Option.cpp.

202 {return p_value;}

References p_value.

Referenced by OptionMode::getValue(), printValueOfOpt(), and printValueOfOptConst().

+ Here is the caller graph for this function:

◆ initialisationOption()

void Option::initialisationOption ( )
private

Initialisation function of the class Option.

Definition at line 327 of file Option.cpp.

327  {
328  p_isParsed = false;
329  p_isRequired = false;
331  p_isAllowEmpty = false;
332 }

References p_firstPartParsedOption, p_isAllowEmpty, p_isParsed, and p_isRequired.

Referenced by Option().

+ Here is the caller graph for this function:

◆ isAllowEmpty() [1/2]

bool& Option::isAllowEmpty ( )

◆ isAllowEmpty() [2/2]

bool & Option::isAllowEmpty ( ) const

Get if the option value can be empty.

Returns
true if the option value can be empty, false otherwise

Definition at line 222 of file Option.cpp.

222 {return p_isAllowEmpty;}

References p_isAllowEmpty.

Referenced by printValueOfOpt(), printValueOfOptConst(), and setIsAllowEmpty().

+ Here is the caller graph for this function:

◆ isParsed() [1/2]

bool& Option::isParsed ( )

◆ isParsed() [2/2]

bool & Option::isParsed ( ) const

Say if the Option has been parsed or not.

Returns
true if the Option has been parsed, false if not

Definition at line 242 of file Option.cpp.

242 {return p_isParsed;}

References p_isParsed.

Referenced by OptionMode::getValue(), and setIsParsed().

+ Here is the caller graph for this function:

◆ isRequired() [1/2]

bool& Option::isRequired ( )

◆ isRequired() [2/2]

bool & Option::isRequired ( ) const

Get if the option is required.

Returns
true if the Option is required, false if it is optionnal

Definition at line 212 of file Option.cpp.

212 {return p_isRequired;}

References p_isRequired.

Referenced by OptionMode::getValue(), printValueOfOpt(), printValueOfOptConst(), and setIsRequired().

+ Here is the caller graph for this function:

◆ operator=()

Option & Option::operator= ( const Option other)

Definition of equal operator of Option.

Parameters
other: class to copy
Returns
copied class

Definition at line 74 of file Option.cpp.

74  {
75  copyOption(other);
76  return *this;
77 }

References copyOption().

+ Here is the call graph for this function:

◆ parseOption()

bool Option::parseOption ( ArgParser parser)

Parse the current option with the given parser.

Parameters
[out]parser: parser of the given arguments to the program
Returns
true on success, false otherwise

Definition at line 83 of file Option.cpp.

83  {
84  if(parsePartOption(parser, "--", p_longName)){return true;}
85  else if(parsePartOption(parser, "-", p_shortName)){return true;}
86  return false;
87 }

References p_longName, p_shortName, parsePartOption(), and createReleaseCurl::parser.

+ Here is the call graph for this function:

◆ parsePartOption()

bool Option::parsePartOption ( ArgParser parser,
const std::string &  prefix,
const std::string &  optionName 
)
private

Parse the given option with the parser.

Parameters
[out]parser: parser to be used
prefix: option prefix (- or – or nothing)
optionName: name of hte option to be parsed
Returns
true on success, false otherwise

Definition at line 340 of file Option.cpp.

340  {
341  if(parser.isEndOfOption()){return true;}
342  if(optionName == ""){return false;}
343  std::string & currentOption = parser.getCurrentOption();
344  std::string longOption(prefix + optionName);
345  size_t sizeLongOption(longOption.size());
346  OptionType::OptionType optionType = p_value.getType();
347  if(currentOption == longOption){
348  checkAlreadyParsed(longOption);
349  p_isParsed = true;
350  if(optionType == OptionType::NONE){ //No value expected
351  parser.getNextOption();
352  return true; //Option found
353  }
354  bool valueOk(true), isInitialised(false);
355  parser.getNextOption();
356  while(!parser.isEndOfOption() && valueOk){
357  std::string & currentOption = parser.getCurrentOption();
358  if(currentOption == ""){
359  if(optionType == OptionType::STRING){
360  p_value.addValue("");
361  parser.getNextOption();
362  valueOk = true;
363  isInitialised = true;
364  }else{
365  throw std::runtime_error("Option::parsePartOption : pass empty value to option '" + longOption + "' which does not expect STRING");
366  }
367  }else{
368  if(currentOption[0] == '-'){
369  valueOk = false;
370  }else{
371  p_value.addValue(currentOption);
372  parser.getNextOption();
373  valueOk = true;
374  isInitialised = true;
375  }
376  }
377  }
378  if(!isInitialised && !p_isAllowEmpty){
379  throw std::runtime_error("Option::parsePartOption : expect value after option '" + longOption + "'");
380  }
381  return isInitialised || p_isAllowEmpty;
382  }else if(isSameBegining(currentOption, longOption)){
383  if(currentOption[sizeLongOption] == '='){
384  if(optionType == OptionType::NONE){ //No value expected
385  throw std::runtime_error("Option::parsePartOption : the option '"+currentOption+"' does not have value");
386  }
387  if(currentOption.size() == sizeLongOption + 1lu){
388  p_firstPartParsedOption = longOption + "=";
389  throw std::runtime_error("Option::parsePartOption : problem with the option '"+currentOption+"' because it ends with a '=' and not a value");
390  //Ici il faut un mode qui renvoie quand même les valeurs possibles quand on a --option=...
391  }
392  checkAlreadyParsed(longOption);
393  std::string value(currentOption.substr(sizeLongOption + 1lu));
394  p_value.addValue(value);
395  p_isParsed = true;
396  parser.getNextOption();
397  return true;
398  }else{
399  return false; //It is an option with a longer name
400  }
401  }
402  return false;
403 }

References OptionValue::addValue(), checkAlreadyParsed(), OptionValue::getType(), isSameBegining(), OptionType::NONE, p_firstPartParsedOption, p_isAllowEmpty, p_isParsed, p_value, createReleaseCurl::parser, and OptionType::STRING.

Referenced by parseOption().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print()

void Option::print ( const std::string &  indentation = "") const

Print an option.

Parameters
indentation: indentation to print the option

Definition at line 106 of file Option.cpp.

106  {
108  std::cout << indentation;
109  if(p_longName != ""){
110  std::cout << "--" << p_longName;
111  if(type != OptionType::NONE){
112  std::cout << "=" << convertOptionTypeToString(type);
113  }
114  }
115  if(p_shortName != ""){
116  if(p_longName != ""){std::cout << " , ";}
117  std::cout << "-" << p_shortName;
118  if(type != OptionType::NONE){
119  std::cout << " " << convertOptionTypeToString(type);
120  }
121  }
122  if(p_docString != ""){
123  std::cout << " : " << p_docString;
124  }
125  std::cout << std::endl;
126  const VecValue & vecDefaultValue = p_value.getDefaultValue();
127  if(vecDefaultValue.size()){
128  std::cout << indentation << "\tDefault value : '";
129  printVecString(vecDefaultValue);
130  std::cout << "'" << std::endl;
131  }
132  const VecValue & vecPossibleValue = p_value.getPossibleValue();
133  if(vecPossibleValue.size()){
134  std::cout << indentation << "\tPossible values : ";
135  printVecString(vecPossibleValue);
136  std::cout << std::endl;
137  }
138  if(p_isRequired){std::cout << indentation << "\tThis argument has to be set" << std::endl;}
139  else{std::cout << indentation << "\tThis argument is optional" << std::endl;}
140  if(p_isAllowEmpty){std::cout << indentation << "\tThis argument can have an empty value" << std::endl;}
141  else{std::cout << indentation << "\tThis argument cannot have an empty value" << std::endl;}
142 }

References convertOptionTypeToString(), OptionValue::getDefaultValue(), OptionValue::getPossibleValue(), OptionValue::getType(), OptionType::NONE, p_docString, p_isAllowEmpty, p_isRequired, p_longName, p_shortName, p_value, printVecString(), and createReleaseCurl::type.

+ Here is the call graph for this function:

◆ setDocString()

void Option::setDocString ( const std::string &  docString)

Set the documentation string of the Option.

Parameters
docString: documentation string of the Option

Definition at line 167 of file Option.cpp.

167 {p_docString = docString;}

References p_docString.

Referenced by testOption().

+ Here is the caller graph for this function:

◆ setIsAllowEmpty()

void Option::setIsAllowEmpty ( bool  isAllowEmpty)

Say if the option can be empty or not.

Parameters
isAllowEmpty: true if the option can be empty, false otherwise

Definition at line 177 of file Option.cpp.

References isAllowEmpty(), and p_isAllowEmpty.

Referenced by OptionParser::addOption(), and testOption().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setIsParsed()

void Option::setIsParsed ( bool  isParsed)

Say if the Option has been parsed or not.

Parameters
isParsed: true if the Option has been parsed, false if not

Definition at line 172 of file Option.cpp.

172 {p_isParsed = isParsed;}

References isParsed(), and p_isParsed.

Referenced by testOption().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setIsRequired()

void Option::setIsRequired ( bool  isRequired)

Set if the option is required.

Parameters
isRequired: true if the Option is required, false if it is optionnal

Definition at line 162 of file Option.cpp.

References isRequired(), and p_isRequired.

Referenced by testOption().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLongName()

void Option::setLongName ( const std::string &  longName)

Set the long name of the option.

Parameters
longName: long name of the option

Definition at line 147 of file Option.cpp.

147 {p_longName = longName;}

References p_longName.

Referenced by testOption().

+ Here is the caller graph for this function:

◆ setShortName()

void Option::setShortName ( const std::string &  shortName)

Set the short name of the option.

Parameters
shortName: short name of the option

Definition at line 152 of file Option.cpp.

152 {p_shortName = shortName;}

References p_shortName.

Referenced by testOption().

+ Here is the caller graph for this function:

◆ setValue()

void Option::setValue ( const OptionValue value)

Set the value of the option.

Parameters
value: value name of the option

Definition at line 157 of file Option.cpp.

157 {p_value = value;}

References p_value.

Referenced by testOption().

+ Here is the caller graph for this function:

Member Data Documentation

◆ p_docString

std::string Option::p_docString
private

Documentation string of the current Option.

Definition at line 82 of file Option.h.

Referenced by copyOption(), getDocString(), print(), and setDocString().

◆ p_firstPartParsedOption

std::string Option::p_firstPartParsedOption
private

First paet of parsed option (needed for bash completion)

Definition at line 86 of file Option.h.

Referenced by copyOption(), initialisationOption(), and parsePartOption().

◆ p_isAllowEmpty

bool Option::p_isAllowEmpty
private

The option can be empty and can have a value.

Definition at line 88 of file Option.h.

Referenced by copyOption(), initialisationOption(), isAllowEmpty(), parsePartOption(), print(), and setIsAllowEmpty().

◆ p_isParsed

bool Option::p_isParsed
private

Say if the option has been parsed or not.

Definition at line 84 of file Option.h.

Referenced by checkAlreadyParsed(), checkArgument(), copyOption(), getPossibleOption(), initialisationOption(), isParsed(), parsePartOption(), and setIsParsed().

◆ p_isRequired

bool Option::p_isRequired
private

True if the option is required, false if it is optionnal.

Definition at line 80 of file Option.h.

Referenced by checkArgument(), copyOption(), initialisationOption(), isRequired(), print(), and setIsRequired().

◆ p_longName

std::string Option::p_longName
private

Long name of the Option.

Definition at line 74 of file Option.h.

Referenced by checkArgument(), copyOption(), getLongName(), getPossibleOption(), parseOption(), print(), and setLongName().

◆ p_shortName

std::string Option::p_shortName
private

Short name of the Option.

Definition at line 76 of file Option.h.

Referenced by checkArgument(), copyOption(), getPossibleOption(), getShortName(), parseOption(), print(), and setShortName().

◆ p_value

OptionValue Option::p_value
private

Value of the Option.

Definition at line 78 of file Option.h.

Referenced by checkArgument(), copyOption(), getPossibleValue(), getValue(), parsePartOption(), print(), and setValue().


The documentation for this class was generated from the following files:
Option::p_value
OptionValue p_value
Value of the Option.
Definition: Option.h:78
Option::isRequired
bool isRequired() const
Get if the option is required.
Definition: Option.cpp:212
convertOptionTypeToString
std::string convertOptionTypeToString(OptionType::OptionType type)
Convert the OptionType into string.
Definition: OptionType.cpp:69
Option::p_shortName
std::string p_shortName
Short name of the Option.
Definition: Option.h:76
printVecString
void printVecString(const VecValue &vecValue)
Print a vector of value.
Definition: Option.cpp:92
OptionType::STRING
@ STRING
Definition: OptionType.h:25
Option::p_longName
std::string p_longName
Long name of the Option.
Definition: Option.h:74
Option::isParsed
bool isParsed() const
Say if the Option has been parsed or not.
Definition: Option.cpp:242
Option::p_isRequired
bool p_isRequired
True if the option is required, false if it is optionnal.
Definition: Option.h:80
Option::checkAlreadyParsed
void checkAlreadyParsed(const std::string &longOption)
Check if the Option has been already parsed.
Definition: Option.cpp:408
Option::p_isAllowEmpty
bool p_isAllowEmpty
The option can be empty and can have a value.
Definition: Option.h:88
Option::isAllowEmpty
bool isAllowEmpty() const
Get if the option value can be empty.
Definition: Option.cpp:222
Option::p_firstPartParsedOption
std::string p_firstPartParsedOption
First paet of parsed option (needed for bash completion)
Definition: Option.h:86
OptionValue::getType
OptionType::OptionType getType() const
Get the type of the OptionValue.
Definition: OptionValue.cpp:141
OptionValue::getPossibleValue
const VecValue & getPossibleValue() const
Get the possible values of the OptionValue.
Definition: OptionValue.cpp:161
Option::copyOption
void copyOption(const Option &other)
Copy function of Option.
Definition: Option.cpp:315
termDefault
std::string termDefault()
affiche le terminal par défaut
Definition: string_color.cpp:20
termRed
std::string termRed()
affiche le terminal rouge
Definition: string_color.cpp:55
OptionValue::bashCompletionValue
void bashCompletionValue(std::string &strBashCompletion, const std::string &cursorOption) const
Print the possible value to the bash completion.
Definition: OptionValue.cpp:172
isSameBegining
bool isSameBegining(const std::string &str, const std::string &beginig)
Check if two string start the same way.
Definition: string_function.cpp:531
OptionValue::addValue
void addValue(const std::string &value)
Add value of the OptionValue.
Definition: OptionValue.cpp:126
createReleaseCurl.parser
parser
Definition: createReleaseCurl.py:123
Option::p_isParsed
bool p_isParsed
Say if the option has been parsed or not.
Definition: Option.h:84
Option::p_docString
std::string p_docString
Documentation string of the current Option.
Definition: Option.h:82
createReleaseCurl.type
type
Definition: createReleaseCurl.py:124
OptionType::OptionType
OptionType
Definition: OptionType.h:19
Option::parsePartOption
bool parsePartOption(ArgParser &parser, const std::string &prefix, const std::string &optionName)
Parse the given option with the parser.
Definition: Option.cpp:340
OptionType::NONE
@ NONE
Definition: OptionType.h:24
Option::initialisationOption
void initialisationOption()
Initialisation function of the class Option.
Definition: Option.cpp:327
OptionValue::getDefaultValue
const VecValue & getDefaultValue() const
Get the default value of the OptionValue.
Definition: OptionValue.cpp:151
VecValue
std::vector< std::string > VecValue
Vector of values.
Definition: OptionValue.h:17