HatchKeeper  0.90
The Free Open-Source Egg Incubation Software
HK_Language Class Reference

Allows The App To Show Different Languages. More...

#include <Language.h>

Public Member Functions

 HK_Language ()
 
 HK_Language (std::string Path)
 Constructor Opens the xml language file and reads it into two arrays. More...
 
int Count ()
 Returns The Number Of Strings Stored In The Arrays. More...
 
void Clear ()
 
int Errors ()
 Returns Error Code. More...
 
std::string GetLanguage ()
 Returns What The Translated Language Is. More...
 
std::string GetPath ()
 Returns The Path For The Language File. More...
 
void SetPath (std::string Path)
 Sets/Loads Path Opens the xml language file and reads it into two arrays. More...
 
std::string Translate (std::string Text)
 The Actual Translate Function This function checks Text against the base languages strings, if found it returns the translated value. If not found it returns the same string. More...
 

Private Member Functions

void Add (std::string Base, std::string Translate)
 Adds Values To The Arrays This function is used internally only. More...
 

Private Attributes

tinyxml2::XMLDocument doc
 
int Error = 0
 
std::string Language = "English"
 
std::string LangPath
 
std::vector< std::string > BaseLang
 
std::vector< std::string > Translated
 

Detailed Description

Allows The App To Show Different Languages.

Since
09/19/2021

Definition at line 23 of file Language.h.

Constructor & Destructor Documentation

◆ HK_Language() [1/2]

HK_Language::HK_Language ( )

Definition at line 11 of file HK_Language.cpp.

◆ HK_Language() [2/2]

HK_Language::HK_Language ( std::string  Path)

Constructor Opens the xml language file and reads it into two arrays.

Parameters
PathThe Path To The Language File

Definition at line 18 of file HK_Language.cpp.

Member Function Documentation

◆ Add()

void HK_Language::Add ( std::string  Base,
std::string  Translate 
)
private

Adds Values To The Arrays This function is used internally only.

Parameters
BaseThe String In The Base Language
TranslateThe String Translated To Another Language

Definition at line 63 of file HK_Language.cpp.

◆ Clear()

void HK_Language::Clear ( )

◆ Count()

int HK_Language::Count ( )

Returns The Number Of Strings Stored In The Arrays.

Definition at line 69 of file HK_Language.cpp.

◆ Errors()

int HK_Language::Errors ( )

Returns Error Code.

Definition at line 71 of file HK_Language.cpp.

◆ GetLanguage()

std::string HK_Language::GetLanguage ( )

Returns What The Translated Language Is.

Definition at line 73 of file HK_Language.cpp.

◆ GetPath()

std::string HK_Language::GetPath ( )

Returns The Path For The Language File.

Definition at line 75 of file HK_Language.cpp.

◆ SetPath()

void HK_Language::SetPath ( std::string  Path)

Sets/Loads Path Opens the xml language file and reads it into two arrays.

Parameters
PathThe Path To The Language File

Definition at line 25 of file HK_Language.cpp.

◆ Translate()

std::string HK_Language::Translate ( std::string  Text)

The Actual Translate Function This function checks Text against the base languages strings, if found it returns the translated value. If not found it returns the same string.

Parameters
TextThe Text To Be Translated

Definition at line 83 of file HK_Language.cpp.

Member Data Documentation

◆ BaseLang

std::vector<std::string> HK_Language::BaseLang
private

Definition at line 29 of file Language.h.

◆ doc

tinyxml2::XMLDocument HK_Language::doc
private

Definition at line 25 of file Language.h.

◆ Error

int HK_Language::Error = 0
private

Definition at line 26 of file Language.h.

◆ LangPath

std::string HK_Language::LangPath
private

Definition at line 28 of file Language.h.

◆ Language

std::string HK_Language::Language = "English"
private

Definition at line 27 of file Language.h.

◆ Translated

std::vector<std::string> HK_Language::Translated
private

Definition at line 30 of file Language.h.


The documentation for this class was generated from the following files: