Ghidra Decompiler Analysis Engine
Public Member Functions | List of all members
IfaceCommand Class Referenceabstract

A command that can be executed from the command line. More...

#include <interface.hh>

Inheritance diagram for IfaceCommand:
Inheritance graph
[legend]

Public Member Functions

virtual void setData (IfaceStatus *root, IfaceData *data)=0
 Associate a specific data object with this command. More...
 
virtual void execute (istream &s)=0
 
virtual string getModule (void) const =0
 Get the formal module name to which this command belongs. More...
 
virtual IfaceDatacreateData (void)=0
 Create a specialized data object for this command (and its module) More...
 
void addWord (const string &temp)
 Add a token to the command line string associated with this command. More...
 
void addWords (const vector< string > &wordlist)
 Add words to the associated command line string.
 
void commandString (string &res) const
 Get the complete command line string. More...
 
int4 compare (const IfaceCommand &op2) const
 Order two commands by their command line strings. More...
 

Detailed Description

A command that can be executed from the command line.

The command has data associated with it (via setData()) and is executed via the execute() method. The command can get additional parameters from the command line by reading the input stream passed to it. The command is associated with a specific sequence of words (tokens) that should appear at the start of the command line.

Member Function Documentation

◆ addWord()

void IfaceCommand::addWord ( const string &  temp)
inline

Add a token to the command line string associated with this command.

Parameters
tempis the new token to add

◆ commandString()

void IfaceCommand::commandString ( string &  res) const

Get the complete command line string.

Parameters
resis overwritten with the full command line string

◆ compare()

int4 IfaceCommand::compare ( const IfaceCommand op2) const

Order two commands by their command line strings.

The commands are ordered lexicographically and alphabetically by the comparing tokens in their respective command line strings

Parameters
op2is the other command to compare with this
Returns
-1, 0, 1 if this is earlier, equal to, or after to the other command

◆ createData()

virtual IfaceData* IfaceCommand::createData ( void  )
pure virtual

Create a specialized data object for this command (and its module)

This method is only called once per module

Returns
the newly created data object for the module

Implemented in IfaceBaseCommand, IfaceCodeDataCommand, IfaceCommandDummy, and IfaceDecompCommand.

◆ execute()

virtual void IfaceCommand::execute ( istream &  s)
pure virtual

Execute this command. Additional state can be read from the given command line stream. Otherwise, the command gets its data from its registered IfaceData object

Parameters
sis the input stream from the command line

Implemented in IfcAnalyzeRange, IfcStructureBlocks, IfcPreferSplit, IfcReadonly, IfcVolatile, IfcResetActionstats, IfcPrintActionstats, IfcCountPcode, IfcCallOtherFixup, IfcCallFixup, IfcComment, IfcCallGraphList, IfcCallGraphLoad, IfcCallGraphBuild, IfcCallGraphDump, IfcDuplicateHash, IfcCommentInstr, IfcGraphDom, IfcGraphControlflow, IfcGraphDataflow, IfcPrintRaw, IfcContinue, IfcPrintMap, IfcPrintLocalrange, IfcUnlockPrototype, IfcLockPrototype, IfcPrintInputsAll, IfcPrintInputs, IfcGlobalRegisters, IfcGlobalify, IfcGlobalRemove, IfcGlobalAdd, IfcDeadcodedelay, IfcFlowOverride, IfcJumpOverride, IfcProtooverride, IfcForcegoto, IfcForceDec, IfcForceHex, IfcTypeVarnode, IfcNameVarnode, IfcVarnodeCover, IfcPrintExtrapop, IfcVarnodehighCover, IfcPrintCover, IfcPrintVarnode, IfcRemove, IfcRetype, IfcRename, IfcPrintParamMeasures, IfcPrintHigh, IfcPrintSpaces, IfcEcho, IfcPrintBlocktree, IfcClosefile, IfcPrintTree, IfcOpenfileAppend, IfcBreakaction, IfcOpenfile, IfcBreakstart, IfcHistory, IfcSettrackedrange, IfcQuit, IfcSetcontextrange, IfcListprototypes, IfcListOverride, IfcListaction, IfcProducePrototypes, IfcProduceC, IfcPrintCTypes, IfcPrintCGlobals, IfcPrintCStruct, IfcPrintCFlat, IfcPrintCXml, IfcPrintLanguage, IfcDecompile, IfcCodeDataDumpTargetHits, IfcDumpbinary, IfcCodeDataDumpUnlinked, IfcDump, IfcCodeDataDumpStarts, IfcPrintdisasm, IfcCodeDataDumpCrossRefs, IfcMaplabel, IfcCodeDataDumpModelHits, IfcMapexternalref, IfcCodeDataRun, IfcMapfunction, IfcCodeDataTarget, IfcMaphash, IfcCodeDataInit, IfcMapaddress, IfcReadSymbols, IfcCleararch, IfcAddrrangeLoad, IfaceCommandDummy, IfcFuncload, IfcAdjustVma, IfcParseFile, IfcParseLine, IfcOption, IfcSource, IfcRestore, IfcSave, IfcAddpath, and IfcLoadFile.

◆ getModule()

virtual string IfaceCommand::getModule ( void  ) const
pure virtual

Get the formal module name to which this command belongs.

Commands in the same module share data through their registered IfaceData object

Returns
the formal module name

Implemented in IfaceBaseCommand, IfaceCodeDataCommand, IfaceCommandDummy, and IfaceDecompCommand.

◆ setData()

virtual void IfaceCommand::setData ( IfaceStatus root,
IfaceData data 
)
pure virtual

Associate a specific data object with this command.

Parameters
rootis the interface object this command is registered with
datais the data object the command should use

Implemented in IfaceBaseCommand, IfaceCodeDataCommand, IfaceCommandDummy, and IfaceDecompCommand.


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