DotNameLib
Loading...
Searching...
No Matches
ICustomStringsLoader.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <nlohmann/json.hpp>
5#include <optional>
6#include <string>
7
8namespace dotnamecpp::utils {
9
15 public:
16 virtual ~ICustomStringsLoader() = default;
17
23 [[nodiscard]]
25
32 [[nodiscard]]
33 virtual std::optional<std::string> getPath(const std::string &id) const = 0;
34
42 [[nodiscard]]
43 virtual std::optional<std::string> getCustomKey(const std::string &id,
44 const std::string &key) const = 0;
52 [[nodiscard]]
53 virtual std::optional<std::string>
54 getLocalizedString(const std::string &id, const std::string &locale = "en") const = 0;
55 };
56} // namespace dotnamecpp::utils
Interface for loading custom strings from JSON.
Definition ICustomStringsLoader.hpp:14
virtual std::optional< std::string > getPath(const std::string &id) const =0
Get the Path object.
virtual std::optional< std::string > getLocalizedString(const std::string &id, const std::string &locale="en") const =0
Get the Localized String object.
virtual std::optional< std::string > getCustomKey(const std::string &id, const std::string &key) const =0
Get the Custom Key object.
virtual Result< nlohmann::json, JsonError > load() const =0
Load the custom strings JSON data.
Definition UtilsError.hpp:93
Definition DirectoryManager.cpp:5