openMSX
Classes | Public Types | Public Member Functions | List of all members
openmsx::CommandLineParser Class Reference

#include <CommandLineParser.hh>

Public Types

enum  ParseStatus {
  UNPARSED , RUN , CONTROL , TEST ,
  EXIT
}
 
enum  ParsePhase {
  PHASE_BEFORE_INIT , PHASE_INIT , PHASE_BEFORE_SETTINGS , PHASE_LOAD_SETTINGS ,
  PHASE_BEFORE_MACHINE , PHASE_LOAD_MACHINE , PHASE_DEFAULT_MACHINE , PHASE_LAST
}
 

Public Member Functions

 CommandLineParser (Reactor &reactor)
 
void registerOption (const char *str, CLIOption &cliOption, ParsePhase phase=PHASE_LAST, unsigned length=2)
 
void registerFileType (std::span< const std::string_view > extensions, CLIFileType &cliFileType)
 
void parse (std::span< char * > argv)
 
ParseStatus getParseStatus () const
 
const auto & getStartupScripts () const
 
const auto & getStartupCommands () const
 
MSXMotherBoardgetMotherBoard () const
 
GlobalCommandControllergetGlobalCommandController () const
 
InterpretergetInterpreter () const
 

Detailed Description

Definition at line 34 of file CommandLineParser.hh.

Member Enumeration Documentation

◆ ParsePhase

Enumerator
PHASE_BEFORE_INIT 
PHASE_INIT 
PHASE_BEFORE_SETTINGS 
PHASE_LOAD_SETTINGS 
PHASE_BEFORE_MACHINE 
PHASE_LOAD_MACHINE 
PHASE_DEFAULT_MACHINE 
PHASE_LAST 

Definition at line 38 of file CommandLineParser.hh.

◆ ParseStatus

Enumerator
UNPARSED 
RUN 
CONTROL 
TEST 
EXIT 

Definition at line 37 of file CommandLineParser.hh.

Constructor & Destructor Documentation

◆ CommandLineParser()

openmsx::CommandLineParser::CommandLineParser ( Reactor reactor)
explicit

Member Function Documentation

◆ getGlobalCommandController()

GlobalCommandController & openmsx::CommandLineParser::getGlobalCommandController ( ) const

◆ getInterpreter()

Interpreter & openmsx::CommandLineParser::getInterpreter ( ) const

◆ getMotherBoard()

MSXMotherBoard * openmsx::CommandLineParser::getMotherBoard ( ) const

◆ getParseStatus()

CommandLineParser::ParseStatus openmsx::CommandLineParser::getParseStatus ( ) const

Definition at line 270 of file CommandLineParser.cc.

References UNPARSED.

◆ getStartupCommands()

const auto & openmsx::CommandLineParser::getStartupCommands ( ) const
inline

Definition at line 60 of file CommandLineParser.hh.

Referenced by openmsx::Reactor::runStartupScripts().

◆ getStartupScripts()

const auto & openmsx::CommandLineParser::getStartupScripts ( ) const
inline

Definition at line 57 of file CommandLineParser.hh.

Referenced by openmsx::Reactor::runStartupScripts().

◆ parse()

void openmsx::CommandLineParser::parse ( std::span< char * >  argv)

◆ registerFileType()

void openmsx::CommandLineParser::registerFileType ( std::span< const std::string_view >  extensions,
CLIFileType cliFileType 
)

◆ registerOption()

void openmsx::CommandLineParser::registerOption ( const char *  str,
CLIOption cliOption,
ParsePhase  phase = PHASE_LAST,
unsigned  length = 2 
)

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