Ghidra Decompiler Analysis Engine
|
Implement the command-line interface on top of a specific input stream. More...
#include <ifaceterm.hh>
Public Member Functions | |
IfaceTerm (const string &prmpt, istream &is, ostream &os) | |
Constructor. | |
virtual void | pushScript (const string &filename, const string &newprompt) |
Provide a new script file to execute, with an associated command prompt. More... | |
virtual void | popScript (void) |
Return to processing the parent stream. More... | |
virtual bool | isStreamFinished (void) const |
Return true if the current stream is finished. | |
Public Member Functions inherited from IfaceStatus | |
IfaceStatus (const string &prmpt, ostream &os, int4 mxhist=10) | |
Constructor. More... | |
virtual | ~IfaceStatus (void) |
Destructor. | |
void | reset (void) |
Pop any existing script streams and return to processing from the base stream. | |
void | registerCom (IfaceCommand *fptr, const char *nm1, const char *nm2=(const char *) 0, const char *nm3=(const char *) 0, const char *nm4=(const char *) 0, const char *nm5=(const char *) 0) |
Register a command with this interface. More... | |
IfaceData * | getData (const string &nm) const |
Get data associated with a IfaceCommand module. More... | |
bool | runCommand (void) |
Run the next command. More... | |
void | getHistory (string &line, int4 i) const |
Get the i-th command line from history. More... | |
void | evaluateError (void) |
Adjust which stream to process based on last error. | |
Additional Inherited Members | |
Static Public Member Functions inherited from IfaceStatus | |
static void | wordsToString (string &res, const vector< string > &list) |
Concatenate tokens. More... | |
Public Attributes inherited from IfaceStatus | |
bool | done |
Set to true (by a command) to indicate processing is finished. | |
ostream * | optr |
Where to put command line output. | |
ostream * | fileoptr |
Where to put bulk output. | |
Protected Member Functions inherited from IfaceStatus | |
int4 | expandCom (vector< string > &expand, istream &s, vector< IfaceCommand * >::const_iterator &first, vector< IfaceCommand * >::const_iterator &last) |
Expand tokens from the given input stream to a full command. More... | |
Protected Attributes inherited from IfaceStatus | |
bool | inerror |
Set to true if last command did not succeed. | |
vector< IfaceCommand * > | comlist |
List of registered commands. | |
map< string, IfaceData * > | datamap |
Data associated with particular modules. | |
Implement the command-line interface on top of a specific input stream.
An initial input stream is provided as the base stream to parse for commands. Additional input streams can be stacked by invoking scripts. If the stream supports it, the stream parser recognizes special command-line editing and completion keys.
|
virtual |
Return to processing the parent stream.
The current input stream, as established by a script, is popped from the stack, along with its command prompt, and processing continues with the previous stream.
Reimplemented from IfaceStatus.
|
virtual |
Provide a new script file to execute, with an associated command prompt.
The script provides a subsidiary input stream to the current stream. Once commands from the script are complete, processing will resume on this stream.
filename | is the name of the file containing the script |
newprompt | is the command line prompt |
Reimplemented from IfaceStatus.