45 size_t printGroup(
bool printGroupName,
bool printRequired,
bool hilightMissing,
const std::string &filter =
"",
bool isExtended =
false)
47 if (
countParams(printRequired, hilightMissing, filter) == 0) {
50 const bool has_filter = filter.length() > 0 ? true :
false;
53 if (printGroupName &&
name.length()) {
56 std::set<Param*, ParamCompare>::iterator itr;
58 Param* param = (*itr);
61 if (printRequired != param->
isRequired)
continue;
63 bool should_print = hilightMissing ? false :
true;
76 if (!has_any)
continue;
92 size_t countParams(
bool printRequired,
bool hilightMissing,
const std::string &filter)
94 const bool has_filter = filter.length() > 0 ? true :
false;
96 std::set<Param*, ParamCompare>::iterator itr;
98 Param* param = (*itr);
100 if (!param)
continue;
101 if (printRequired != param->
isRequired)
continue;
102 bool should_print = hilightMissing ? false :
true;
107 should_print =
false;
121 std::set<Param*, ParamCompare>::iterator itr =
params.find(param);
122 if (itr !=
params.end()) {
131 this->
params.insert(param);
137 std::set<Param*, ParamCompare>::iterator itr =
params.find(param);
138 if (itr !=
params.end()) {
The class responsible for grouping parameters (objects of the type Param)
size_t countParams(bool printRequired, bool hilightMissing, const std::string &filter)
std::set< Param *, ParamCompare > params
bool addParam(Param *param)
size_t printGroup(bool printGroupName, bool printRequired, bool hilightMissing, const std::string &filter="", bool isExtended=false)
Prints the whole group of parameters (their names and descriptions), optionally with the group name.
bool hasParam(Param *param)
bool removeParam(Param *param)
ParamGroup(const std::string &_name)
A constructor of a ParamGroup.
The base class of a parameter.
bool isRequired
a flag indicating if this parameter is required
virtual bool isNameSimilar(const std::string &filter)
Checks if the param name is similar to the given filter.
virtual bool isSet() const =0
Returns true if the parameter is filled, false otherwise.
void printInColor(int color)
Prints the parameter using the given color. Appends the parameter switch to the name.
virtual bool isKeywordInDescription(const std::string &keyword)
Checks if the description contains the keyword.
virtual bool isActive() const
Returns true if the parameter is active, false otherwise.
void printDesc(bool isExtended=true) const
Prints a formatted description of the parameter, including its unique name, type, and the info.
The class responsible for storing and parsing parameters (objects of the type Param),...
const WORD PARAM_SIMILAR_DESC
void print_in_color(int color, const std::string &text)
const WORD INACTIVE_COLOR
const WORD PARAM_SIMILAR_NAME
const WORD SEPARATOR_COLOR
const WORD HILIGHTED_COLOR
The set of utility functions related with string processing, and finding similarity between strings.