5#include <unordered_map>
9template <
typename Type>
20 const std::string&
tongue ()
const;
33 const std::string& filename,
34 const std::string&
tongue =
"");
43 const std::string& key,
44 const std::string& text);
48 void remove (
const std::string& key);
52 std::string&
get (
const std::string& entry);
56 const std::string&
get (
const std::string& entry)
const;
60 bool has (
const std::string& entry)
const;
62 std::string m_activeTongue =
"english";
store text accessible with a string key, with option to load and store text for a given tongue,...
Definition TextContainer.h:15
void setTongue(const std::string &tongue)
set tongue used
Definition TextContainer.cpp:14
bool loadFromFile(const std::string &filename, const std::string &tongue="")
load texts from a filename for this given tongue. By default it uses active tongue.
Definition TextContainer.cpp:37
void remove(const std::string &key)
remove text from the container for the current tongue
Definition TextContainer.cpp:75
void add(const std::string &key, const std::string &text)
add a text with a given key to the container for the current tongue
Definition TextContainer.cpp:67
bool reload(const std::string &tongue="")
reload all texts for the active tongue
Definition TextContainer.cpp:20
bool has(const std::string &entry) const
check that entry is stored
Definition TextContainer.cpp:97
std::string & get(const std::string &entry)
get mutable text entry for the current tongue
Definition TextContainer.cpp:81
void saveInFile(const std::string &filename)
save texts of the current tongue
Definition TextContainer.cpp:61
const std::string & tongue() const
get current tongue used
Definition TextContainer.cpp:8
Definition Interpolation.h:16
std::unordered_map< std::string, Type > LookupTable
Definition TextContainer.h:10