11 using dotnamecpp::assets::IAssetManager;
16 std::shared_ptr<IJsonSerializer> jsonSerializer,
17 std::string filename =
"customstrings.json");
27 [[nodiscard]] std::optional<std::string>
getPath(
const std::string &
id)
const override;
30 std::optional<std::string>
getCustomKey(
const std::string &
id,
31 const std::string &key)
const override;
34 const std::string &locale =
"en")
const override;
38 [[nodiscard]] std::optional<nlohmann::json> findById(
const std::string &
id)
const;
40 std::shared_ptr<IAssetManager> assetManager_;
41 std::shared_ptr<IJsonSerializer> jsonSerializer_;
42 std::string filename_;
45 mutable std::mutex cacheMutex_;
46 mutable std::optional<nlohmann::json> cachedData_;
CustomStringsLoader(std::shared_ptr< IAssetManager > assetManager, std::shared_ptr< IJsonSerializer > jsonSerializer, std::string filename="customstrings.json")
Definition CustomStringsLoader.cpp:6
CustomStringsLoader & operator=(CustomStringsLoader &&)=delete
std::optional< std::string > getLocalizedString(const std::string &id, const std::string &locale="en") const override
Get the Localized String object.
Definition CustomStringsLoader.cpp:103
Result< nlohmann::json, JsonError > load() const override
Load the custom strings JSON data.
Definition CustomStringsLoader.cpp:17
std::optional< std::string > getPath(const std::string &id) const override
Get the Path object.
Definition CustomStringsLoader.cpp:69
CustomStringsLoader(CustomStringsLoader &&)=delete
std::optional< std::string > getCustomKey(const std::string &id, const std::string &key) const override
Get the Custom Key object.
Definition CustomStringsLoader.cpp:86
CustomStringsLoader & operator=(const CustomStringsLoader &)=delete
~CustomStringsLoader() override=default
CustomStringsLoader(const CustomStringsLoader &)=delete
Interface for loading custom strings from JSON.
Definition ICustomStringsLoader.hpp:14
Definition UtilsError.hpp:93
Definition DirectoryManager.cpp:5