openmw-tes3coop/apps/mwiniimporter/importer.hpp

32 lines
745 B
C++
Raw Normal View History

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>
typedef std::map<std::string, std::string> strmap;
#define STRPAIR std::make_pair<std::string, std::string>
2012-03-30 18:59:44 +00:00
class MwIniImporter {
public:
MwIniImporter() {
mMergeMap.insert(STRPAIR("fps", "General:Show FPS"));
};
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);
void writeToFile(std::string file, strmap &cfg);
2012-03-30 18:59:44 +00:00
private:
bool specialMerge(std::string cfgKey, std::string iniKey, strmap cfg, strmap ini);
2012-03-30 20:58:54 +00:00
bool mVerbose;
strmap mMergeMap;
2012-03-30 18:59:44 +00:00
};
#endif