22
33#include " REX/BASE.h"
44
5- #include " REL/Version.h"
6-
75#include " REX/REX/MemoryMap.h"
86#include " REX/REX/Singleton.h"
97
@@ -22,42 +20,41 @@ namespace REL
2220 // OBSE,
2321 };
2422
25- enum class Format : std::uint32_t
23+ enum class Format : std::int32_t
2624 {
27- None = static_cast <std::uint32_t >(- 1 ),
25+ None = std::numeric_limits <std::int32_t >::max( ),
2826 V0 = 0 ,
2927 V1 = 1 ,
3028 V2 = 2 ,
29+ V5 = 5
3130 };
3231
3332 IDDB ();
3433
35- [[nodiscard]] std::size_t id2offset (std::uint64_t a_id) const ;
34+ std::uint64_t offset (std::uint64_t a_id) const ;
3635
3736 private:
38- class istream_t ;
39- class header_t ;
37+ class STREAM ;
38+ class HEADER_V2 ;
39+ class HEADER_V5 ;
4040
41- struct mapping_t
41+ struct MAPPING
4242 {
4343 std::uint64_t id;
4444 std::uint64_t offset;
4545 };
4646
47- void load ();
4847 void load_v0 ();
49- void unpack_file (istream_t & a_in, const header_t & a_header);
50-
51- protected:
52- friend class Offset2ID ;
53-
54- [[nodiscard]] std::span<mapping_t > get_id2offset () const noexcept { return m_id2offset; }
48+ void load_v2 (STREAM& a_stream);
49+ void load_v5 (STREAM& a_stream);
50+ void unpack_file (STREAM& a_stream, const HEADER_V2& a_header);
5551
5652 private:
57- Loader m_loader{ Loader::None };
58- Format m_format{ Format::None };
59- std::filesystem::path m_path;
60- REX::MemoryMap m_mmap;
61- std::span<mapping_t > m_id2offset;
53+ std::filesystem::path m_path;
54+ Loader m_loader{ Loader::None };
55+ Format m_format{ Format::None };
56+ REX::MemoryMap m_mmap;
57+ std::span<MAPPING> m_v0;
58+ std::span<std::uint32_t > m_v5;
6259 };
6360}
0 commit comments