00001
00002
00003
00004
00005
00006
00007 #ifndef LANGMAP_H
00008 #define LANGMAP_H
00009
00010 #include <string>
00011 #include <map>
00012 #include <set>
00013
00014 namespace srchilite {
00015
00029 class LangMap {
00030 typedef std::map<std::string, std::string> Map;
00031
00032 Map langmap;
00033
00035 bool isOpen;
00036
00037 const std::string path, filename;
00038
00039 public:
00046 LangMap(const std::string &path, const std::string &filename);
00047
00053 LangMap(const std::string &filename);
00054
00055 ~LangMap();
00056
00057 typedef Map::const_iterator const_iterator;
00058
00059 const_iterator begin() {
00060 return langmap.begin();
00061 }
00062
00063 const_iterator end() {
00064 return langmap.end();
00065 }
00066
00071 void print();
00072
00079 void open();
00080
00092 const std::string getFileName(const std::string &lang) {
00093 return langmap[lang];
00094 }
00095
00107 const std::string getMappedFileName(const std::string &lang);
00108
00135 const std::string getMappedFileNameFromFileName(const std::string &fileName);
00136
00142 std::set<std::string> getLangNames() const;
00143
00149 std::set<std::string> getMappedFileNames() const;
00150
00151 };
00152
00153 }
00154
00155 #endif