The base class of a parameter.
More...
#include <param.h>
|
| Param (const std::string &_argStr, bool _isRequired) |
| A constructor of a parameter. More...
|
|
| Param (const std::string &_argStr, const std::string &_typeDescStr, bool _isRequired) |
| A constructor of a parameter. More...
|
|
virtual std::string | valToString () const =0 |
| Returns the string representation of the parameter's value. More...
|
|
virtual std::string | type () const =0 |
| Returns the string representation of the parameter's type. More...
|
|
virtual bool | parse (const char *arg)=0 |
| Parses the parameter from the given string. More...
|
|
virtual bool | parse (const wchar_t *arg) |
| Parses the parameter from the given wide string. More...
|
|
void | setActive (bool _active) |
|
virtual bool | isActive () const |
| Returns true if the parameter is active, false otherwise. More...
|
|
virtual bool | isSet () const =0 |
| Returns true if the parameter is filled, false otherwise. More...
|
|
virtual std::string | info (bool isExtended) const |
|
void | printInColor (int color) |
| Prints the parameter using the given color. Appends the parameter switch to the name. More...
|
|
|
void | printDesc (bool isExtended=true) const |
| Prints a formatted description of the parameter, including its unique name, type, and the info. More...
|
|
virtual bool | isNameSimilar (const std::string &filter) |
| Checks if the param name is similar to the given filter. More...
|
|
virtual bool | isKeywordInType (const std::string &keyword) |
| Checks if the parameter type contains the keyword. More...
|
|
virtual bool | isKeywordInDescription (const std::string &keyword) |
| Checks if the description contains the keyword. More...
|
|
virtual std::string | extendedInfo () const |
| Extended information. More...
|
|
|
std::string | argStr |
| a unique name of the parameter More...
|
|
std::string | typeDescStr |
| a description of the type of the parameter: what type of values are allowed More...
|
|
std::string | m_info |
| a basic information about the the parameter's purpose More...
|
|
std::string | m_extInfo |
| an extended information about the the parameter's purpose More...
|
|
bool | isRequired |
| a flag indicating if this parameter is required More...
|
|
bool | requiredArg |
| a flag indicating if this parameter needs to be followed by a value More...
|
|
bool | active |
| a flag indicating if this parameter is available More...
|
|
The base class of a parameter.
Definition at line 30 of file param.h.
◆ Param() [1/2]
paramkit::Param::Param |
( |
const std::string & |
_argStr, |
|
|
bool |
_isRequired |
|
) |
| |
|
inline |
A constructor of a parameter.
- Parameters
-
_argStr | : the name of the parameter |
_isRequired | : the flag if this is a required parameter (if false, the parameter is optional) |
Definition at line 38 of file param.h.
◆ Param() [2/2]
paramkit::Param::Param |
( |
const std::string & |
_argStr, |
|
|
const std::string & |
_typeDescStr, |
|
|
bool |
_isRequired |
|
) |
| |
|
inline |
A constructor of a parameter.
- Parameters
-
_argStr | : the name of the parameter |
_typeDescStr | : a description of the parameter type |
_isRequired | : the flag if this is a required parameter (if false, the parameter is optional) |
Definition at line 52 of file param.h.
◆ extendedInfo()
virtual std::string paramkit::Param::extendedInfo |
( |
| ) |
const |
|
inlineprotectedvirtual |
◆ info()
virtual std::string paramkit::Param::info |
( |
bool |
isExtended | ) |
const |
|
inlinevirtual |
◆ isActive()
virtual bool paramkit::Param::isActive |
( |
| ) |
const |
|
inlinevirtual |
Returns true if the parameter is active, false otherwise.
Definition at line 84 of file param.h.
◆ isKeywordInDescription()
virtual bool paramkit::Param::isKeywordInDescription |
( |
const std::string & |
keyword | ) |
|
|
inlineprotectedvirtual |
◆ isKeywordInType()
virtual bool paramkit::Param::isKeywordInType |
( |
const std::string & |
keyword | ) |
|
|
inlineprotectedvirtual |
◆ isNameSimilar()
virtual bool paramkit::Param::isNameSimilar |
( |
const std::string & |
filter | ) |
|
|
inlineprotectedvirtual |
Checks if the param name is similar to the given filter.
Definition at line 130 of file param.h.
◆ isSet()
virtual bool paramkit::Param::isSet |
( |
| ) |
const |
|
pure virtual |
◆ parse() [1/2]
virtual bool paramkit::Param::parse |
( |
const char * |
arg | ) |
|
|
pure virtual |
◆ parse() [2/2]
virtual bool paramkit::Param::parse |
( |
const wchar_t * |
arg | ) |
|
|
inlinevirtual |
◆ printDesc()
void paramkit::Param::printDesc |
( |
bool |
isExtended = true | ) |
const |
|
inlineprotected |
Prints a formatted description of the parameter, including its unique name, type, and the info.
Definition at line 114 of file param.h.
◆ printInColor()
void paramkit::Param::printInColor |
( |
int |
color | ) |
|
|
inline |
Prints the parameter using the given color. Appends the parameter switch to the name.
Definition at line 106 of file param.h.
◆ setActive()
void paramkit::Param::setActive |
( |
bool |
_active | ) |
|
|
inline |
◆ type()
virtual std::string paramkit::Param::type |
( |
| ) |
const |
|
pure virtual |
◆ valToString()
virtual std::string paramkit::Param::valToString |
( |
| ) |
const |
|
pure virtual |
◆ ParamCompare
◆ ParamGroup
◆ Params
◆ active
bool paramkit::Param::active |
|
protected |
a flag indicating if this parameter is available
Definition at line 168 of file param.h.
◆ argStr
std::string paramkit::Param::argStr |
|
protected |
a unique name of the parameter
Definition at line 160 of file param.h.
◆ isRequired
bool paramkit::Param::isRequired |
|
protected |
a flag indicating if this parameter is required
Definition at line 166 of file param.h.
◆ m_extInfo
std::string paramkit::Param::m_extInfo |
|
protected |
an extended information about the the parameter's purpose
Definition at line 164 of file param.h.
◆ m_info
std::string paramkit::Param::m_info |
|
protected |
a basic information about the the parameter's purpose
Definition at line 163 of file param.h.
◆ requiredArg
bool paramkit::Param::requiredArg |
|
protected |
a flag indicating if this parameter needs to be followed by a value
Definition at line 167 of file param.h.
◆ typeDescStr
std::string paramkit::Param::typeDescStr |
|
protected |
a description of the type of the parameter: what type of values are allowed
Definition at line 162 of file param.h.
The documentation for this class was generated from the following file: