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

References com.

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

◆ commandString()

void IfaceCommand::commandString ( string &  res) const

Get the complete command line string.

Parameters
resis overwritten with the full command line string

References com, and IfaceStatus::wordsToString().

◆ 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

References com.

Referenced by compare_ifacecommand().

◆ 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 IfaceDecompCommand, IfaceCommandDummy, and IfaceBaseCommand.

Referenced by IfaceStatus::registerCom().

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

◆ 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 IfaceDecompCommand, IfaceCommandDummy, and IfaceBaseCommand.

Referenced by IfaceStatus::registerCom().

◆ 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 IfaceDecompCommand, IfaceCommandDummy, and IfaceBaseCommand.

Referenced by IfaceStatus::registerCom().


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