openMSX
Public Types | Public Member Functions | Static Public Member Functions | List of all members
openmsx::SymbolManager Class Reference

#include <SymbolManager.hh>

Public Types

enum class  LoadEmpty { ALLOWED , NOT_ALLOWED }
 

Public Member Functions

 SymbolManager (CommandController &commandController)
 
void setObserver (SymbolObserver *observer_)
 
bool reloadFile (const std::string &filename, LoadEmpty loadEmpty, SymbolFile::Type type, std::optional< uint8_t > slot={})
 
void removeFile (std::string_view filename)
 
void removeAllFiles ()
 
const auto & getFiles () const
 
SymbolFilefindFile (std::string_view filename)
 
std::span< Symbol const *const > lookupValue (uint16_t value)
 
std::optional< uint16_t > parseSymbolOrValue (std::string_view s) const
 

Static Public Member Functions

static std::string getFileFilters ()
 
static SymbolFile::Type getTypeForFilter (std::string_view filter)
 
static std::optional< unsigned > isHexDigit (char c)
 
static std::optional< uint16_t > is4DigitHex (std::string_view s)
 
template<typename T >
static std::optional< T > parseValue (std::string_view str)
 
static std::optional< SymbolcheckLabel (std::string_view label, uint32_t value)
 
static std::optional< SymbolcheckLabelAndValue (std::string_view label, std::string_view value)
 
static std::optional< SymbolcheckLabelSegmentAndValue (std::string_view label, std::string_view value)
 
static SymbolFile::Type detectType (std::string_view filename, std::string_view buffer)
 
static SymbolFile loadLines (std::string_view filename, std::string_view buffer, SymbolFile::Type type, function_ref< std::optional< Symbol >(std::span< std::string_view >)> lineParser)
 
static SymbolFile loadGeneric (std::string_view filename, std::string_view buffer)
 
static SymbolFile loadNoICE (std::string_view filename, std::string_view buffer)
 
static SymbolFile loadHTC (std::string_view filename, std::string_view buffer)
 
static SymbolFile loadVASM (std::string_view filename, std::string_view buffer)
 
static SymbolFile loadNoGmb (std::string_view filename, std::string_view buffer)
 
static SymbolFile loadASMSX (std::string_view filename, std::string_view buffer)
 
static SymbolFile loadLinkMap (std::string_view filename, std::string_view buffer)
 
static SymbolFile loadSymbolFile (const std::string &filename, SymbolFile::Type type, std::optional< uint8_t > slot={})
 

Detailed Description

Definition at line 64 of file SymbolManager.hh.

Member Enumeration Documentation

◆ LoadEmpty

Enumerator
ALLOWED 
NOT_ALLOWED 

Definition at line 80 of file SymbolManager.hh.

Constructor & Destructor Documentation

◆ SymbolManager()

openmsx::SymbolManager::SymbolManager ( CommandController commandController)
explicit

Definition at line 53 of file SymbolManager.cc.

Member Function Documentation

◆ checkLabel()

std::optional< Symbol > openmsx::SymbolManager::checkLabel ( std::string_view  label,
uint32_t  value 
)
static

◆ checkLabelAndValue()

std::optional< Symbol > openmsx::SymbolManager::checkLabelAndValue ( std::string_view  label,
std::string_view  value 
)
static

Definition at line 161 of file SymbolManager.cc.

References checkLabel().

Referenced by loadASMSX(), loadGeneric(), and TEST_CASE().

◆ checkLabelSegmentAndValue()

std::optional< Symbol > openmsx::SymbolManager::checkLabelSegmentAndValue ( std::string_view  label,
std::string_view  value 
)
static

Definition at line 169 of file SymbolManager.cc.

References checkLabel().

Referenced by loadNoICE(), and TEST_CASE().

◆ detectType()

SymbolFile::Type openmsx::SymbolManager::detectType ( std::string_view  filename,
std::string_view  buffer 
)
static

◆ findFile()

SymbolFile * openmsx::SymbolManager::findFile ( std::string_view  filename)

Definition at line 518 of file SymbolManager.cc.

References ranges::find().

Referenced by openmsx::ImGuiSymbols::paint().

◆ getFileFilters()

std::string openmsx::SymbolManager::getFileFilters ( )
static

Definition at line 527 of file SymbolManager.cc.

Referenced by openmsx::ImGuiSymbols::paint().

◆ getFiles()

const auto & openmsx::SymbolManager::getFiles ( ) const
inline

◆ getTypeForFilter()

SymbolFile::Type openmsx::SymbolManager::getTypeForFilter ( std::string_view  filter)
static

Definition at line 541 of file SymbolManager.cc.

Referenced by openmsx::ImGuiSymbols::paint().

◆ is4DigitHex()

std::optional< uint16_t > openmsx::SymbolManager::is4DigitHex ( std::string_view  s)
static

Definition at line 327 of file SymbolManager.cc.

References isHexDigit().

Referenced by loadLinkMap(), and TEST_CASE().

◆ isHexDigit()

std::optional< unsigned > openmsx::SymbolManager::isHexDigit ( char  c)
static

Definition at line 320 of file SymbolManager.cc.

Referenced by is4DigitHex(), and TEST_CASE().

◆ loadASMSX()

SymbolFile openmsx::SymbolManager::loadASMSX ( std::string_view  filename,
std::string_view  buffer 
)
static

◆ loadGeneric()

SymbolFile openmsx::SymbolManager::loadGeneric ( std::string_view  filename,
std::string_view  buffer 
)
static

Definition at line 177 of file SymbolManager.cc.

References checkLabelAndValue(), openmsx::SymbolFile::GENERIC, and loadLines().

Referenced by loadSymbolFile(), and TEST_CASE().

◆ loadHTC()

SymbolFile openmsx::SymbolManager::loadHTC ( std::string_view  filename,
std::string_view  buffer 
)
static

Definition at line 218 of file SymbolManager.cc.

References checkLabel(), openmsx::SymbolFile::HTC, and loadLines().

Referenced by loadSymbolFile(), and TEST_CASE().

◆ loadLines()

SymbolFile openmsx::SymbolManager::loadLines ( std::string_view  filename,
std::string_view  buffer,
SymbolFile::Type  type,
function_ref< std::optional< Symbol >(std::span< std::string_view >)>  lineParser 
)
static

◆ loadLinkMap()

SymbolFile openmsx::SymbolManager::loadLinkMap ( std::string_view  filename,
std::string_view  buffer 
)
static

◆ loadNoGmb()

SymbolFile openmsx::SymbolManager::loadNoGmb ( std::string_view  filename,
std::string_view  buffer 
)
static

Definition at line 266 of file SymbolManager.cc.

References checkLabel(), loadLines(), and openmsx::SymbolFile::WLALINK_NOGMB.

Referenced by loadSymbolFile(), and TEST_CASE().

◆ loadNoICE()

SymbolFile openmsx::SymbolManager::loadNoICE ( std::string_view  filename,
std::string_view  buffer 
)
static

◆ loadSymbolFile()

SymbolFile openmsx::SymbolManager::loadSymbolFile ( const std::string &  filename,
SymbolFile::Type  type,
std::optional< uint8_t >  slot = {} 
)
static

◆ loadVASM()

SymbolFile openmsx::SymbolManager::loadVASM ( std::string_view  filename,
std::string_view  buffer 
)
static

◆ lookupValue()

std::span< Symbol const *const > openmsx::SymbolManager::lookupValue ( uint16_t  value)

Definition at line 502 of file SymbolManager.cc.

◆ parseSymbolOrValue()

std::optional< uint16_t > openmsx::SymbolManager::parseSymbolOrValue ( std::string_view  s) const

Definition at line 480 of file SymbolManager.cc.

References ranges::find(), ranges::find_if(), and openmsx::Symbol::name.

◆ parseValue()

template<typename T >
template std::optional< uint32_t > openmsx::SymbolManager::parseValue< uint32_t > ( std::string_view  str)
static

Definition at line 127 of file SymbolManager.cc.

◆ reloadFile()

bool openmsx::SymbolManager::reloadFile ( const std::string &  filename,
LoadEmpty  loadEmpty,
SymbolFile::Type  type,
std::optional< uint8_t >  slot = {} 
)

◆ removeAllFiles()

void openmsx::SymbolManager::removeAllFiles ( )

Definition at line 474 of file SymbolManager.cc.

Referenced by openmsx::ImGuiSymbols::loadStart().

◆ removeFile()

void openmsx::SymbolManager::removeFile ( std::string_view  filename)

Definition at line 466 of file SymbolManager.cc.

References openmsx::SymbolFile::filename, and ranges::find().

Referenced by openmsx::ImGuiSymbols::paint().

◆ setObserver()

void openmsx::SymbolManager::setObserver ( SymbolObserver observer_)
inline

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