Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/shared/Dictionary.h

Issue 10897028: Create a shared dictionary class for plugin and engine (Closed)
Patch Set: Created June 7, 2013, 12:42 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/shared/Dictionary.h
===================================================================
new file mode 100644
--- /dev/null
+++ b/src/shared/Dictionary.h
@@ -0,0 +1,28 @@
+#ifndef DICTIONARY_H
+#define DICTIONARY_H
+
+#include <map>
+#include <string>
+#include <utility>
+
+class Dictionary
+{
+ friend class DictionaryTest;
+
+public:
+ static void Create(const std::wstring& locale);
+ static Dictionary* GetInstance();
+ std::wstring Lookup(const std::string& section, const std::string& key) const;
+
+private:
+ static Dictionary* instance;
+
+ typedef std::pair<std::string,std::string> KeyType;
+ typedef std::map<KeyType,std::wstring> DataType;
+ DataType data;
+
+ Dictionary(const std::wstring& locale);
+ bool ReadDictionary(const std::wstring& basePath, const std::wstring& locale);
+};
+
+#endif

Powered by Google App Engine
This is Rietveld