![]() |
PhoenixMock
1.8.7
Tools to split/merge/print mock used in Phoenix
|
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... | |
| std::string & | getCurrentOption () |
| const std::string & | getCurrentOption () const |
| Get the current option. More... | |
| const std::string & | 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 std::string & | getPrevCursorOption () const |
| Get the previous option before the cursor option. 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... | |
| std::string | p_cursorOption |
| Option which is typed right now, given to the program (in bash completion mode) More... | |
| std::string | 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 16 of file ArgParser.h.
| ArgParser::ArgParser | ( | ) |
Default constructor of ArgParser.
Definition at line 12 of file ArgParser.cpp.
References initialisationArgParser().
Here is the call graph for this function:| 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 20 of file ArgParser.cpp.
References initialisationArgParser(), isSameBegining(), p_bashCompletionMode, p_cursorOption, p_prevCursorOption, p_vecArg, and replaceStrInStr().
Here is the call graph for this function:| ArgParser::ArgParser | ( | const ArgParser & | other | ) |
Copy constructor of ArgParser.
| other | : class to copy |
Definition at line 48 of file ArgParser.cpp.
References copyArgParser().
Here is the call graph for this function:
|
virtual |
|
protected |
Copy function of ArgParser.
| other | : class to copy |
Definition at line 135 of file ArgParser.cpp.
References p_currentArg, p_cursorOption, p_prevCursorOption, and p_vecArg.
Referenced by ArgParser(), and operator=().
Here is the caller graph for this function:| std::string& ArgParser::getCurrentOption | ( | ) |
| std::string & ArgParser::getCurrentOption | ( | ) | const |
Get the current option.
Definition at line 93 of file ArgParser.cpp.
References p_currentArg, and p_vecArg.
Referenced by testArgParserArg(), and testConstGetCurrentOption().
Here is the caller graph for this function:| const std::string & ArgParser::getCursorOption | ( | ) | const |
Get the cursor option given to the program, in bash completion mode.
Definition at line 121 of file ArgParser.cpp.
References p_cursorOption.
| size_t ArgParser::getNbArgument | ( | ) | const |
Get the number of arguments passed to the program.
Definition at line 107 of file ArgParser.cpp.
References p_vecArg.
Referenced by testArgParser(), and testArgParserArg().
Here is the caller graph for this function:| void ArgParser::getNextOption | ( | ) |
| const std::string & ArgParser::getPrevCursorOption | ( | ) | const |
Get the previous option before the cursor option.
Definition at line 128 of file ArgParser.cpp.
References p_prevCursorOption.
|
private |
Initialisation function of the class ArgParser.
Definition at line 143 of file ArgParser.cpp.
References p_bashCompletionMode, p_currentArg, p_cursorOption, and p_prevCursorOption.
Referenced by ArgParser().
Here is the caller graph for this function:| bool ArgParser::isBashCompletionMode | ( | ) | const |
Say if the program is in bash completion mode.
Definition at line 114 of file ArgParser.cpp.
References p_bashCompletionMode.
| bool ArgParser::isEndOfOption | ( | ) | const |
Say if is it the end of the options.
Definition at line 86 of file ArgParser.cpp.
References p_currentArg, and p_vecArg.
Definition of equal operator of ArgParser.
| other | : class to copy |
Definition at line 61 of file ArgParser.cpp.
References copyArgParser().
Here is the call graph for this function:| void ArgParser::print | ( | ) | const |
Print all the input option.
Definition at line 67 of file ArgParser.cpp.
References p_vecArg.
Referenced by testArgParser(), and testArgParserArg().
Here is the caller graph for this function:| void ArgParser::rewind | ( | ) |
Go bask to the first argument.
Definition at line 74 of file ArgParser.cpp.
References p_currentArg.
Referenced by testArgParser(), and testArgParserArg().
Here is the caller graph for this function:
|
private |
Say if the program is in bash completion mode.
Definition at line 50 of file ArgParser.h.
Referenced by ArgParser(), initialisationArgParser(), and isBashCompletionMode().
|
private |
Current argument to be parsed.
Definition at line 48 of file ArgParser.h.
Referenced by copyArgParser(), getCurrentOption(), getNextOption(), initialisationArgParser(), isEndOfOption(), and rewind().
|
private |
Option which is typed right now, given to the program (in bash completion mode)
Definition at line 53 of file ArgParser.h.
Referenced by ArgParser(), copyArgParser(), getCursorOption(), and initialisationArgParser().
|
private |
Previous option before the cursor option.
Definition at line 55 of file ArgParser.h.
Referenced by ArgParser(), copyArgParser(), getPrevCursorOption(), and initialisationArgParser().
|
private |
Vector of arguments.
Definition at line 46 of file ArgParser.h.
Referenced by ArgParser(), copyArgParser(), getCurrentOption(), getNbArgument(), isEndOfOption(), and print().