![]() |
PhoenixMock
1.8.7
Tools to split/merge/print mock used in Phoenix
|
Describe the value of an option passed to a program. More...
#include <OptionValue.h>
Public Member Functions | |
void | addValue (const std::string &value) |
Add value of the OptionValue. More... | |
void | bashCompletionValue (std::string &strBashCompletion, const std::string &cursorOption) const |
Print the possible value to the bash completion. More... | |
VecValue & | getDefaultValue () |
const VecValue & | getDefaultValue () const |
Get the default value of the OptionValue. More... | |
VecValue & | getPossibleValue () |
const VecValue & | getPossibleValue () const |
Get the possible values of the OptionValue. More... | |
OptionType::OptionType & | getType () |
OptionType::OptionType | getType () const |
Get the type of the OptionValue. More... | |
VecValue & | getValue () |
const VecValue & | getValue () const |
Get the vector of values. More... | |
template<typename T > | |
void | getValue (std::list< T > &vecValue, bool isParsed) const |
Get the value of the option. More... | |
template<typename T > | |
void | getValue (std::vector< T > &vecValue, bool isParsed) const |
Get the value of the option. More... | |
template<typename T > | |
void | getValue (T &value, bool isParsed) const |
Get the value of the option. More... | |
OptionValue & | operator= (const OptionValue &other) |
Definition of equal operator of OptionValue. More... | |
OptionValue (const OptionValue &other) | |
Copy constructor of OptionValue. More... | |
OptionValue (const std::string &value, OptionType::OptionType type, const VecValue &vecDefaultValue) | |
Initialisation function of the class OptionValue. More... | |
OptionValue (const std::string &value, OptionType::OptionType type, const VecValue &vecDefaultValue, const VecValue &vecPossibleValue) | |
Initialisation function of the class OptionValue. More... | |
OptionValue (const std::string &value, OptionType::OptionType type=OptionType::STRING) | |
Initialisation function of the class OptionValue. More... | |
OptionValue (const VecValue &vecValue, OptionType::OptionType type, const VecValue &vecDefaultValue) | |
Initialisation function of the class OptionValue. More... | |
OptionValue (const VecValue &vecValue, OptionType::OptionType type, const VecValue &vecDefaultValue, const VecValue &vecPossibleValue) | |
Initialisation function of the class OptionValue. More... | |
OptionValue (const VecValue &vecValue, OptionType::OptionType type=OptionType::STRING) | |
Initialisation function of the class OptionValue. More... | |
OptionValue (OptionType::OptionType type=OptionType::STRING) | |
Default constructeur of OptionValue. More... | |
template<typename T > | |
void | setDefaultValue (const std::list< T > &value) |
Set the value in the OptionValue. More... | |
template<typename T > | |
void | setDefaultValue (const std::vector< T > &value) |
Set the value in the OptionValue. More... | |
template<typename T > | |
void | setDefaultValue (const T &value) |
Set the value in the OptionValue. More... | |
void | setType (OptionType::OptionType type) |
Set the type of the OptionValue. More... | |
void | setValue (const std::string &value) |
Set the value of the OptionValue. More... | |
void | setValue (const VecValue &value) |
Set the value of the OptionValue. More... | |
virtual | ~OptionValue () |
Destructeur of OptionValue. More... | |
Protected Member Functions | |
void | copyOptionValue (const OptionValue &other) |
Copy function of OptionValue. More... | |
Private Member Functions | |
template<typename T > | |
void | checkTypeFromTemplate () const |
Check the type from the template. More... | |
void | initialisationOptionValue (const VecValue &vecValue, OptionType::OptionType type, const VecValue &vecDefaultValue, const VecValue &vecPossibleValue) |
Initialisation function of the class OptionValue. More... | |
Private Attributes | |
OptionType::OptionType | p_type |
Type of the OptionValue. More... | |
VecValue | p_vecDefaultValue |
Default value of the OptionValue. More... | |
VecValue | p_vecPossibleValue |
Vector of the possible value for the OptionValue. More... | |
VecValue | p_vecValue |
Vector of the values of the OptionValue. More... | |
Describe the value of an option passed to a program.
Definition at line 20 of file OptionValue.h.
OptionValue::OptionValue | ( | OptionType::OptionType | type = OptionType::STRING | ) |
Default constructeur of OptionValue.
type | : type of the OptionValue |
Definition at line 13 of file OptionValue.cpp.
References initialisationOptionValue(), and createReleaseCurl::type.
OptionValue::OptionValue | ( | const std::string & | value, |
OptionType::OptionType | type = OptionType::STRING |
||
) |
Initialisation function of the class OptionValue.
value | : value of the OptionValue |
type | : type of the OptionValue |
Definition at line 22 of file OptionValue.cpp.
References initialisationOptionValue(), and createReleaseCurl::type.
OptionValue::OptionValue | ( | const VecValue & | vecValue, |
OptionType::OptionType | type = OptionType::STRING |
||
) |
Initialisation function of the class OptionValue.
vecValue | : vector of values of the OptionValue |
type | : type of the OptionValue |
Definition at line 32 of file OptionValue.cpp.
References initialisationOptionValue(), and createReleaseCurl::type.
OptionValue::OptionValue | ( | const std::string & | value, |
OptionType::OptionType | type, | ||
const VecValue & | vecDefaultValue | ||
) |
Initialisation function of the class OptionValue.
value | : value of the OptionValue |
type | : type of the OptionValue |
vecDefaultValue | : default value of the OptionValue |
Definition at line 42 of file OptionValue.cpp.
References initialisationOptionValue(), and createReleaseCurl::type.
OptionValue::OptionValue | ( | const VecValue & | vecValue, |
OptionType::OptionType | type, | ||
const VecValue & | vecDefaultValue | ||
) |
Initialisation function of the class OptionValue.
vecValue | : vector of values of the OptionValue |
type | : type of the OptionValue |
vecDefaultValue | : default value of the OptionValue |
Definition at line 53 of file OptionValue.cpp.
References initialisationOptionValue(), and createReleaseCurl::type.
OptionValue::OptionValue | ( | const std::string & | value, |
OptionType::OptionType | type, | ||
const VecValue & | vecDefaultValue, | ||
const VecValue & | vecPossibleValue | ||
) |
Initialisation function of the class OptionValue.
value | : value of the OptionValue |
type | : type of the OptionValue |
vecDefaultValue | : default value of the OptionValue |
vecPossibleValue | : vector of the possible values for the OptionValue |
Definition at line 64 of file OptionValue.cpp.
References initialisationOptionValue(), and createReleaseCurl::type.
OptionValue::OptionValue | ( | const VecValue & | vecValue, |
OptionType::OptionType | type, | ||
const VecValue & | vecDefaultValue, | ||
const VecValue & | vecPossibleValue | ||
) |
Initialisation function of the class OptionValue.
vecValue | : vector of values of the OptionValue |
type | : type of the OptionValue |
vecDefaultValue | : default value of the OptionValue |
vecPossibleValue | : vector of the possible values for the OptionValue |
Definition at line 76 of file OptionValue.cpp.
References initialisationOptionValue(), and createReleaseCurl::type.
OptionValue::OptionValue | ( | const OptionValue & | other | ) |
Copy constructor of OptionValue.
other | : class to copy |
Definition at line 84 of file OptionValue.cpp.
References copyOptionValue().
|
virtual |
void OptionValue::addValue | ( | const std::string & | value | ) |
Add value of the OptionValue.
value | : value to be added |
Definition at line 126 of file OptionValue.cpp.
References p_vecValue.
Referenced by Option::parsePartOption().
void OptionValue::bashCompletionValue | ( | std::string & | strBashCompletion, |
const std::string & | cursorOption | ||
) | const |
Print the possible value to the bash completion.
[out] | strBashCompletion | : string of all possible choices |
cursorOption | : option of the cursor which is currently completed |
Definition at line 172 of file OptionValue.cpp.
References convertOptionTypeToString(), OptionType::DIRECTORY, OptionType::FILE_OR_DIR, OptionType::FILENAME, p_type, p_vecPossibleValue, path_completion_all(), and path_completion_dirOnly().
Referenced by Option::getPossibleValue().
|
private |
Check the type from the template.
Throw exception if there is an incompatibility
Definition at line 105 of file OptionValue_impl.h.
References convertOptionTypeToString(), isOptionTypeCompatible(), and p_type.
|
protected |
Copy function of OptionValue.
other | : class to copy |
Definition at line 193 of file OptionValue.cpp.
References p_type, p_vecDefaultValue, p_vecPossibleValue, and p_vecValue.
Referenced by operator=(), and OptionValue().
VecValue& OptionValue::getDefaultValue | ( | ) |
VecValue & OptionValue::getDefaultValue | ( | ) | const |
Get the default value of the OptionValue.
Definition at line 151 of file OptionValue.cpp.
References p_vecDefaultValue.
Referenced by Option::print(), printValueOfOpt(), and testOptionValue().
VecValue& OptionValue::getPossibleValue | ( | ) |
VecValue & OptionValue::getPossibleValue | ( | ) | const |
Get the possible values of the OptionValue.
Definition at line 161 of file OptionValue.cpp.
References p_vecPossibleValue.
Referenced by Option::print(), printValueOfOpt(), and testOptionValue().
OptionType::OptionType& OptionValue::getType | ( | ) |
OptionType::OptionType & OptionValue::getType | ( | ) | const |
Get the type of the OptionValue.
Definition at line 141 of file OptionValue.cpp.
References p_type.
Referenced by Option::checkArgument(), Option::parsePartOption(), and Option::print().
VecValue& OptionValue::getValue | ( | ) |
VecValue & OptionValue::getValue | ( | ) | const |
Get the vector of values.
Definition at line 131 of file OptionValue.cpp.
References p_vecValue.
Referenced by OptionMode::getValue(), printValueOfOpt(), printValueOfOptConst(), and testOptionValue().
void OptionValue::getValue | ( | std::list< T > & | vecValue, |
bool | isParsed | ||
) | const |
Get the value of the option.
[out] | vecValue | : value of the option |
isParsed | : true if the option is parsed, false if not |
Definition at line 88 of file OptionValue_impl.h.
References p_vecDefaultValue, and p_vecValue.
void OptionValue::getValue | ( | std::vector< T > & | vecValue, |
bool | isParsed | ||
) | const |
Get the value of the option.
[out] | vecValue | : value of the option |
isParsed | : true if the option is parsed, false if not |
Definition at line 70 of file OptionValue_impl.h.
References p_vecDefaultValue, and p_vecValue.
void OptionValue::getValue | ( | T & | value, |
bool | isParsed | ||
) | const |
Get the value of the option.
[out] | value | : value of the option |
isParsed | : true if the option is parsed, false if not |
Definition at line 49 of file OptionValue_impl.h.
References p_vecDefaultValue, and p_vecValue.
|
private |
Initialisation function of the class OptionValue.
vecValue | : vector of values of the OptionValue |
type | : type of the OptionValue |
vecDefaultValue | : default value of the OptionValue |
vecPossibleValue | : vector of the possible values for the OptionValue |
Definition at line 206 of file OptionValue.cpp.
References p_type, p_vecDefaultValue, p_vecPossibleValue, p_vecValue, and createReleaseCurl::type.
Referenced by OptionValue().
OptionValue & OptionValue::operator= | ( | const OptionValue & | other | ) |
Definition of equal operator of OptionValue.
other | : class to copy |
Definition at line 97 of file OptionValue.cpp.
References copyOptionValue().
void OptionValue::setDefaultValue | ( | const std::list< T > & | value | ) |
Set the value in the OptionValue.
value | : value of the OptionValue |
Definition at line 36 of file OptionValue_impl.h.
References convertToString(), and p_vecDefaultValue.
void OptionValue::setDefaultValue | ( | const std::vector< T > & | value | ) |
Set the value in the OptionValue.
value | : value of the OptionValue |
Definition at line 28 of file OptionValue_impl.h.
References p_vecDefaultValue.
void OptionValue::setDefaultValue | ( | const T & | value | ) |
Set the value in the OptionValue.
value | : value of the OptionValue |
Definition at line 17 of file OptionValue_impl.h.
References convertToString(), and p_vecDefaultValue.
Referenced by OptionParser::addOption().
void OptionValue::setType | ( | OptionType::OptionType | type | ) |
Set the type of the OptionValue.
type | : type of the OptionValue |
Definition at line 105 of file OptionValue.cpp.
References p_type, and createReleaseCurl::type.
Referenced by OptionParser::addOption().
void OptionValue::setValue | ( | const std::string & | value | ) |
Set the value of the OptionValue.
value | : value to be set |
Definition at line 112 of file OptionValue.cpp.
Referenced by testOptionValue().
void OptionValue::setValue | ( | const VecValue & | value | ) |
Set the value of the OptionValue.
value | : value to be set |
Definition at line 121 of file OptionValue.cpp.
References p_vecValue.
|
private |
Type of the OptionValue.
Definition at line 77 of file OptionValue.h.
Referenced by bashCompletionValue(), checkTypeFromTemplate(), copyOptionValue(), getType(), initialisationOptionValue(), and setType().
|
private |
Default value of the OptionValue.
Definition at line 81 of file OptionValue.h.
Referenced by copyOptionValue(), getDefaultValue(), getValue(), initialisationOptionValue(), and setDefaultValue().
|
private |
Vector of the possible value for the OptionValue.
Definition at line 83 of file OptionValue.h.
Referenced by bashCompletionValue(), copyOptionValue(), getPossibleValue(), and initialisationOptionValue().
|
private |
Vector of the values of the OptionValue.
Definition at line 79 of file OptionValue.h.
Referenced by addValue(), copyOptionValue(), getValue(), initialisationOptionValue(), and setValue().