Xmipp
v3.23.11-Nereus
|
#include <argsparser.h>
Public Member Functions | |
ProgramDef () | |
~ProgramDef () | |
virtual bool | parse () |
virtual void | check (std::stringstream &errors) |
ParamDef * | findParam (const String ¶m) |
ParamDef * | findAndFillParam (const String ¶m) |
const char * | getParam (const char *paramName, size_t paramNumber=0) |
const char * | getParam (const char *paramName, const char *subParam, size_t paramNumber=0) |
void | addParamName (const String &name, ParamDef *param) |
void | addParamRequires (const String &name) |
void | addParamExclusiveGroup (ParamDef *param) |
void | clear () |
clear read arguments More... | |
void | read (int argc, const char **argv, bool reportErrors=true) |
Read and validate commmand line. More... | |
SectionDef * | addSection (String sectionName, int visibility=0) |
Public Member Functions inherited from ASTNode | |
ASTNode (ArgLexer *lexer=NULL, ASTNode *parent=NULL) | |
virtual | ~ASTNode () |
virtual bool | consume (ArgTokenType type) |
ArgTokenType | lookahead () const |
bool | lookahead (ArgTokenType type) const |
ArgToken * | currentToken () const |
void | nextToken () |
bool | parseCommentList (CommentList &comments) |
void | error (String msg) |
void | unexpectedToken (String msg="") |
Public Attributes | |
std::vector< SectionDef * > | sections |
CommentList | usageComments |
comments of usage More... | |
CommentList | examples |
examples of use More... | |
std::map< String, ParamDef * > | paramsMap |
Dictionary with all params and alias names. More... | |
StringVector | pendingRequires |
This is for checking that requires names exists. More... | |
String | keywords |
String | seeAlso |
bool | singleOption |
Public Attributes inherited from ASTNode | |
ASTNode * | parent |
ArgLexer * | pLexer |
ArgToken | token |
String | name |
int | visible |
Definition at line 236 of file argsparser.h.
ProgramDef::ProgramDef | ( | ) |
Definition at line 810 of file argsparser.cpp.
ProgramDef::~ProgramDef | ( | ) |
Definition at line 818 of file argsparser.cpp.
void ProgramDef::addParamExclusiveGroup | ( | ParamDef * | param | ) |
Definition at line 925 of file argsparser.cpp.
Definition at line 912 of file argsparser.cpp.
void ProgramDef::addParamRequires | ( | const String & | name | ) |
Definition at line 920 of file argsparser.cpp.
SectionDef * ProgramDef::addSection | ( | String | sectionName, |
int | visibility = 0 |
||
) |
Add a section to the program definition and return a pointer to it, useful for manually
Definition at line 1009 of file argsparser.cpp.
|
virtual |
Implements ASTNode.
Definition at line 883 of file argsparser.cpp.
void ProgramDef::clear | ( | ) |
clear read arguments
Definition at line 933 of file argsparser.cpp.
Find a param and if not provided in cmd line, fill with its defaults values
Param was provided, not need to fill it
Definition at line 1018 of file argsparser.cpp.
Definition at line 905 of file argsparser.cpp.
const char * ProgramDef::getParam | ( | const char * | paramName, |
size_t | paramNumber = 0 |
||
) |
Definition at line 1037 of file argsparser.cpp.
const char * ProgramDef::getParam | ( | const char * | paramName, |
const char * | subParam, | ||
size_t | paramNumber = 0 |
||
) |
Definition at line 1047 of file argsparser.cpp.
|
virtual |
Parse the program definition.
Implements ASTNode.
Definition at line 825 of file argsparser.cpp.
void ProgramDef::read | ( | int | argc, |
const char ** | argv, | ||
bool | reportErrors = true |
||
) |
Read and validate commmand line.
Definition at line 951 of file argsparser.cpp.
CommentList ProgramDef::examples |
examples of use
Definition at line 243 of file argsparser.h.
String ProgramDef::keywords |
Definition at line 246 of file argsparser.h.
Dictionary with all params and alias names.
Definition at line 244 of file argsparser.h.
StringVector ProgramDef::pendingRequires |
This is for checking that requires names exists.
Definition at line 245 of file argsparser.h.
std::vector<SectionDef*> ProgramDef::sections |
Definition at line 241 of file argsparser.h.
String ProgramDef::seeAlso |
Definition at line 247 of file argsparser.h.
bool ProgramDef::singleOption |
This flag is used to check if an independent option was found like: –more, –help that avoid others options restrictions.
Definition at line 250 of file argsparser.h.
CommentList ProgramDef::usageComments |
comments of usage
Definition at line 242 of file argsparser.h.