Home | nevrax.com |
|
i18n.hGo to the documentation of this file.00001 00007 /* Copyright, 2000 Nevrax Ltd. 00008 * 00009 * This file is part of NEVRAX NEL. 00010 * NEVRAX NEL is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2, or (at your option) 00013 * any later version. 00014 00015 * NEVRAX NEL is distributed in the hope that it will be useful, but 00016 * WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * General Public License for more details. 00019 00020 * You should have received a copy of the GNU General Public License 00021 * along with NEVRAX NEL; see the file COPYING. If not, write to the 00022 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 00023 * MA 02111-1307, USA. 00024 */ 00025 00026 #ifndef NL_I18N_H 00027 #define NL_I18N_H 00028 00029 #include "nel/misc/types_nl.h" 00030 #include "nel/misc/debug.h" 00031 #include "nel/misc/file.h" 00032 00033 #include <string> 00034 #include <map> 00035 00036 namespace NLMISC { 00037 00038 00064 class CI18N 00065 { 00066 public: 00067 00071 static const std::vector<ucstring> &getLanguageNames(); 00072 00074 static void load (uint32 lid); 00075 00077 static std::string getCurrentLanguage (); 00078 00080 static const ucstring &get (const char *str); 00081 00083 static void setPath (const char* str); 00084 00085 private: 00086 00087 typedef std::map<std::string, ucstring>::iterator ItStrMap; 00088 typedef std::map<std::string, ucstring>::value_type ValueStrMap; 00089 00090 static std::map<std::string, ucstring> _StrMap; 00091 static bool _StrMapLoaded; 00092 00093 static std::string _Path; 00094 static std::string _FileName; 00095 static const char *_LanguageFiles[]; 00096 00097 static std::vector<ucstring> _LanguageNames; 00098 static bool _LanguagesNamesLoaded; 00099 00100 static sint32 _SelectedLanguage; 00101 00102 static ucchar eatChar (IStream &is); 00103 static void checkASCII7B (ucchar c); 00104 00105 static void createLanguageFile (uint32 lid); 00106 static void createLanguageEntry (const std::string &lval, const std::string &rval); 00107 00108 static void skipComment (IStream &is, int &line); 00109 static ucchar skipWS (IStream &is, int &line); 00110 }; 00111 00112 00113 } // NLMISC 00114 00115 00116 #endif // NL_I18N_H 00117 00118 /* End of i18n.h */ |