Etterna
0.74.4
Loading...
Searching...
No Matches
src
Etterna
Models
Misc
LocalizedString.h
1
#ifndef LocalizedString_H
2
#define LocalizedString_H
3
4
class
ILocalizedStringImpl
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
};
12
class
LocalizedString
13
{
14
public
:
15
LocalizedString
(
const
std::string& sGroup =
""
,
16
const
std::string& sName =
""
);
17
LocalizedString
(
LocalizedString
const
& other);
18
~LocalizedString
();
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
ILocalizedStringImpl
Definition
LocalizedString.h:5
LocalizedString
Get a String based on the user's natural language.
Definition
LocalizedString.h:13
Generated by
1.9.8