OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
translation.hpp
Go to the documentation of this file.
1 #ifndef COMPONENTS_TRANSLATION_DATA_H
2 #define COMPONENTS_TRANSLATION_DATA_H
3 
6 
7 namespace Translation
8 {
9  class Storage
10  {
11  public:
12  Storage();
13 
14  void loadTranslationData(const Files::Collections& dataFileCollections,
15  const std::string& esmFileName);
16 
17  std::string translateCellName(const std::string& cellName) const;
18  std::string topicID(const std::string& phrase) const;
19 
20  // Standard form usually means nominative case
21  std::string topicStandardForm(const std::string& phrase) const;
22 
23  void setEncoder(ToUTF8::Utf8Encoder* encoder);
24 
25  bool hasTranslation() const;
26 
27  private:
28  typedef std::map<std::string, std::string> ContainerType;
29 
30  void loadData(ContainerType& container,
31  const std::string& fileNameNoExtension,
32  const std::string& extension,
33  const Files::Collections& dataFileCollections);
34 
35  void loadDataFromStream(ContainerType& container, std::istream& stream);
36 
37 
40  };
41 }
42 
43 #endif
std::string translateCellName(const std::string &cellName) const
Definition: translation.cpp:73
Storage()
Definition: translation.cpp:9
ContainerType mCellNamesTranslations
Definition: translation.hpp:39
Definition: translation.hpp:9
bool hasTranslation() const
Definition: translation.cpp:114
ContainerType mPhraseForms
Definition: translation.hpp:39
std::string topicStandardForm(const std::string &phrase) const
Definition: translation.cpp:98
std::string topicID(const std::string &phrase) const
Definition: translation.cpp:84
void setEncoder(ToUTF8::Utf8Encoder *encoder)
Definition: translation.cpp:109
ToUTF8::Utf8Encoder * mEncoder
Definition: translation.hpp:38
void loadTranslationData(const Files::Collections &dataFileCollections, const std::string &esmFileName)
Definition: translation.cpp:14
ContainerType mTopicIDs
Definition: translation.hpp:39
Definition: collections.hpp:10
Definition: to_utf8.hpp:25
std::map< std::string, std::string > ContainerType
Definition: translation.hpp:28
void loadData(ContainerType &container, const std::string &fileNameNoExtension, const std::string &extension, const Files::Collections &dataFileCollections)
Definition: translation.cpp:28
void loadDataFromStream(ContainerType &container, std::istream &stream)
Definition: translation.cpp:47