1 /* 2 * IceWM - C++ wrapper for locale/unicode conversion 3 * Copyright (C) 2001 The Authors of IceWM 4 * 5 * Release under terms of the GNU Library General Public License 6 */ 7 8 #ifndef YLOCALE_H 9 #define YLOCALE_H 10 11 #include <stddef.h> 12 13 class YLocale { 14 public: 15 YLocale(const char* localeName = ""); 16 ~YLocale(); 17 18 static const char* getLocaleName(); 19 static int getRating(const char* localeStr); RTL()20 static bool RTL() { return instance->rightToLeft; } UTF8()21 static bool UTF8() { return instance->codesetUTF8; } 22 23 #ifdef CONFIG_I18N 24 static char* localeString(const wchar_t* uStr, size_t uLen, size_t& lLen); 25 static wchar_t* unicodeString(const char* lStr, size_t lLen, size_t& uLen); 26 #else 27 static wchar_t* wideCharString(const char* str, size_t len, size_t& out); 28 #endif 29 static char* narrowString(const wchar_t* uStr, size_t uLen, size_t& lLen); 30 31 private: 32 class YConverter* converter; 33 bool rightToLeft; 34 bool codesetUTF8; 35 void getDirection(); 36 37 static YLocale* instance; 38 }; 39 40 #endif 41 42 // vim: set sw=4 ts=4 et: 43