Use std::ios::binary for all streams to prevent parse errors on Windows
MODIFY
src/ldb_reader.cpp
src/ldb_reader.cpp
#include "reader_struct.h"
bool LDB_Reader::Load(const std::string& filename, const std::string& encoding) {
- std::ifstream stream(filename.c_str());
+ std::ifstream stream(filename.c_str(), std::ios::binary);
return LDB_Reader::Load(stream, encoding);
}
bool LDB_Reader::Save(const std::string& filename, const std::string& encoding) {
- std::ofstream stream(filename.c_str());
+ std::ofstream stream(filename.c_str(), std::ios::binary);
return LDB_Reader::Save(stream, encoding);
}
bool LDB_Reader::SaveXml(const std::string& filename) {
- std::ofstream stream(filename.c_str());
+ std::ofstream stream(filename.c_str(), std::ios::binary);
return LDB_Reader::SaveXml(stream);
}
bool LDB_Reader::LoadXml(const std::string& filename) {
- std::ifstream stream(filename.c_str());
+ std::ifstream stream(filename.c_str(), std::ios::binary);
return LDB_Reader::LoadXml(stream);
}

MODIFY
src/lmt_reader.cpp
src/lmt_reader.cpp
#include "reader_struct.h"
bool LMT_Reader::Load(const std::string& filename, const std::string& encoding) {
- std::ifstream stream(filename.c_str());
+ std::ifstream stream(filename.c_str(), std::ios::binary);
return LMT_Reader::Load(stream, encoding);
}
bool LMT_Reader::Save(const std::string& filename, const std::string& encoding) {
- std::ofstream stream(filename.c_str());
+ std::ofstream stream(filename.c_str(), std::ios::binary);
return LMT_Reader::Save(stream, encoding);
}
bool LMT_Reader::SaveXml(const std::string& filename) {
- std::ofstream stream(filename.c_str());
+ std::ofstream stream(filename.c_str(), std::ios::binary);
return LMT_Reader::SaveXml(stream);
}
bool LMT_Reader::LoadXml(const std::string& filename) {
- std::ifstream stream(filename.c_str());
+ std::ifstream stream(filename.c_str(), std::ios::binary);
return LMT_Reader::LoadXml(stream);
}

MODIFY
src/lmu_reader.cpp
src/lmu_reader.cpp
#include "reader_struct.h"
std::unique_ptr<RPG::Map> LMU_Reader::Load(const std::string& filename, const std::string& encoding) {
- std::ifstream stream(filename.c_str());
+ std::ifstream stream(filename.c_str(), std::ios::binary);
return LMU_Reader::Load(stream, encoding);
}
bool LMU_Reader::Save(const std::string& filename, const RPG::Map& save, const std::string& encoding) {
- std::ofstream stream(filename.c_str());
+ std::ofstream stream(filename.c_str(), std::ios::binary);
return LMU_Reader::Save(stream, save, encoding);
}
bool LMU_Reader::SaveXml(const std::string& filename, const RPG::Map& save) {
- std::ofstream stream(filename.c_str());
+ std::ofstream stream(filename.c_str(), std::ios::binary);
return LMU_Reader::SaveXml(stream, save);
}
std::unique_ptr<RPG::Map> LMU_Reader::LoadXml(const std::string& filename) {
- std::ifstream stream(filename.c_str());
+ std::ifstream stream(filename.c_str(), std::ios::binary);
return LMU_Reader::LoadXml(stream);
}

MODIFY
src/lsd_reader.cpp
src/lsd_reader.cpp
@@ -31,22 +31,22 @@ double LSD_Reader::GenerateTimestamp(std::time_t const t) {
}
std::unique_ptr<RPG::Save> LSD_Reader::Load(const std::string& filename, const std::string& encoding) {
- std::ifstream stream(filename.c_str());
+ std::ifstream stream(filename.c_str(), std::ios::binary);
return LSD_Reader::Load(stream, encoding);
}
bool LSD_Reader::Save(const std::string& filename, const RPG::Save& save, const std::string& encoding) {
- std::ofstream stream(filename.c_str());
+ std::ofstream stream(filename.c_str(), std::ios::binary);
return LSD_Reader::Save(stream, save, encoding);
}
bool LSD_Reader::SaveXml(const std::string& filename, const RPG::Save& save) {
- std::ofstream stream(filename.c_str());
+ std::ofstream stream(filename.c_str(), std::ios::binary);
return LSD_Reader::SaveXml(stream, save);
}
std::unique_ptr<RPG::Save> LSD_Reader::LoadXml(const std::string& filename) {
- std::ifstream stream(filename.c_str());
+ std::ifstream stream(filename.c_str(), std::ios::binary);
return LSD_Reader::LoadXml(stream);
}

Use std::ios::binary for all streams to prevent parse errors on Windows