Changeset View
Changeset View
Standalone View
Standalone View
plugins/astyle/3rdparty/libastyle/ASLocalizer.h
1 | // ASLocalizer.h | 1 | // ASLocalizer.h | ||
---|---|---|---|---|---|
2 | // Copyright (c) 2016 by Jim Pattee <jimp03@email.com>. | 2 | // Copyright (c) 2018 by Jim Pattee <jimp03@email.com>. | ||
3 | // This code is licensed under the MIT License. | 3 | // This code is licensed under the MIT License. | ||
4 | // License.txt describes the conditions under which this software may be distributed. | 4 | // License.md describes the conditions under which this software may be distributed. | ||
5 | 5 | | |||
6 | 6 | | |||
7 | #ifndef ASLOCALIZER_H | 7 | #ifndef ASLOCALIZER_H | ||
8 | #define ASLOCALIZER_H | 8 | #define ASLOCALIZER_H | ||
9 | 9 | | |||
10 | #include <string> | 10 | #include <string> | ||
11 | #include <vector> | 11 | #include <vector> | ||
12 | 12 | | |||
13 | // library builds do not need ASLocalizer | ||||
14 | #ifdef ASTYLE_JNI | ||||
15 | #ifndef ASTYLE_LIB // ASTYLE_LIB must be defined for ASTYLE_JNI | ||||
16 | #define ASTYLE_LIB | ||||
17 | #endif | ||||
18 | #endif // ASTYLE_JNI | ||||
19 | | ||||
13 | namespace astyle { | 20 | namespace astyle { | ||
14 | 21 | | |||
15 | using namespace std; | 22 | using namespace std; | ||
16 | 23 | | |||
17 | #ifndef ASTYLE_LIB | 24 | #ifndef ASTYLE_LIB | ||
18 | 25 | | |||
19 | //----------------------------------------------------------------------------- | 26 | //----------------------------------------------------------------------------- | ||
20 | // ASLocalizer class for console build. | 27 | // ASLocalizer class for console build. | ||
Show All 37 Lines | |||||
58 | // The language vector is built by the language sub classes. | 65 | // The language vector is built by the language sub classes. | ||
59 | // NOTE: This class must have virtual methods for typeid() to work. | 66 | // NOTE: This class must have virtual methods for typeid() to work. | ||
60 | // typeid() is used by AStyleTestI18n_Localizer.cpp. | 67 | // typeid() is used by AStyleTestI18n_Localizer.cpp. | ||
61 | { | 68 | { | ||
62 | public: | 69 | public: | ||
63 | Translation() {} | 70 | Translation() {} | ||
64 | virtual ~Translation() {} | 71 | virtual ~Translation() {} | ||
65 | string convertToMultiByte(const wstring& wideStr) const; | 72 | string convertToMultiByte(const wstring& wideStr) const; | ||
73 | string getTranslationString(size_t i) const; | ||||
66 | size_t getTranslationVectorSize() const; | 74 | size_t getTranslationVectorSize() const; | ||
67 | bool getWideTranslation(const string& stringIn, wstring& wideOut) const; | 75 | bool getWideTranslation(const string& stringIn, wstring& wideOut) const; | ||
68 | string& translate(const string& stringIn) const; | 76 | string& translate(const string& stringIn) const; | ||
69 | 77 | | |||
70 | protected: | 78 | protected: | ||
71 | void addPair(const string& english, const wstring& translated); | 79 | void addPair(const string& english, const wstring& translated); | ||
72 | // variables | 80 | // variables | ||
73 | vector<pair<string, wstring> > m_translation; // translation vector | 81 | vector<pair<string, wstring> > m_translation; // translation vector | ||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |