mirror of
https://github.com/jessicanataliagta/PSPRecomp
synced 2026-09-26 08:41:08 -04:00
37e5469cbd
initial release
32 lines
774 B
C++
32 lines
774 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <filesystem>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <unordered_map>
|
|
#include <vector>
|
|
|
|
namespace psprecomp {
|
|
|
|
struct NidSymbol {
|
|
std::string library;
|
|
std::uint32_t nid{};
|
|
std::string name;
|
|
};
|
|
|
|
class NidRegistry {
|
|
public:
|
|
NidRegistry();
|
|
void add(std::string library, std::uint32_t nid, std::string name);
|
|
void load_csv(const std::filesystem::path &path);
|
|
[[nodiscard]] std::optional<std::string> resolve(const std::string &library, std::uint32_t nid) const;
|
|
[[nodiscard]] std::vector<NidSymbol> all() const;
|
|
|
|
private:
|
|
[[nodiscard]] static std::string key(const std::string &library, std::uint32_t nid);
|
|
std::unordered_map<std::string, NidSymbol> symbols_;
|
|
};
|
|
|
|
} // namespace psprecomp
|