Merge pull request #154 from thedax/master

Use wide paths on Win32.
This commit is contained in:
Henrik Rydgård committed 2013-10-13 23:51:49 -07:00
commit a239a45ed2
1 file changed
+9 -2
+9 -2
View File
@@ -20,6 +20,7 @@
#include "file/vfs.h"
#ifdef _WIN32
#include "../util/text/utf8.h"
// Function Cross-Compatibility
#define strcasecmp _stricmp
#endif
@@ -412,8 +413,11 @@ bool IniFile::Load(const char* filename)
// Open file
std::ifstream in;
#ifdef _WIN32
in.open(ConvertUTF8ToWString(filename), std::ios::in);
#else
in.open(filename, std::ios::in);
#endif
if (in.fail()) return false;
bool success = Load(in);
@@ -487,7 +491,11 @@ bool IniFile::Load(std::istream &in) {
bool IniFile::Save(const char* filename)
{
std::ofstream out;
#ifdef _WIN32
out.open(ConvertUTF8ToWString(filename), std::ios::out);
#else
out.open(filename, std::ios::out);
#endif
if (out.fail())
{
@@ -521,7 +529,6 @@ bool IniFile::Save(const char* filename)
return true;
}
bool IniFile::Get(const char* sectionName, const char* key, std::string* value, const char* defaultValue)
{
Section* section = GetSection(sectionName);