123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #ifndef LOTRO_DAT_LIBRARY_DATLOCALEMANAGER_H
- #define LOTRO_DAT_LIBRARY_DATLOCALEMANAGER_H
- #include <memory>
- #include <map>
- #include <DatOperationResult.h>
- #include <set>
- extern "C++" {
- namespace LOTRO_DAT {
- class DatFile;
- class SubFile;
- class DatLocaleManager {
- public:
- enum LOCALE {
- PATCHED,
- ORIGINAL
- };
- DatLocaleManager() = delete;
- DatLocaleManager(const DatLocaleManager &other) = delete;
- DatLocaleManager& operator=(const DatLocaleManager &other) = delete;
- ~DatLocaleManager() = default;
- explicit DatLocaleManager(DatFile *datFilePtr);
- DatOperationResult<> Init();
- DatOperationResult<> SetLocale(LOCALE locale);
- DatOperationResult<> DeInit();
- LOCALE GetCurrentLocale();
- void UpdateLocaleFile(LOCALE locale, const SubFile& file);
- DatOperationResult<SubFile> GetLocaleFile(long long file_id, LOCALE locale);
- private:
- std::map<long long, SubFile>& GetLocaleDictReference(LOCALE locale);
- private:
- DatFile *dat;
- std::map<long long, SubFile> orig_dict_;
- std::map<long long, SubFile> patch_dict_;
- std::set<long long> inactive_categories;
- LOCALE current_locale_;
- };
- }
- };
- #endif
|