#pragma once #include #include #include #include class VFSInterface; // Serial/id doesn't need including here since we look up by it. struct GameDBInfo { std::string title; std::string foreignTitle; uint32_t crc; uint64_t size; }; class GameDB { public: bool LoadFromVFS(VFSInterface &vfs, const char *filename); bool GetGameInfos(std::string_view id, std::vector *infos); private: size_t GetColumnIndex(std::string_view name) const; struct Line { // The exact same ISO can have multiple serials. std::vector serials; // The below fields should match GameDBInfo. std::string_view title; std::string_view foreignTitle; std::string_view size; std::string_view crc; }; std::string contents_; std::vector lines_; std::vector columns_; }; extern GameDB g_gameDB;