decompiler  1.0.0
Public Member Functions | Private Attributes | List of all members
ghidra::IfaceCommand Class Referenceabstract

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

#include <interface.hh>

Inheritance diagram for ghidra::IfaceCommand:
ghidra::IfaceBaseCommand ghidra::IfaceCommandDummy ghidra::IfaceDecompCommand ghidra::IfcClosefile ghidra::IfcEcho ghidra::IfcHistory ghidra::IfcOpenfile ghidra::IfcOpenfileAppend ghidra::IfcQuit ghidra::IfcAddrrangeLoad ghidra::IfcAdjustVma ghidra::IfcAnalyzeRange ghidra::IfcBreakaction ghidra::IfcBreakstart ghidra::IfcCallFixup ghidra::IfcCallGraphBuild ghidra::IfcCallGraphDump ghidra::IfcCallGraphList ghidra::IfcCallGraphLoad ghidra::IfcCallOtherFixup ghidra::IfcCleararch ghidra::IfcComment ghidra::IfcCommentInstr ghidra::IfcContinue ghidra::IfcCountPcode ghidra::IfcDeadcodedelay ghidra::IfcDecompile ghidra::IfcDump ghidra::IfcDumpbinary ghidra::IfcDuplicateHash ghidra::IfcExecuteTestCommand ghidra::IfcFixupApply ghidra::IfcFlowOverride ghidra::IfcForceDatatypeFormat ghidra::IfcForceFormat ghidra::IfcForcegoto ghidra::IfcFuncload ghidra::IfcGlobalAdd ghidra::IfcGlobalify ghidra::IfcGlobalRegisters ghidra::IfcGlobalRemove ghidra::IfcGraphControlflow ghidra::IfcGraphDataflow ghidra::IfcGraphDom ghidra::IfcIsolate ghidra::IfcJumpOverride ghidra::IfcListaction ghidra::IfcListOverride ghidra::IfcListprototypes ghidra::IfcListTestCommands ghidra::IfcLoadTestFile ghidra::IfcLockPrototype ghidra::IfcMapaddress ghidra::IfcMapconvert ghidra::IfcMapexternalref ghidra::IfcMapfunction ghidra::IfcMaphash ghidra::IfcMaplabel ghidra::IfcMapunionfacet ghidra::IfcNameVarnode ghidra::IfcOption ghidra::IfcParseFile ghidra::IfcParseLine ghidra::IfcPointerSetting ghidra::IfcPreferSplit ghidra::IfcPrintActionstats ghidra::IfcPrintBlocktree ghidra::IfcPrintCFlat ghidra::IfcPrintCGlobals ghidra::IfcPrintCover ghidra::IfcPrintCStruct ghidra::IfcPrintCTypes ghidra::IfcPrintCXml ghidra::IfcPrintdisasm ghidra::IfcPrintExtrapop ghidra::IfcPrintHigh ghidra::IfcPrintInputs ghidra::IfcPrintInputsAll ghidra::IfcPrintLanguage ghidra::IfcPrintLocalrange ghidra::IfcPrintMap ghidra::IfcPrintParamMeasures ghidra::IfcPrintRaw ghidra::IfcPrintSpaces ghidra::IfcPrintTree ghidra::IfcPrintVarnode ghidra::IfcProduceC ghidra::IfcProducePrototypes ghidra::IfcProtooverride ghidra::IfcReadonly ghidra::IfcReadSymbols ghidra::IfcRemove ghidra::IfcRename ghidra::IfcResetActionstats ghidra::IfcRetype ghidra::IfcSetcontextrange ghidra::IfcSettrackedrange ghidra::IfcSource ghidra::IfcStructureBlocks ghidra::IfcTypeVarnode ghidra::IfcUnlockPrototype ghidra::IfcVarnodeCover ghidra::IfcVarnodehighCover ghidra::IfcVolatile

Public Member Functions

virtual ~IfaceCommand (void)
 Destructor.
 
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 removeWord (void)
 Remove the last token from the associated command line string.
 
const string & getCommandWord (int4 i) const
 Get the i-th command token.
 
void addWords (const vector< string > &wordlist)
 Add words to the associated command line string.
 
int4 numWords (void) const
 Return the number of tokens in the 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...
 

Private Attributes

vector< string > com
 The token sequence associated with the command.
 

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 ghidra::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

Referenced by ghidra::IfaceStatus::registerCom(), and ghidra::IfaceStatus::restrictCom().

◆ commandString()

void ghidra::IfaceCommand::commandString ( string &  res) const

Get the complete command line string.

Parameters
resis overwritten with the full command line string

References ghidra::IfaceStatus::wordsToString().

◆ compare()

int4 ghidra::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

References com.

Referenced by ghidra::compare_ifacecommand().

◆ createData()

virtual IfaceData* ghidra::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 ghidra::IfaceBaseCommand, ghidra::IfaceCommandDummy, and ghidra::IfaceDecompCommand.

Referenced by ghidra::IfaceStatus::registerCom().

◆ execute()

virtual void ghidra::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 ghidra::IfcExecuteTestCommand, ghidra::IfcListTestCommands, ghidra::IfcLoadTestFile, ghidra::IfcAnalyzeRange, ghidra::IfcStructureBlocks, ghidra::IfcPreferSplit, ghidra::IfcPointerSetting, ghidra::IfcReadonly, ghidra::IfcVolatile, ghidra::IfcResetActionstats, ghidra::IfcPrintActionstats, ghidra::IfcCountPcode, ghidra::IfcFixupApply, ghidra::IfcCallOtherFixup, ghidra::IfcCallFixup, ghidra::IfcComment, ghidra::IfcCallGraphList, ghidra::IfcCallGraphLoad, ghidra::IfcCallGraphBuildQuick, ghidra::IfcCallGraphBuild, ghidra::IfcCallGraphDump, ghidra::IfcDuplicateHash, ghidra::IfcCommentInstr, ghidra::IfcGraphDom, ghidra::IfcGraphControlflow, ghidra::IfcGraphDataflow, ghidra::IfcPrintRaw, ghidra::IfcContinue, ghidra::IfcPrintMap, ghidra::IfcPrintLocalrange, ghidra::IfcUnlockPrototype, ghidra::IfcLockPrototype, ghidra::IfcPrintInputsAll, ghidra::IfcPrintInputs, ghidra::IfcGlobalRegisters, ghidra::IfcGlobalify, ghidra::IfcGlobalRemove, ghidra::IfcGlobalAdd, ghidra::IfcDeadcodedelay, ghidra::IfcFlowOverride, ghidra::IfcJumpOverride, ghidra::IfcProtooverride, ghidra::IfcForcegoto, ghidra::IfcForceDatatypeFormat, ghidra::IfcForceFormat, ghidra::IfcTypeVarnode, ghidra::IfcNameVarnode, ghidra::IfcVarnodeCover, ghidra::IfcPrintExtrapop, ghidra::IfcVarnodehighCover, ghidra::IfcPrintCover, ghidra::IfcPrintVarnode, ghidra::IfcIsolate, ghidra::IfcRemove, ghidra::IfcRetype, ghidra::IfcRename, ghidra::IfcPrintParamMeasures, ghidra::IfcPrintHigh, ghidra::IfcPrintSpaces, ghidra::IfcEcho, ghidra::IfcPrintBlocktree, ghidra::IfcClosefile, ghidra::IfcPrintTree, ghidra::IfcOpenfileAppend, ghidra::IfcBreakaction, ghidra::IfcOpenfile, ghidra::IfcBreakstart, ghidra::IfcHistory, ghidra::IfcSettrackedrange, ghidra::IfcQuit, ghidra::IfcSetcontextrange, ghidra::IfcListprototypes, ghidra::IfcListOverride, ghidra::IfcListaction, ghidra::IfcProducePrototypes, ghidra::IfcProduceC, ghidra::IfcPrintCTypes, ghidra::IfcPrintCGlobals, ghidra::IfcPrintCStruct, ghidra::IfcPrintCFlat, ghidra::IfcPrintCXml, ghidra::IfcPrintLanguage, ghidra::IfcDecompile, ghidra::IfcDumpbinary, ghidra::IfcDump, ghidra::IfcPrintdisasm, ghidra::IfcMapunionfacet, ghidra::IfcMapconvert, ghidra::IfcMaplabel, ghidra::IfcMapexternalref, ghidra::IfcMapfunction, ghidra::IfcMaphash, ghidra::IfcMapaddress, ghidra::IfcReadSymbols, ghidra::IfaceCommandDummy, ghidra::IfcCleararch, ghidra::IfcAddrrangeLoad, ghidra::IfcFuncload, ghidra::IfcAdjustVma, ghidra::IfcParseFile, ghidra::IfcParseLine, ghidra::IfcOption, and ghidra::IfcSource.

◆ getModule()

virtual string ghidra::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 ghidra::IfaceBaseCommand, ghidra::IfaceCommandDummy, and ghidra::IfaceDecompCommand.

Referenced by ghidra::IfaceStatus::registerCom().

◆ setData()

virtual void ghidra::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 ghidra::IfaceBaseCommand, ghidra::IfaceCommandDummy, and ghidra::IfaceDecompCommand.

Referenced by ghidra::IfaceStatus::registerCom().


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