wavelength 1.0.0
Loading...
Searching...
No Matches
Option Class Referenceabstract

Command-line option an OptionProcessor matches. More...

#include <option.h>

Inheritance diagram for Option:

Public Member Functions

 Option (const char *pszName)
 Construct an option of a name.
virtual ~Option ()
 Release the option.
virtual void Parse (int *pnIndex)=0
 Read the value that follows the option on the command line.
virtual void PrintUsage () const =0
 Print the option's usage line.
bool Match (int *pnIndex) const
 Report whether the argument at an index names this option, and step past it when it does.
 Option (const char *name)
 Create an option.
virtual ~Option ()
 Release the option.
virtual void Set (int &curArg)=0
 Apply the option, consuming any value arguments after it.
virtual void PrintUsage ()=0
 Print the option's usage line.
bool Matches (int &curArg)
 Consume the current argument when it names this option.

Protected Attributes

const char * mName

Detailed Description

Command-line option an OptionProcessor matches.

Command-line option that OptionProcessor matches by name.

The RTTI includes the class name and records no base. BoolOption and StringOption derive from it. The name is at +0x00 and the vptr at +0x04.

The RTTI includes the class name. The object is 8 bytes.

Constructor & Destructor Documentation

◆ Option() [1/2]

Option::Option ( const char * pszName)
explicit

Construct an option of a name.

Parameters
pszNameThe name, without the leading -.
Ghidra address:
NTSC-U/C: 0x0029d918
Ghidra address:
PAL: 0x002a75e0

◆ ~Option() [1/2]

virtual Option::~Option ( )
inlinevirtual

Release the option.

Ghidra address:
NTSC-U/C: 0x003ab520
Ghidra address:
PAL: 0x0041a280

◆ Option() [2/2]

Option::Option ( const char * name)
explicit

Create an option.

Parameters
nameThe option's name, matched after the leading dash of an argument.
Ghidra address:
0x10013260

◆ ~Option() [2/2]

virtual Option::~Option ( )
virtual

Release the option.

Ghidra address:
0x100132f0

Member Function Documentation

◆ Parse()

virtual void Option::Parse ( int * pnIndex)
pure virtual

Read the value that follows the option on the command line.

Parameters
pnIndexThe index of the next argument, advanced past what the option reads.

Implemented in BoolOption, and StringOption.

◆ PrintUsage() [1/2]

virtual void Option::PrintUsage ( ) const
pure virtual

Print the option's usage line.

Implemented in BoolOption, and StringOption.

◆ Match()

bool Option::Match ( int * pnIndex) const

Report whether the argument at an index names this option, and step past it when it does.

Parameters
pnIndexThe index of the argument.
Returns
Whether the argument names the option.
Ghidra address:
NTSC-U/C: 0x0029d9e0
Ghidra address:
PAL: 0x002a76a8

◆ Set()

virtual void Option::Set ( int & curArg)
pure virtual

Apply the option, consuming any value arguments after it.

Parameters
curArgThe index of the next argument.

Implemented in BoolOption, and StringOption.

◆ PrintUsage() [2/2]

virtual void Option::PrintUsage ( )
pure virtual

Print the option's usage line.

Implemented in BoolOption, and StringOption.

◆ Matches()

bool Option::Matches ( int & curArg)

Consume the current argument when it names this option.

Parameters
curArgThe index of the current argument, advanced past it on a match.
Returns
Whether the argument names this option.
Ghidra address:
0x10013360

Member Data Documentation

◆ mName

const char * Option::mName
protected

The name, without the leading -.

The option's name.


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