IWORKLanguageManager.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  * This file is part of the libe-book project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  */
9 
10 #ifndef IWORKLANGUAGEMANAGER_H_INCLUDED
11 #define IWORKLANGUAGEMANAGER_H_INCLUDED
12 
13 #include <string>
14 
15 #include <boost/shared_ptr.hpp>
16 #include <boost/unordered_map.hpp>
17 #include <boost/unordered_set.hpp>
18 
19 #include <librevenge/librevenge.h>
20 
21 namespace libetonyek
22 {
23 
25 {
26  struct LangDB;
27 
28 public:
30 
31  const std::string addTag(const std::string &tag);
32  const std::string addLanguage(const std::string &lang);
33  const std::string addLocale(const std::string &locale);
34 
35  const std::string getLanguage(const std::string &tag) const;
36 
37  void writeProperties(const std::string &tag, librevenge::RVNGPropertyList &props) const;
38 
39 private:
40  const LangDB &getLangDB() const;
41 
42  void addProperties(const std::string &tag);
43 
44 private:
45  boost::unordered_map<std::string, std::string> m_tagMap;
46  boost::unordered_set<std::string> m_invalidTags;
47  boost::unordered_map<std::string, std::string> m_langMap;
48  boost::unordered_set<std::string> m_invalidLangs;
49  boost::unordered_map<std::string, std::string> m_localeMap;
50  boost::unordered_set<std::string> m_invalidLocales;
51  boost::unordered_map<std::string, librevenge::RVNGPropertyList> m_propsMap;
52  mutable boost::shared_ptr<LangDB> m_langDB;
53 };
54 
55 }
56 
57 #endif // IWORKLANGUAGEMANAGER_H_INCLUDED
58 
59 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition: IWORKBezierElement.cpp:18
Definition: IWORKLanguageManager.cpp:60
IWORKLanguageManager()
Definition: IWORKLanguageManager.cpp:82
boost::shared_ptr< LangDB > m_langDB
Definition: IWORKLanguageManager.h:52
boost::unordered_map< std::string, std::string > m_localeMap
Definition: IWORKLanguageManager.h:49
const std::string addLocale(const std::string &locale)
Definition: IWORKLanguageManager.cpp:148
boost::unordered_set< std::string > m_invalidTags
Definition: IWORKLanguageManager.h:46
Definition: IWORKLanguageManager.h:24
const std::string getLanguage(const std::string &tag) const
Definition: IWORKLanguageManager.cpp:175
Definition: IWORKToken.h:252
const std::string addLanguage(const std::string &lang)
Definition: IWORKLanguageManager.cpp:119
boost::unordered_set< std::string > m_invalidLangs
Definition: IWORKLanguageManager.h:48
boost::unordered_set< std::string > m_invalidLocales
Definition: IWORKLanguageManager.h:50
const std::string addTag(const std::string &tag)
Definition: IWORKLanguageManager.cpp:94
const LangDB & getLangDB() const
Definition: IWORKLanguageManager.cpp:183
boost::unordered_map< std::string, std::string > m_tagMap
Definition: IWORKLanguageManager.h:45
boost::unordered_map< std::string, std::string > m_langMap
Definition: IWORKLanguageManager.h:47
void writeProperties(const std::string &tag, librevenge::RVNGPropertyList &props) const
Definition: IWORKLanguageManager.cpp:210
boost::unordered_map< std::string, librevenge::RVNGPropertyList > m_propsMap
Definition: IWORKLanguageManager.h:51
void addProperties(const std::string &tag)
Definition: IWORKLanguageManager.cpp:190

Generated for libetonyek by doxygen 1.8.8