HatchKeeper  0.90
The Free Open-Source Egg Incubation Software
Language.h
Go to the documentation of this file.
1 /*******************************************************************/
9 #ifndef _LANGUAGE_H__
10 #define _LANGUAGE_H__
11 
12 #include <tinyxml2.h>
13 #include <string>
14 #include <vector>
15 
23 class HK_Language {
24 private:
25  tinyxml2::XMLDocument doc;
26  int Error = 0;
27  std::string Language = "English";
28  std::string LangPath;
29  std::vector<std::string> BaseLang;
30  std::vector<std::string> Translated;
31  void Add(std::string Base, std::string Translate);
32 public:
33  HK_Language();
34  HK_Language(std::string Path);
35  int Count();
36  void Clear();
37  int Errors();
38  std::string GetLanguage();
39  std::string GetPath();
40 
41  void SetPath(std::string Path);
42 
43  std::string Translate(std::string Text);
44 };
45 
46 #endif
Allows The App To Show Different Languages.
Definition: Language.h:23
int Errors()
Returns Error Code.
Definition: HK_Language.cpp:71
void Clear()
std::vector< std::string > BaseLang
Definition: Language.h:29
tinyxml2::XMLDocument doc
Definition: Language.h:25
std::vector< std::string > Translated
Definition: Language.h:30
std::string GetLanguage()
Returns What The Translated Language Is.
Definition: HK_Language.cpp:73
std::string LangPath
Definition: Language.h:28
void Add(std::string Base, std::string Translate)
Adds Values To The Arrays This function is used internally only.
Definition: HK_Language.cpp:63
int Error
Definition: Language.h:26
int Count()
Returns The Number Of Strings Stored In The Arrays.
Definition: HK_Language.cpp:69
void SetPath(std::string Path)
Sets/Loads Path Opens the xml language file and reads it into two arrays.
Definition: HK_Language.cpp:25
std::string GetPath()
Returns The Path For The Language File.
Definition: HK_Language.cpp:75
std::string Translate(std::string Text)
The Actual Translate Function This function checks Text against the base languages strings,...
Definition: HK_Language.cpp:83
std::string Language
Definition: Language.h:27