From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- docs/doxygen/nel/classNLMISC_1_1CI18N.html | 820 +++++++++++++++++++++++++++++ 1 file changed, 820 insertions(+) create mode 100644 docs/doxygen/nel/classNLMISC_1_1CI18N.html (limited to 'docs/doxygen/nel/classNLMISC_1_1CI18N.html') diff --git a/docs/doxygen/nel/classNLMISC_1_1CI18N.html b/docs/doxygen/nel/classNLMISC_1_1CI18N.html new file mode 100644 index 00000000..384161be --- /dev/null +++ b/docs/doxygen/nel/classNLMISC_1_1CI18N.html @@ -0,0 +1,820 @@ + + + + nevrax.org : docs + + + + + + + + + + + + + + +
# Home   # nevrax.com   
+ + + + +
Nevrax
+ + + + + + + + + + +
+ + +
+ Nevrax.org
+ + + + + + + +
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
+
+ + +
+ + +
+Docs + +
+  + + + + + +
Documentation 
+ +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  
+

NLMISC::CI18N Class Reference

Class for the internationalisation. +More... +

+#include <i18n.h> +

+List of all members. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Static Public Methods

const std::vector< ucstring > & getLanguageNames ()
 Return a vector with all language available. The vector contains the name of the language. The index in the vector is used in load() function
+Warning:
+you *must* call this function before calling load().
More...


void load (uint32 lid)
 Load a language file depending of the language. More...

std::string getCurrentLanguage ()
 Returns the name of the language in english (french, english...). More...

const ucstringget (const char *str)
 Find a string in the selected language and return his association. More...

void setPath (const char *str)
 Temporary, we don't have file system for now, so we do a tricky cheat. there s not check so be careful! More...


Private Types

typedef std::map< std::string,
+ ucstring >::iterator 
ItStrMap
typedef std::map< std::string,
+ ucstring >::value_type 
ValueStrMap

Static Private Methods

ucchar eatChar (IStream &is)
void checkASCII7B (ucchar c)
void createLanguageFile (uint32 lid)
void createLanguageEntry (const std::string &lval, const std::string &rval)
void skipComment (IStream &is, int &line)
ucchar skipWS (IStream &is, int &line)

Static Private Attributes

std::map< std::string, ucstring_StrMap
bool _StrMapLoaded = false
std::string _Path = ""
std::string _FileName = ""
const char * _LanguageFiles [] = { "english", "french" }
std::vector< ucstring_LanguageNames
bool _LanguagesNamesLoaded = false
sint32 _SelectedLanguage = -1
+


Detailed Description

+Class for the internationalisation. +

+It's a singleton pattern. +

+This class provide an easy way to localise all string. First you have to get all available language with getLanguageNames(). If you already know the number of the language (that is the index in the vector returns by getLanguagesNames()), you can load the language file with load(). Now, you can get a localised string with his association with get(). +

+

        // get all language names (you must call this before calling load())
+        CI18N::getLanguageNames ();
+        // load the language 1 (french)
+        CI18N::load (1);
+        // display "Salut" that is the "hi" string in the selected language (french).
+        nlinfo (CI18N::get("hi").c_str ());
+        // display "rms est un master", the french version of the string
+        nlinfo (CI18N::get("%s is a master").c_str (), "mrs");
+ *
+
+

+If the string doesn't exist, it will be automatically added in all language files with a <Not Translated> mention. If the language file doesn't exist, it'll be automatically create. +

+

+Author:
+Vianney Lecroart , Nevrax France
+Date:
+2000
+

+ +

+Definition at line 64 of file i18n.h.


Member Typedef Documentation

+

+ + + + +
+ + +
typedef std::map<std::string, ucstring>::iterator NLMISC::CI18N::ItStrMap [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 87 of file i18n.h. +

+Referenced by get.

+

+ + + + +
+ + +
typedef std::map<std::string, ucstring>::value_type NLMISC::CI18N::ValueStrMap [private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 88 of file i18n.h. +

+Referenced by get, and load.

+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + +
void NLMISC::CI18N::checkASCII7B ucchar   c [static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 107 of file i18n.cpp. +

+References nlerror, and ucchar. +

+Referenced by load.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLMISC::CI18N::createLanguageEntry const std::string &   lval,
const std::string &   rval
[static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 175 of file i18n.cpp. +

+References _LanguageFiles, _Path, nlerror, and nlverify. +

+Referenced by get.

+

+ + + + +
+ + + + + + + + + + +
void NLMISC::CI18N::createLanguageFile uint32   lid [static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 161 of file i18n.cpp. +

+References _LanguageFiles, _Path, nlassert, and nlverify. +

+Referenced by getLanguageNames, and load.

+

+ + + + +
+ + + + + + + + + + +
ucchar NLMISC::CI18N::eatChar IStream  is [static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 48 of file i18n.cpp. +

+References nlerror, and ucchar. +

+Referenced by getLanguageNames, load, skipComment, and skipWS.

+

+ + + + +
+ + + + + + + + + + +
const ucstring & NLMISC::CI18N::get const char *   str [static]
+
+ + + + + +
+   + + +

+Find a string in the selected language and return his association. +

+ +

+Definition at line 362 of file i18n.cpp. +

+References _FileName, _StrMap, _StrMapLoaded, createLanguageEntry, ItStrMap, nlassert, nlwarning, and ValueStrMap.

+

+ + + + +
+ + + + + + + + + +
string NLMISC::CI18N::getCurrentLanguage   [static]
+
+ + + + + +
+   + + +

+Returns the name of the language in english (french, english...). +

+ +

+Definition at line 391 of file i18n.cpp. +

+References _LanguageFiles, and _SelectedLanguage.

+

+ + + + +
+ + + + + + + + + +
const vector< ucstring > & NLMISC::CI18N::getLanguageNames   [static]
+
+ + + + + +
+   + + +

+Return a vector with all language available. The vector contains the name of the language. The index in the vector is used in load() function

+Warning:
+you *must* call this function before calling load().
+

+ +

+Definition at line 399 of file i18n.cpp. +

+References _LanguageFiles, _LanguageNames, _LanguagesNamesLoaded, _Path, createLanguageFile, eatChar, nldebug, nlerror, nlwarning, skipWS, and ucchar.

+

+ + + + +
+ + + + + + + + + + +
void NLMISC::CI18N::load uint32   lid [static]
+
+ + + + + +
+   + + +

+Load a language file depending of the language. +

+ +

+Definition at line 226 of file i18n.cpp. +

+References _FileName, _LanguageFiles, _LanguageNames, _LanguagesNamesLoaded, _Path, _SelectedLanguage, _StrMap, _StrMapLoaded, checkASCII7B, createLanguageFile, eatChar, nlassert, nldebug, nlerror, nlwarning, skipWS, ucchar, and ValueStrMap.

+

+ + + + +
+ + + + + + + + + + +
void NLMISC::CI18N::setPath const char *   str [static]
+
+ + + + + +
+   + + +

+Temporary, we don't have file system for now, so we do a tricky cheat. there s not check so be careful! +

+ +

+Definition at line 221 of file i18n.cpp. +

+References _Path.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLMISC::CI18N::skipComment IStream  is,
int &   line
[static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 116 of file i18n.cpp. +

+References eatChar, and ucchar. +

+Referenced by skipWS.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
ucchar NLMISC::CI18N::skipWS IStream  is,
int &   line
[static, private]
+
+ + + + + +
+   + + +

+ +

+Definition at line 143 of file i18n.cpp. +

+References eatChar, skipComment, and ucchar. +

+Referenced by getLanguageNames, and load.

+


Member Data Documentation

+

+ + + + +
+ + +
string NLMISC::CI18N::_FileName = "" [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 42 of file i18n.cpp. +

+Referenced by get, and load.

+

+ + + + +
+ + +
const char * NLMISC::CI18N::_LanguageFiles = { "english", "french" } [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 37 of file i18n.cpp. +

+Referenced by createLanguageEntry, createLanguageFile, getCurrentLanguage, getLanguageNames, and load.

+

+ + + + +
+ + +
vector< ucstring > NLMISC::CI18N::_LanguageNames [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 44 of file i18n.cpp. +

+Referenced by getLanguageNames, and load.

+

+ + + + +
+ + +
bool NLMISC::CI18N::_LanguagesNamesLoaded = false [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 45 of file i18n.cpp. +

+Referenced by getLanguageNames, and load.

+

+ + + + +
+ + +
string NLMISC::CI18N::_Path = "" [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 41 of file i18n.cpp. +

+Referenced by createLanguageEntry, createLanguageFile, getLanguageNames, load, and setPath.

+

+ + + + +
+ + +
sint32 NLMISC::CI18N::_SelectedLanguage = -1 [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 46 of file i18n.cpp. +

+Referenced by getCurrentLanguage, and load.

+

+ + + + +
+ + +
map< string, ucstring > NLMISC::CI18N::_StrMap [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 39 of file i18n.cpp. +

+Referenced by get, and load.

+

+ + + + +
+ + +
bool NLMISC::CI18N::_StrMapLoaded = false [static, private] +
+
+ + + + + +
+   + + +

+ +

+Definition at line 40 of file i18n.cpp. +

+Referenced by get, and load.

+


The documentation for this class was generated from the following files: + + + +
                                                                                                                                                                    +
+ + -- cgit v1.2.1