OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
importer.hpp
Go to the documentation of this file.
1 #ifndef MWINIIMPORTER_IMPORTER
2 #define MWINIIMPORTER_IMPORTER 1
3 
4 #include <string>
5 #include <map>
6 #include <vector>
7 #include <exception>
8 #include <iosfwd>
9 #include <boost/filesystem/path.hpp>
10 
12 
14  public:
15  typedef std::map<std::string, std::string> strmap;
16  typedef std::map<std::string, std::vector<std::string> > multistrmap;
17 
18  MwIniImporter();
19  void setInputEncoding(const ToUTF8::FromType& encoding);
20  void setVerbose(bool verbose);
21  multistrmap loadIniFile(const boost::filesystem::path& filename) const;
22  static multistrmap loadCfgFile(const boost::filesystem::path& filename);
23  void merge(multistrmap &cfg, const multistrmap &ini) const;
24  void mergeFallback(multistrmap &cfg, const multistrmap &ini) const;
25  void importGameFiles(multistrmap &cfg, const multistrmap &ini,
26  const boost::filesystem::path& iniFilename) const;
27  void importArchives(multistrmap &cfg, const multistrmap &ini) const;
28  static void writeToFile(std::ostream &out, const multistrmap &cfg);
29 
30  private:
31  static void insertMultistrmap(multistrmap &cfg, const std::string& key, const std::string& value);
32  static std::string numberToString(int n);
33 
35  static std::time_t lastWriteTime(const boost::filesystem::path& filename, std::time_t defaultTime);
36 
37  bool mVerbose;
39  std::vector<std::string> mMergeFallback;
41 };
42 
43 
44 #endif
std::vector< std::string > mMergeFallback
Definition: importer.hpp:39
Definition: importer.hpp:13
void setInputEncoding(const ToUTF8::FromType &encoding)
Definition: importer.cpp:882
void importArchives(multistrmap &cfg, const multistrmap &ini) const
Definition: importer.cpp:799
static std::time_t lastWriteTime(const boost::filesystem::path &filename, std::time_t defaultTime)
Definition: importer.cpp:887
std::map< std::string, std::vector< std::string > > multistrmap
Definition: importer.hpp:16
void importGameFiles(multistrmap &cfg, const multistrmap &ini, const boost::filesystem::path &iniFilename) const
Definition: importer.cpp:832
static void insertMultistrmap(multistrmap &cfg, const std::string &key, const std::string &value)
Definition: importer.cpp:791
bool mVerbose
Definition: importer.hpp:37
strmap mMergeMap
Definition: importer.hpp:38
FromType
Definition: to_utf8.hpp:11
static multistrmap loadCfgFile(const boost::filesystem::path &filename)
Definition: importer.cpp:726
void merge(multistrmap &cfg, const multistrmap &ini) const
Definition: importer.cpp:762
void setVerbose(bool verbose)
Definition: importer.cpp:657
static void writeToFile(std::ostream &out, const multistrmap &cfg)
Definition: importer.cpp:873
MwIniImporter()
Definition: importer.cpp:18
std::map< std::string, std::string > strmap
Definition: importer.hpp:15
ToUTF8::FromType mEncoding
Definition: importer.hpp:40
static std::string numberToString(int n)
Definition: importer.cpp:661
multistrmap loadIniFile(const boost::filesystem::path &filename) const
Definition: importer.cpp:667
void mergeFallback(multistrmap &cfg, const multistrmap &ini) const
Definition: importer.cpp:774