Etterna 0.74.4
Loading...
Searching...
No Matches
LocalizedString.h
1#ifndef LocalizedString_H
2#define LocalizedString_H
3
5{
6 public:
7 virtual ~ILocalizedStringImpl() = default;
8 virtual void Load(const std::string& sGroup, const std::string& sName) = 0;
9 [[nodiscard]] virtual auto GetLocalized() const -> const std::string& = 0;
10};
13{
14 public:
15 LocalizedString(const std::string& sGroup = "",
16 const std::string& sName = "");
17 LocalizedString(LocalizedString const& other);
19 void Load(const std::string& sGroup, const std::string& sName);
20 operator const std::string &() const { return GetValue(); }
21 [[nodiscard]] auto GetValue() const -> const std::string&;
22
23 using MakeLocalizer = ILocalizedStringImpl* (*)();
24 static void RegisterLocalizer(MakeLocalizer pFunc);
25
26 private:
27 void CreateImpl();
28 std::string m_sGroup, m_sName;
29 ILocalizedStringImpl* m_pImpl;
30 // Swallow up warnings. If they must be used, define them.
31 auto operator=(const LocalizedString& rhs) -> LocalizedString& = delete;
32};
33
34#endif
Definition LocalizedString.h:5
Get a String based on the user's natural language.
Definition LocalizedString.h:13