| OLD | NEW |
| 1 #ifndef DICTIONARY_H | 1 #ifndef DICTIONARY_H |
| 2 #define DICTIONARY_H | 2 #define DICTIONARY_H |
| 3 | 3 |
| 4 #include <map> | 4 #include <map> |
| 5 #include <string> | 5 #include <string> |
| 6 #include <utility> | 6 #include <utility> |
| 7 #include "Utils.h" |
| 7 | 8 |
| 8 class Dictionary | 9 class Dictionary |
| 9 { | 10 { |
| 10 friend class DictionaryTest; | 11 friend class DictionaryTest; |
| 11 | 12 |
| 12 public: | 13 public: |
| 13 static void Create(const std::wstring& locale); | 14 static void Create(const std::wstring& locale, std::wstring basePath = Locatio
n::locales_dir() ); |
| 14 static Dictionary* GetInstance(); | 15 static Dictionary* GetInstance(); |
| 15 std::wstring Lookup(const std::string& section, const std::string& key) const; | 16 std::wstring Lookup(const std::string& section, const std::string& key) const; |
| 16 | 17 |
| 17 private: | 18 private: |
| 18 static Dictionary* instance; | 19 static Dictionary* instance; |
| 19 | 20 |
| 20 typedef std::pair<std::string,std::string> KeyType; | 21 typedef std::pair<std::string,std::string> KeyType; |
| 21 typedef std::map<KeyType,std::wstring> DataType; | 22 typedef std::map<KeyType,std::wstring> DataType; |
| 22 DataType data; | 23 DataType data; |
| 23 | 24 |
| 24 Dictionary(const std::wstring& locale); | 25 Dictionary(const std::wstring& locale, std::wstring basePath); |
| 25 bool ReadDictionary(const std::wstring& basePath, const std::wstring& locale); | 26 bool ReadDictionary(const std::wstring& basePath, const std::wstring& locale); |
| 26 }; | 27 }; |
| 27 | 28 |
| 28 #endif | 29 #endif |
| OLD | NEW |