#ifndef XIV_EXD_EXD_H #define XIV_EXD_EXD_H #include #include #include #include "File.h" namespace xiv { namespace exd { class Exh; // Field type containing all the possible types in the data files using Field = std::variant< std::string, bool, int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, float, uint64_t >; struct ExdCacheEntry { std::shared_ptr file; uint32_t offset; }; // Data for a given language class Exd { public: // i_exh: the header // i_files: the multiple exd files Exd() {} Exd(std::shared_ptr i_exh, const std::vector>& i_files); ~Exd(); // Get a row by its id const std::vector get_row(uint32_t id); // Get all rows const std::map>& get_rows(); protected: // Data indexed by the ID of the row, the vector is field with the same order as exh.members std::map> _data; std::vector> _files; std::shared_ptr _exh; std::map< uint32_t, ExdCacheEntry > _idCache; }; } } #endif // XIV_EXD_EXD_H