2012-03-30 18:59:44 +00:00
|
|
|
#ifndef MWINIIMPORTER_IMPORTER
|
|
|
|
#define MWINIIMPORTER_IMPORTER 1
|
|
|
|
|
|
|
|
#include <string>
|
2012-03-30 20:58:54 +00:00
|
|
|
#include <map>
|
|
|
|
#include <exception>
|
|
|
|
|
|
|
|
|
2012-03-31 16:28:48 +00:00
|
|
|
typedef std::multimap<std::string, std::string> strmap;
|
2012-03-30 18:59:44 +00:00
|
|
|
|
|
|
|
class MwIniImporter {
|
|
|
|
|
|
|
|
public:
|
2012-03-31 14:54:53 +00:00
|
|
|
MwIniImporter();
|
2012-03-30 20:58:54 +00:00
|
|
|
void setVerbose(bool verbose);
|
|
|
|
strmap loadIniFile(std::string filename);
|
|
|
|
strmap loadCfgFile(std::string filename);
|
|
|
|
void merge(strmap &cfg, strmap &ini);
|
2012-03-31 16:24:43 +00:00
|
|
|
void importGameFiles(strmap &cfg, strmap &ini);
|
2012-03-30 20:58:54 +00:00
|
|
|
void writeToFile(std::string file, strmap &cfg);
|
2012-03-30 18:59:44 +00:00
|
|
|
|
|
|
|
private:
|
2012-03-31 12:34:00 +00:00
|
|
|
bool specialMerge(std::string cfgKey, std::string iniKey, strmap &cfg, strmap &ini);
|
2012-03-30 20:58:54 +00:00
|
|
|
bool mVerbose;
|
2012-03-31 12:28:19 +00:00
|
|
|
strmap mMergeMap;
|
2012-03-30 18:59:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|