mirror of
https://github.com/isledecomp/SIEdit.git
synced 2024-11-23 15:48:03 -05:00
lib: fix win32 issues
This commit is contained in:
parent
5bc8dbfd42
commit
180ead8188
4 changed files with 26 additions and 6 deletions
|
@ -49,18 +49,18 @@ Interleaf::Error Interleaf::Write(const char *f) const
|
|||
#ifdef _WIN32
|
||||
Interleaf::Error Interleaf::Read(const wchar_t *f)
|
||||
{
|
||||
std::istream is(f);
|
||||
std::ifstream is(f);
|
||||
if (!is.is_open() || !is.good()) {
|
||||
return false;
|
||||
return ERROR_IO;
|
||||
}
|
||||
return Read(is);
|
||||
}
|
||||
|
||||
Interleaf::Error Interleaf::Write(const wchar_t *f) const
|
||||
{
|
||||
std::ostream os(f);
|
||||
std::ofstream os(f);
|
||||
if (!os.is_open() || !os.good()) {
|
||||
return false;
|
||||
return ERROR_IO;
|
||||
}
|
||||
return Write(os);
|
||||
}
|
||||
|
|
|
@ -13,6 +13,26 @@ Object::Object()
|
|||
id_ = 0;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
bool Object::ReplaceWithFile(const wchar_t *f)
|
||||
{
|
||||
std::ifstream is(f);
|
||||
if (!is.is_open() || !is.good()) {
|
||||
return false;
|
||||
}
|
||||
return ReplaceWithFile(is);
|
||||
}
|
||||
|
||||
bool Object::ExtractToFile(const wchar_t *f) const
|
||||
{
|
||||
std::ofstream os(f);
|
||||
if (!os.is_open() || !os.good()) {
|
||||
return false;
|
||||
}
|
||||
return ExtractToFile(os);
|
||||
}
|
||||
#endif
|
||||
|
||||
bool Object::ReplaceWithFile(const char *f)
|
||||
{
|
||||
std::ifstream is(f);
|
||||
|
|
|
@ -47,7 +47,7 @@ public:
|
|||
return std::string((const char *) &u, sizeof(u));
|
||||
}
|
||||
|
||||
static const char *GetTypeDescription(Type t);
|
||||
LIBWEAVER_EXPORT static const char *GetTypeDescription(Type t);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ public:
|
|||
|
||||
};
|
||||
|
||||
LIBWEAVER_EXPORT class memorybuf : public std::streambuf
|
||||
class memorybuf : public std::streambuf
|
||||
{
|
||||
public:
|
||||
memorybuf(){}
|
||||
|
|
Loading…
Reference in a new issue