decompiler  1.0.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ghidra::ConsoleCommands Class Reference

A console command run as part of a test sequence. More...

#include <testfunction.hh>

Inheritance diagram for ghidra::ConsoleCommands:
ghidra::IfaceStatus

Public Member Functions

 ConsoleCommands (ostream &s, vector< string > &comms)
 Constructor. More...
 
virtual void reset (void)
 Reset console for a new program.
 
virtual bool isStreamFinished (void) const
 Return true if the current stream is finished.
 
- Public Member Functions inherited from ghidra::IfaceStatus
 IfaceStatus (const string &prmpt, ostream &os, int4 mxhist=10)
 Constructor. More...
 
virtual ~IfaceStatus (void)
 Destructor.
 
void setErrorIsDone (bool val)
 Set if processing should terminate on an error.
 
void pushScript (const string &filename, const string &newprompt)
 Push a new file on the script stack. More...
 
virtual void pushScript (istream *iptr, const string &newprompt)
 Provide a new input stream to execute, with an associated command prompt. More...
 
virtual void popScript (void)
 Return to processing the parent stream. More...
 
int4 getNumInputStreamSize (void) const
 Get depth of script nesting.
 
void writePrompt (void)
 Write the current command prompt to the current output 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...
 
IfaceDatagetData (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...
 
int4 getHistorySize (void) const
 Get the number of command lines in history.
 
bool isInError (void) const
 Return true if the last command failed.
 
void evaluateError (void)
 Adjust which stream to process based on last error.
 

Private Member Functions

virtual void readLine (string &line)
 Read the next command line. More...
 

Private Attributes

vector< string > & commands
 Sequence of commands.
 
uint4 pos
 Position of next command to execute.
 

Additional Inherited Members

- Static Public Member Functions inherited from ghidra::IfaceStatus
static void wordsToString (string &res, const vector< string > &list)
 Concatenate tokens. More...
 
- Public Attributes inherited from ghidra::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 ghidra::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 ghidra::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.
 

Detailed Description

A console command run as part of a test sequence.

Constructor & Destructor Documentation

◆ ConsoleCommands()

ghidra::ConsoleCommands::ConsoleCommands ( ostream &  s,
vector< string > &  comms 
)

Constructor.

Parameters
sis the stream where command output is printed
commsis the list of commands to be issued

References pos, and ghidra::IfaceCapability::registerAllCommands().

Referenced by ghidra::FunctionTestCollection::FunctionTestCollection().

Member Function Documentation

◆ readLine()

void ghidra::ConsoleCommands::readLine ( string &  line)
privatevirtual

Read the next command line.

Parameters
lineis filled in with the next command to execute

Implements ghidra::IfaceStatus.


The documentation for this class was generated from the following files: