1#ifndef SYMBOL_MANAGER_HH
2#define SYMBOL_MANAGER_HH
18class CommandController;
46 [[nodiscard]]
static std::optional<Type>
parseType(std::string_view str);
64 assert(!observer || !observer_);
80 [[nodiscard]]
const auto&
getFiles()
const {
return files; }
81 [[nodiscard]] std::span<Symbol const * const>
lookupValue(uint16_t value);
89 [[nodiscard]]
static std::optional<unsigned>
isHexDigit(
char c);
90 [[nodiscard]]
static std::optional<uint16_t>
is4DigitHex(std::string_view s);
91 [[nodiscard]]
static std::optional<uint16_t>
parseValue(std::string_view str);
92 [[nodiscard]]
static std::optional<Symbol>
checkLabel(std::string_view label, uint16_t value);
93 [[nodiscard]]
static std::optional<Symbol>
checkLabelAndValue(std::string_view label, std::string_view value);
97 function_ref<std::optional<Symbol>(std::span<std::string_view>)> lineParser);
99 [[nodiscard]]
static SymbolFile loadNoICE(std::string_view filename, std::string_view buffer);
100 [[nodiscard]]
static SymbolFile loadHTC(std::string_view filename, std::string_view buffer);
101 [[nodiscard]]
static SymbolFile loadVASM(std::string_view filename, std::string_view buffer);
102 [[nodiscard]]
static SymbolFile loadASMSX(std::string_view filename, std::string_view buffer);
112 std::vector<SymbolFile> files;
const auto & getFiles() const
static std::optional< unsigned > isHexDigit(char c)
bool reloadFile(const std::string &filename, LoadEmpty loadEmpty, SymbolFile::Type type)
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)
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 loadSymbolFile(const std::string &filename, SymbolFile::Type type)
static SymbolFile loadGeneric(std::string_view filename, std::string_view buffer)
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, uint16_t value)
static SymbolFile loadASMSX(std::string_view filename, std::string_view buffer)
static std::optional< uint16_t > parseValue(std::string_view str)
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)
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
virtual void notifySymbolsChanged()=0
auto operator<=>(const Symbol &) const =default
Symbol(std::string n, uint16_t v)