29#include "../io/filesystem.hpp"
51 void addToLanguage(
const std::map<std::string,std::string>& _langstrings);
52 std::string
getKey(
const std::string& sMessage)
const;
53 std::string
get(
const std::string& sMessage,
const std::vector<std::string>& vTokens)
const;
63 std::string
get(
const std::string& sMessage)
const
65 std::vector<std::string> vTokens;
66 return get(sMessage, vTokens);
78 std::string
get(
const std::string& sMessage,
const std::string& sTok1)
const
80 std::vector<std::string> vTokens;
81 vTokens.push_back(sTok1);
82 return get(sMessage, vTokens);
95 std::string
get(
const std::string& sMessage,
const std::string& sTok1,
const std::string& sTok2)
const
97 std::vector<std::string> vTokens;
98 vTokens.push_back(sTok1);
99 vTokens.push_back(sTok2);
100 return get(sMessage, vTokens);
114 std::string
get(
const std::string& sMessage,
const std::string& sTok1,
const std::string& sTok2,
const std::string& sTok3)
const
116 std::vector<std::string> vTokens;
117 vTokens.push_back(sTok1);
118 vTokens.push_back(sTok2);
119 vTokens.push_back(sTok3);
120 return get(sMessage, vTokens);
135 std::string
get(
const std::string& sMessage,
const std::string& sTok1,
const std::string& sTok2,
const std::string& sTok3,
const std::string& sTok4)
const
137 std::vector<std::string> vTokens;
138 vTokens.push_back(sTok1);
139 vTokens.push_back(sTok2);
140 vTokens.push_back(sTok3);
141 vTokens.push_back(sTok4);
142 return get(sMessage, vTokens);
158 std::string
get(
const std::string& sMessage,
const std::string& sTok1,
const std::string& sTok2,
const std::string& sTok3,
const std::string& sTok4,
const std::string& sTok5)
const
160 std::vector<std::string> vTokens;
161 vTokens.push_back(sTok1);
162 vTokens.push_back(sTok2);
163 vTokens.push_back(sTok3);
164 vTokens.push_back(sTok4);
165 vTokens.push_back(sTok5);
166 return get(sMessage, vTokens);
183 std::string
get(
const std::string& sMessage,
const std::string& sTok1,
const std::string& sTok2,
const std::string& sTok3,
const std::string& sTok4,
const std::string& sTok5,
const std::string& sTok6)
const
185 std::vector<std::string> vTokens;
186 vTokens.push_back(sTok1);
187 vTokens.push_back(sTok2);
188 vTokens.push_back(sTok3);
189 vTokens.push_back(sTok4);
190 vTokens.push_back(sTok5);
191 vTokens.push_back(sTok6);
192 return get(sMessage, vTokens);
195 std::vector<std::string>
getList(
const std::string& sMessageScheme)
const;
197 inline std::string
YES()
const
201 inline std::string
NO()
const
This class implements the basic input/ output file system and provides functionalities to work with f...
This class handles the internal language system and returns the language strings of the selected lang...
void addToLanguage(const std::map< std::string, std::string > &_langstrings)
This member function adds the contents of the passed language file into the internal map.
Language()
Contructor of the language class.
std::string get(const std::string &sMessage, const std::string &sTok1, const std::string &sTok2, const std::string &sTok3, const std::string &sTok4, const std::string &sTok5) const
Convenience wrapper for a defined number of tokens.
std::string get(const std::string &sMessage, const std::string &sTok1, const std::string &sTok2, const std::string &sTok3, const std::string &sTok4) const
Convenience wrapper for a defined number of tokens.
void loadStrings(bool bloadUserFiles=true)
This member function loads the language files to the internal map and replaces the named tokens with ...
std::string get(const std::string &sMessage, const std::string &sTok1, const std::string &sTok2, const std::string &sTok3) const
Convenience wrapper for a defined number of tokens.
std::string get(const std::string &sMessage, const std::string &sTok1, const std::string &sTok2) const
Convenience wrapper for a defined number of tokens.
std::string getKey(const std::string &sMessage) const
This member function searches the internal language map for an identifier, which starts similar with ...
void loadAndInsert(const std::string &sLanguageFileName)
This private member function is a simple helper for Language::loadStrings().
std::vector< std::string > getList(const std::string &sMessageScheme) const
This member function returns a vector of language strings matching to the passed identifier containin...
std::string get(const std::string &sMessage, const std::string &sTok1) const
Convenience wrapper for a defined number of tokens.
std::map< std::string, std::string > mLangStrings
std::string get(const std::string &sMessage, const std::string &sTok1, const std::string &sTok2, const std::string &sTok3, const std::string &sTok4, const std::string &sTok5, const std::string &sTok6) const
Convenience wrapper for a defined number of tokens.
std::string get(const std::string &sMessage, const std::vector< std::string > &vTokens) const
This member function returns the language string for the passed language identifier and replaces all ...
std::map< std::string, std::string > getLangFileContent(const std::string &sFile) const
This private member function decodes a single language file into a map and returns it.
std::string get(const std::string &sMessage) const
Convenience wrapper for a defined number of tokens.