![]() |
PhoenixInkscape
2.0.0
Generate multiple png files with svg inkscape files
|
Parse the list of arguments passed to a program. More...
#include <ArgParser.h>
Public Member Functions | |
ArgParser () | |
Default constructor of ArgParser. More... | |
ArgParser (const ArgParser &other) | |
Copy constructor of ArgParser. More... | |
ArgParser (int argc, char **argv) | |
Constructor with arguments passed to the program. More... | |
PString & | getCurrentOption () |
Get the current option. More... | |
const PString & | getCurrentOption () const |
Get the current option. More... | |
const PString & | getCursorOption () const |
Get the cursor option given to the program, in bash completion mode. More... | |
size_t | getNbArgument () const |
Get the number of arguments passed to the program. More... | |
void | getNextOption () |
Move to the next option. More... | |
const PString & | getPrevCursorOption () const |
Get the previous option before the cursor option. More... | |
PString | getRemainingArgument () |
Get all remaining arguments of the ArgParser. More... | |
bool | isBashCompletionMode () const |
Say if the program is in bash completion mode. More... | |
bool | isEndOfOption () const |
Say if is it the end of the options. More... | |
ArgParser & | operator= (const ArgParser &other) |
Definition of equal operator of ArgParser. More... | |
void | print () const |
Print all the input option. More... | |
void | rewind () |
Go bask to the first argument. More... | |
virtual | ~ArgParser () |
Destructeur of ArgParser. More... | |
Protected Member Functions | |
void | copyArgParser (const ArgParser &other) |
Copy function of ArgParser. More... | |
Private Member Functions | |
void | initialisationArgParser () |
Initialisation function of the class ArgParser. More... | |
Private Attributes | |
bool | p_bashCompletionMode |
Say if the program is in bash completion mode. More... | |
size_t | p_currentArg |
Current argument to be parsed. More... | |
PString | p_cursorOption |
Option which is typed right now, given to the program (in bash completion mode) More... | |
PString | p_prevCursorOption |
Previous option before the cursor option. More... | |
PVecString | p_vecArg |
Vector of arguments. More... | |
Parse the list of arguments passed to a program.
Definition at line 13 of file ArgParser.h.
ArgParser::ArgParser | ( | ) |
Default constructor of ArgParser.
Definition at line 11 of file ArgParser.cpp.
References initialisationArgParser().
ArgParser::ArgParser | ( | int | argc, |
char ** | argv | ||
) |
Constructor with arguments passed to the program.
argc | : number of parameters passed to the program |
argv | : list of arguments passed to the program |
Definition at line 19 of file ArgParser.cpp.
References initialisationArgParser(), PString::isSameBegining(), p_bashCompletionMode, p_cursorOption, p_prevCursorOption, p_vecArg, and PString::replace().
ArgParser::ArgParser | ( | const ArgParser & | other | ) |
Copy constructor of ArgParser.
other | : class to copy |
Definition at line 46 of file ArgParser.cpp.
References copyArgParser().
|
virtual |
|
protected |
Copy function of ArgParser.
other | : class to copy |
Definition at line 146 of file ArgParser.cpp.
References p_currentArg, p_cursorOption, p_prevCursorOption, and p_vecArg.
Referenced by ArgParser(), and operator=().
PString & ArgParser::getCurrentOption | ( | ) |
Get the current option.
Definition at line 98 of file ArgParser.cpp.
References p_currentArg, and p_vecArg.
const PString & ArgParser::getCurrentOption | ( | ) | const |
Get the current option.
Definition at line 91 of file ArgParser.cpp.
References p_currentArg, and p_vecArg.
Referenced by OptionParser::getParserMode(), OptionParser::parseArgumentNormalUse(), OptionMode::parseOption(), Option::parsePartOption(), testArgParserArg(), and testConstGetCurrentOption().
const PString & ArgParser::getCursorOption | ( | ) | const |
Get the cursor option given to the program, in bash completion mode.
Definition at line 119 of file ArgParser.cpp.
References p_cursorOption.
Referenced by OptionParser::parseArgumentBashCompletion().
size_t ArgParser::getNbArgument | ( | ) | const |
Get the number of arguments passed to the program.
Definition at line 105 of file ArgParser.cpp.
References p_vecArg.
Referenced by testArgParser(), and testArgParserArg().
void ArgParser::getNextOption | ( | ) |
Move to the next option.
Definition at line 77 of file ArgParser.cpp.
References p_currentArg.
Referenced by OptionParser::getParserMode(), OptionParser::parseArgumentBashCompletion(), OptionMode::parseOption(), and Option::parsePartOption().
const PString & ArgParser::getPrevCursorOption | ( | ) | const |
Get the previous option before the cursor option.
Definition at line 126 of file ArgParser.cpp.
References p_prevCursorOption.
Referenced by OptionParser::parseArgumentBashCompletion().
PString ArgParser::getRemainingArgument | ( | ) |
Get all remaining arguments of the ArgParser.
Definition at line 133 of file ArgParser.cpp.
References p_currentArg, and p_vecArg.
Referenced by OptionMode::parseOption(), and testRemaningArgument().
|
private |
Initialisation function of the class ArgParser.
Definition at line 154 of file ArgParser.cpp.
References p_bashCompletionMode, p_currentArg, p_cursorOption, and p_prevCursorOption.
Referenced by ArgParser().
bool ArgParser::isBashCompletionMode | ( | ) | const |
Say if the program is in bash completion mode.
Definition at line 112 of file ArgParser.cpp.
References p_bashCompletionMode.
Referenced by OptionParser::parseArgument().
bool ArgParser::isEndOfOption | ( | ) | const |
Say if is it the end of the options.
Definition at line 84 of file ArgParser.cpp.
References p_currentArg, and p_vecArg.
Referenced by OptionParser::parseArgumentBashCompletion(), OptionParser::parseArgumentNormalUse(), OptionMode::parseOption(), and Option::parsePartOption().
Definition of equal operator of ArgParser.
other | : class to copy |
Definition at line 59 of file ArgParser.cpp.
References copyArgParser().
void ArgParser::print | ( | ) | const |
Print all the input option.
Definition at line 65 of file ArgParser.cpp.
References p_vecArg.
Referenced by testArgParser(), and testArgParserArg().
void ArgParser::rewind | ( | ) |
Go bask to the first argument.
Definition at line 72 of file ArgParser.cpp.
References p_currentArg.
Referenced by testArgParser(), and testArgParserArg().
|
private |
Say if the program is in bash completion mode.
Definition at line 48 of file ArgParser.h.
Referenced by ArgParser(), initialisationArgParser(), and isBashCompletionMode().
|
private |
Current argument to be parsed.
Definition at line 46 of file ArgParser.h.
Referenced by copyArgParser(), getCurrentOption(), getNextOption(), getRemainingArgument(), initialisationArgParser(), isEndOfOption(), and rewind().
|
private |
Option which is typed right now, given to the program (in bash completion mode)
Definition at line 51 of file ArgParser.h.
Referenced by ArgParser(), copyArgParser(), getCursorOption(), and initialisationArgParser().
|
private |
Previous option before the cursor option.
Definition at line 53 of file ArgParser.h.
Referenced by ArgParser(), copyArgParser(), getPrevCursorOption(), and initialisationArgParser().
|
private |
Vector of arguments.
Definition at line 44 of file ArgParser.h.
Referenced by ArgParser(), copyArgParser(), getCurrentOption(), getNbArgument(), getRemainingArgument(), isEndOfOption(), and print().