Ghidra Decompiler Analysis Engine
Public Member Functions | List of all members
OptionDatabase Class Reference

A Dispatcher for possible ArchOption commands. More...

#include <options.hh>

Public Member Functions

 OptionDatabase (Architecture *g)
 Construct given the owning Architecture. More...
 
 ~OptionDatabase (void)
 Destructor.
 
string set (const string &nm, const string &p1="", const string &p2="", const string &p3="")
 Issue an option command. More...
 
void parseOne (const Element *el)
 Unwrap and execute a single option XML tag. More...
 
void restoreXml (const Element *el)
 Execute a series of option commands passed by XML. More...
 

Detailed Description

A Dispatcher for possible ArchOption commands.

An option command is a specific request by a user to change the configuration options for an Architecture. This class takes care of dispatching the command to the proper ArchOption derived class, which does the work of actually modifying the configuration. The command is issued either through the set() method directly, or via an XML tag handed to the restoreXml() method. The restoreXml() method expects an <optionslist> tag with one or more sub-tags. The sub-tag names match the registered name of the option and have up to three child tags, <param1>, <param2> and <param3>, whose content is provided as the optional parameters to command.

Constructor & Destructor Documentation

◆ OptionDatabase()

OptionDatabase::OptionDatabase ( Architecture g)

Construct given the owning Architecture.

Register all possible ArchOption objects with this database and set-up the parsing map.

Parameters
gis the Architecture owning this database

Member Function Documentation

◆ parseOne()

void OptionDatabase::parseOne ( const Element el)

Unwrap and execute a single option XML tag.

Unwrap the name and optional parameters and call method set()

Parameters
elis the command XML tag

◆ restoreXml()

void OptionDatabase::restoreXml ( const Element el)

Execute a series of option commands passed by XML.

Parse the <optionslist> tag, treating each sub-tag as an option command.

Parameters
elis the <optionslist> tag

◆ set()

string OptionDatabase::set ( const string &  nm,
const string &  p1 = "",
const string &  p2 = "",
const string &  p3 = "" 
)

Issue an option command.

Perform an option command directly, given its name and optional parameters

Parameters
nmis the registered name of the option
p1is the first optional parameter
p2is the second optional parameter
p3is the third optional parameter
Returns
the confirmation/failure method after trying to apply the option

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