1#ifndef SYMBOL_MANAGER_HH
2#define SYMBOL_MANAGER_HH
18class CommandController;
22 Symbol(std::string n, uint16_t v, std::optional<uint8_t> s1, std::optional<uint16_t> s2)
27 std::optional<uint8_t>
slot;
49 [[nodiscard]]
static std::optional<Type>
parseType(std::string_view str);
52 std::optional<uint8_t>
slot;
69 assert(!observer || !observer_);
85 [[nodiscard]]
const auto&
getFiles()
const {
return files; }
87 [[nodiscard]] std::span<Symbol const * const>
lookupValue(uint16_t value);
95 [[nodiscard]]
static std::optional<unsigned>
isHexDigit(
char c);
96 [[nodiscard]]
static std::optional<uint16_t>
is4DigitHex(std::string_view s);
98 [[nodiscard]]
static std::optional<T>
parseValue(std::string_view str);
99 [[nodiscard]]
static std::optional<Symbol>
checkLabel(std::string_view label, uint32_t value);
100 [[nodiscard]]
static std::optional<Symbol>
checkLabelAndValue(std::string_view label, std::string_view value);
105 function_ref<std::optional<Symbol>(std::span<std::string_view>)> lineParser);
107 [[nodiscard]]
static SymbolFile loadNoICE(std::string_view filename, std::string_view buffer);
108 [[nodiscard]]
static SymbolFile loadHTC(std::string_view filename, std::string_view buffer);
109 [[nodiscard]]
static SymbolFile loadVASM(std::string_view filename, std::string_view buffer);
110 [[nodiscard]]
static SymbolFile loadNoGmb(std::string_view filename, std::string_view buffer);
111 [[nodiscard]]
static SymbolFile loadASMSX(std::string_view filename, std::string_view buffer);
119 CommandController& commandController;
120 SymbolObserver* observer =
nullptr;
121 std::vector<SymbolFile> files;
const auto & getFiles() const
static std::optional< unsigned > isHexDigit(char c)
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 std::optional< Symbol > checkLabelSegmentAndValue(std::string_view label, std::string_view value)
static SymbolFile loadNoGmb(std::string_view filename, std::string_view buffer)
std::span< Symbol const *const > lookupValue(uint16_t value)
static SymbolFile::Type detectType(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 loadGeneric(std::string_view filename, std::string_view buffer)
static SymbolFile loadSymbolFile(const std::string &filename, SymbolFile::Type type, std::optional< uint8_t > slot={})
static SymbolFile loadVASM(std::string_view filename, std::string_view buffer)
static std::string getFileFilters()
static std::optional< uint16_t > is4DigitHex(std::string_view s)
void removeFile(std::string_view filename)
static std::optional< Symbol > checkLabel(std::string_view label, uint32_t value)
bool reloadFile(const std::string &filename, LoadEmpty loadEmpty, SymbolFile::Type type, std::optional< uint8_t > slot={})
static SymbolFile loadASMSX(std::string_view filename, std::string_view buffer)
std::optional< uint16_t > parseSymbolOrValue(std::string_view s) const
static SymbolFile loadLinkMap(std::string_view filename, std::string_view buffer)
static SymbolFile::Type getTypeForFilter(std::string_view filter)
SymbolFile * findFile(std::string_view filename)
static std::optional< T > parseValue(std::string_view str)
void setObserver(SymbolObserver *observer_)
static std::optional< Symbol > checkLabelAndValue(std::string_view label, std::string_view value)
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
This file implemented 3 utility functions:
static std::optional< Type > parseType(std::string_view str)
static zstring_view toString(Type type)
std::vector< Symbol > symbols
std::optional< uint8_t > slot
virtual void notifySymbolsChanged()=0
auto operator<=>(const Symbol &) const =default
std::optional< uint8_t > slot
Symbol(std::string n, uint16_t v, std::optional< uint8_t > s1, std::optional< uint16_t > s2)
std::optional< uint16_t > segment