1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00
OpenMW/apps/mwiniimporter/importer.hpp

35 lines
1.0 KiB
C++
Raw Normal View History

2012-03-30 20:59:44 +02:00
#ifndef MWINIIMPORTER_IMPORTER
#define MWINIIMPORTER_IMPORTER 1
2012-03-31 21:06:48 +02:00
#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/stream.hpp>
2012-03-30 20:59:44 +02:00
#include <string>
2012-03-30 22:58:54 +02:00
#include <map>
2012-03-31 21:06:48 +02:00
#include <vector>
2012-03-30 22:58:54 +02:00
#include <exception>
2012-03-30 20:59:44 +02:00
class MwIniImporter {
public:
typedef std::map<std::string, std::string> strmap;
typedef std::map<std::string, std::vector<std::string> > multistrmap;
2012-03-31 16:54:53 +02:00
MwIniImporter();
2012-03-30 22:58:54 +02:00
void setVerbose(bool verbose);
multistrmap loadIniFile(std::string filename);
multistrmap loadCfgFile(std::string filename);
void merge(multistrmap &cfg, multistrmap &ini);
2012-04-02 17:07:18 +02:00
void mergeFallback(multistrmap &cfg, multistrmap &ini);
void importGameFiles(multistrmap &cfg, multistrmap &ini);
void writeToFile(boost::iostreams::stream<boost::iostreams::file_sink> &out, multistrmap &cfg);
2012-03-30 20:59:44 +02:00
private:
2012-04-02 17:07:18 +02:00
void insertMultistrmap(multistrmap &cfg, std::string key, std::string value);
std::string numberToString(int n);
2012-03-30 22:58:54 +02:00
bool mVerbose;
strmap mMergeMap;
2012-04-03 00:44:26 +02:00
std::vector<std::string> mMergeFallback;
2012-03-30 20:59:44 +02:00
};
#endif