![]() |
PhoenixInkscape
2.0.0
Generate multiple png files with svg inkscape files
|
Describe the value of an option passed to a program. More...
#include <OptionValue.h>
Public Member Functions | |
void | addValue (const PString &value) |
Add value of the OptionValue. More... | |
void | bashCompletionValue (PString &strBashCompletion, const PString &cursorOption) const |
Print the possible value to the bash completion. More... | |
PVecString & | getDefaultValue () |
Get the default value of the OptionValue. More... | |
const PVecString & | getDefaultValue () const |
Get the default value of the OptionValue. More... | |
PVecString & | getPossibleValue () |
Get the possible values of the OptionValue. More... | |
const PVecString & | getPossibleValue () const |
Get the possible values of the OptionValue. More... | |
OptionType::OptionType & | getType () |
Get the type of the OptionValue. More... | |
OptionType::OptionType | getType () const |
Get the type of the OptionValue. More... | |
PVecString & | getValue () |
Get the vector of values. More... | |
const PVecString & | getValue () const |
Get the vector of values. 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 PString &value, OptionType::OptionType type, const PVecString &vecDefaultValue) | |
Initialisation function of the class OptionValue. More... | |
OptionValue (const PString &value, OptionType::OptionType type, const PVecString &vecDefaultValue, const PVecString &vecPossibleValue) | |
Initialisation function of the class OptionValue. More... | |
OptionValue (const PString &value, OptionType::OptionType type=OptionType::STRING) | |
Initialisation function of the class OptionValue. More... | |
OptionValue (const PVecString &vecValue, OptionType::OptionType type, const PVecString &vecDefaultValue) | |
Initialisation function of the class OptionValue. More... | |
OptionValue (const PVecString &vecValue, OptionType::OptionType type, const PVecString &vecDefaultValue, const PVecString &vecPossibleValue) | |
Initialisation function of the class OptionValue. More... | |
OptionValue (const PVecString &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::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 PString &value) |
Set the value of the OptionValue. More... | |
void | setValue (const PVecString &value) |
Set the value of the OptionValue. More... | |
void | setVecPossibleValue (const PVecString &vecPossibleValue) |
Set the vector of possible values. 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 PVecString &vecValue, OptionType::OptionType type, const PVecString &vecDefaultValue, const PVecString &vecPossibleValue) |
Initialisation function of the class OptionValue. More... | |
Private Attributes | |
OptionType::OptionType | p_type |
Type of the OptionValue. More... | |
PVecString | p_vecDefaultValue |
Default value of the OptionValue. More... | |
PVecString | p_vecPossibleValue |
Vector of the possible value for the OptionValue. More... | |
PVecString | p_vecValue |
Vector of the values of the OptionValue. More... | |
Describe the value of an option passed to a program.
Definition at line 16 of file OptionValue.h.
OptionValue::OptionValue | ( | OptionType::OptionType | type = OptionType::STRING | ) |
Default constructeur of OptionValue.
type | : type of the OptionValue |
Definition at line 14 of file OptionValue.cpp.
References initialisationOptionValue().
OptionValue::OptionValue | ( | const PString & | 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 23 of file OptionValue.cpp.
References initialisationOptionValue().
OptionValue::OptionValue | ( | const PVecString & | 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 33 of file OptionValue.cpp.
References initialisationOptionValue().
OptionValue::OptionValue | ( | const PString & | value, |
OptionType::OptionType | type, | ||
const PVecString & | 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 43 of file OptionValue.cpp.
References initialisationOptionValue().
OptionValue::OptionValue | ( | const PVecString & | vecValue, |
OptionType::OptionType | type, | ||
const PVecString & | 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 54 of file OptionValue.cpp.
References initialisationOptionValue().
OptionValue::OptionValue | ( | const PString & | value, |
OptionType::OptionType | type, | ||
const PVecString & | vecDefaultValue, | ||
const PVecString & | 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 65 of file OptionValue.cpp.
References initialisationOptionValue().
OptionValue::OptionValue | ( | const PVecString & | vecValue, |
OptionType::OptionType | type, | ||
const PVecString & | vecDefaultValue, | ||
const PVecString & | 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 77 of file OptionValue.cpp.
References initialisationOptionValue().
OptionValue::OptionValue | ( | const OptionValue & | other | ) |
Copy constructor of OptionValue.
other | : class to copy |
Definition at line 85 of file OptionValue.cpp.
References copyOptionValue().
|
virtual |
void OptionValue::addValue | ( | const PString & | value | ) |
Add value of the OptionValue.
value | : value to be added |
Definition at line 127 of file OptionValue.cpp.
References p_vecValue.
Referenced by Option::parsePartOption().
void OptionValue::bashCompletionValue | ( | PString & | strBashCompletion, |
const PString & | 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 178 of file OptionValue.cpp.
References convertOptionTypeToString(), OptionType::DIRECTORY, OptionType::FILE_OR_DIR, OptionType::FILENAME, p_type, p_vecPossibleValue, path_completion_all(), path_completion_dirOnly(), and value_completion().
Referenced by Option::getPossibleValue().
|
private |
Check the type from the template.
Throw exception if there is an incompatibility
Definition at line 76 of file OptionValue_impl.h.
References convertOptionTypeToString(), isOptionTypeCompatible(), and p_type.
|
protected |
Copy function of OptionValue.
other | : class to copy |
Definition at line 197 of file OptionValue.cpp.
References p_type, p_vecDefaultValue, p_vecPossibleValue, and p_vecValue.
Referenced by operator=(), and OptionValue().
PVecString & OptionValue::getDefaultValue | ( | ) |
Get the default value of the OptionValue.
Definition at line 162 of file OptionValue.cpp.
References p_vecDefaultValue.
const PVecString & OptionValue::getDefaultValue | ( | ) | const |
Get the default value of the OptionValue.
Definition at line 157 of file OptionValue.cpp.
References p_vecDefaultValue.
Referenced by Option::print(), and testOptionValue().
PVecString & OptionValue::getPossibleValue | ( | ) |
Get the possible values of the OptionValue.
Definition at line 172 of file OptionValue.cpp.
References p_vecPossibleValue.
const PVecString & OptionValue::getPossibleValue | ( | ) | const |
Get the possible values of the OptionValue.
Definition at line 167 of file OptionValue.cpp.
References p_vecPossibleValue.
Referenced by Option::print(), and testOptionValue().
OptionType::OptionType & OptionValue::getType | ( | ) |
Get the type of the OptionValue.
Definition at line 152 of file OptionValue.cpp.
References p_type.
OptionType::OptionType OptionValue::getType | ( | ) | const |
Get the type of the OptionValue.
Definition at line 147 of file OptionValue.cpp.
References p_type.
Referenced by Option::checkArgument(), Option::parsePartOption(), Option::print(), and testOptionValue().
PVecString & OptionValue::getValue | ( | ) |
Get the vector of values.
Definition at line 142 of file OptionValue.cpp.
References p_vecValue.
const PVecString & OptionValue::getValue | ( | ) | const |
Get the vector of values.
Definition at line 137 of file OptionValue.cpp.
References p_vecValue.
Referenced by OptionMode::getValue(), printValueOfOpt(), printValueOfOptConst(), and testOptionValue().
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 59 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 38 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 210 of file OptionValue.cpp.
References p_type, p_vecDefaultValue, p_vecPossibleValue, and p_vecValue.
Referenced by OptionValue().
OptionValue & OptionValue::operator= | ( | const OptionValue & | other | ) |
Definition of equal operator of OptionValue.
other | : class to copy |
Definition at line 98 of file OptionValue.cpp.
References copyOptionValue().
void OptionValue::setDefaultValue | ( | const std::vector< T > & | value | ) |
Set the value in the OptionValue.
value | : value of the OptionValue |
Definition at line 29 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 PString::fromValue(), 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 106 of file OptionValue.cpp.
References p_type.
Referenced by OptionParser::addOption().
void OptionValue::setValue | ( | const PString & | value | ) |
Set the value of the OptionValue.
value | : value to be set |
Definition at line 113 of file OptionValue.cpp.
Referenced by testOptionValue().
void OptionValue::setValue | ( | const PVecString & | value | ) |
Set the value of the OptionValue.
value | : value to be set |
Definition at line 122 of file OptionValue.cpp.
References p_vecValue.
void OptionValue::setVecPossibleValue | ( | const PVecString & | vecPossibleValue | ) |
Set the vector of possible values.
vecPossibleValue | : vector of possible values |
Definition at line 132 of file OptionValue.cpp.
References p_vecPossibleValue.
Referenced by OptionParser::addOption().
|
private |
Type of the OptionValue.
Definition at line 71 of file OptionValue.h.
Referenced by bashCompletionValue(), checkTypeFromTemplate(), copyOptionValue(), getType(), initialisationOptionValue(), and setType().
|
private |
Default value of the OptionValue.
Definition at line 75 of file OptionValue.h.
Referenced by copyOptionValue(), getDefaultValue(), getValue(), initialisationOptionValue(), and setDefaultValue().
|
private |
Vector of the possible value for the OptionValue.
Definition at line 77 of file OptionValue.h.
Referenced by bashCompletionValue(), copyOptionValue(), getPossibleValue(), initialisationOptionValue(), and setVecPossibleValue().
|
private |
Vector of the values of the OptionValue.
Definition at line 73 of file OptionValue.h.
Referenced by addValue(), copyOptionValue(), getValue(), initialisationOptionValue(), and setValue().