20 std::optional<std::string> library;
22 std::optional<std::string> name;
24 std::optional<uint16_t> hint;
40 : library(library), name(name)
49 SymbolName(std::string library, std::string name, uint16_t hint)
50 : library(library), name(name), hint(hint)
60 : library(library), hint(ordinal)
67 bool LoadName(std::string& result)
const;
87 bool GetImportedName(std::string& result_library, std::string& result_name)
const;
92 bool GetImportedName(std::string& result_library, std::string& result_name, uint16_t& result_hint)
const;
113 std::ostream& operator<<(std::ostream& out,
const SymbolName& symbol);
123 std::optional<uint16_t> ordinal;
130 : by_ordinal(false), name(name), ordinal()
140 : by_ordinal(false), name(name), ordinal(hint)
148 : by_ordinal(true), name(internal_name), ordinal(ordinal)
152 bool IsExportedByOrdinal()
const;
157 bool LoadName(std::string& result)
const;
218 std::ostream& operator<<(std::ostream& out,
const ExportedSymbolName& symbol);
Represents a symbol to be exported from the module.
Definition symbol_name.h:119
bool operator<(const ExportedSymbolName &other) const
Compares two symbols for ordering.
Definition symbol_name.cc:236
bool operator!=(const ExportedSymbolName &other) const
Compares two symbols for inequality.
Definition symbol_name.cc:231
ExportedSymbolName(std::string name, uint16_t hint)
Creates a symbol exported by name, with a corresponding hint.
Definition symbol_name.h:139
bool operator<=(const ExportedSymbolName &other) const
Compares two symbols for ordering.
Definition symbol_name.cc:254
bool operator==(const ExportedSymbolName &other) const
Compares two symbols for equality.
Definition symbol_name.cc:226
bool operator>(const ExportedSymbolName &other) const
Compares two symbols for ordering.
Definition symbol_name.cc:249
bool GetExportedByName(std::string &result) const
For symbols exported by name, returns the name.
Definition symbol_name.cc:167
bool LoadName(std::string &result) const
Returns the name of the symbol.
Definition symbol_name.cc:148
ExportedSymbolName(std::string name)
Creates a symbol exported by name.
Definition symbol_name.h:129
ExportedSymbolName(uint16_t ordinal, std::string internal_name)
Creates a symbol exported by ordinal, with an associated internal name.
Definition symbol_name.h:147
bool GetExportedByOrdinal(uint16_t &result) const
For symbols exported by ordinal, returns the ordinal.
Definition symbol_name.cc:197
bool LoadOrdinalOrHint(uint16_t &result) const
Returns the hint or ordinal of the symbol.
Definition symbol_name.cc:154
bool operator>=(const ExportedSymbolName &other) const
Compares two symbols for ordering.
Definition symbol_name.cc:244
Represents an (imported or internal) symbol name, which can be more complex than a string.
Definition symbol_name.h:18
bool GetImportedOrdinal(std::string &result_library, uint16_t &result_ordinal) const
For symbols imported by ordinal, returns the library and ordinal.
Definition symbol_name.cc:92
bool operator!=(const SymbolName &other) const
Compares two symbols for inequality.
Definition symbol_name.cc:112
SymbolName(std::string library, uint16_t ordinal)
Creates a symbol imported via ordinal, from a library.
Definition symbol_name.h:59
SymbolName(std::string name)
Creates an internal symbol with a name.
Definition symbol_name.h:31
bool GetLocalName(std::string &result) const
For local symbols, returns the name.
Definition symbol_name.cc:45
bool LoadName(std::string &result) const
Retrieves the name of the symbol, if it has one.
Definition symbol_name.cc:6
SymbolName(std::string library, std::string name)
Creates a symbol imported via name, from a library.
Definition symbol_name.h:39
SymbolName(std::string library, std::string name, uint16_t hint)
Creates a symbol imported via name and a hint, from a library.
Definition symbol_name.h:49
bool LoadOrdinalOrHint(uint16_t &result) const
Retrieves the ordinal of symbols imported by ordinal, or the hint for imported symbols with a hint.
Definition symbol_name.cc:32
bool LoadLibraryName(std::string &result) const
Retrieves the name of the library, if it is imported.
Definition symbol_name.cc:19
bool GetImportedName(std::string &result_library, std::string &result_name) const
For symbols imported by name, returns the library and name.
Definition symbol_name.cc:60
bool operator==(const SymbolName &other) const
Compares two symbols for equality.
Definition symbol_name.cc:107