From 76d056e5f73a3a7a30bd755669d77029995373bb Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 9 Oct 2013 14:19:14 +0200 Subject: [PATCH] Fixed cFile::CopyFile Linux compilation. --- source/OSSupport/File.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/source/OSSupport/File.cpp b/source/OSSupport/File.cpp index a3733933e..d2eea498a 100644 --- a/source/OSSupport/File.cpp +++ b/source/OSSupport/File.cpp @@ -6,13 +6,12 @@ #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "File.h" +#include - -/// Simple constructor - creates an unopened file object, use Open() to open / create a real file cFile::cFile(void) : #ifdef USE_STDIO_FILE m_File(NULL) @@ -27,7 +26,6 @@ cFile::cFile(void) : -/// Constructs and opens / creates the file specified, use IsOpen() to check for success cFile::cFile(const AString & iFileName, eMode iMode) : #ifdef USE_STDIO_FILE m_File(NULL) @@ -42,7 +40,6 @@ cFile::cFile(const AString & iFileName, eMode iMode) : -/// Auto-closes the file, if open cFile::~cFile() { if (IsOpen()) @@ -134,7 +131,6 @@ bool cFile::IsEOF(void) const -/// Reads up to iNumBytes bytes into iBuffer, returns the number of bytes actually read, or -1 on failure; asserts if not open int cFile::Read (void * iBuffer, int iNumBytes) { ASSERT(IsOpen()); @@ -289,8 +285,8 @@ bool cFile::Copy(const AString & a_SrcFileName, const AString & a_DstFileName) return (CopyFile(a_SrcFileName.c_str(), a_DstFileName.c_str(), true) != 0); #else // Other OSs don't have a direct CopyFile equivalent, do it the harder way: - ifstream src(a_SrcFileName, ios::binary); - ofstream dst(a_DstFileName, ios::binary); + std::ifstream src(a_SrcFileName.c_str(), std::ios::binary); + std::ofstream dst(a_DstFileName.c_str(), std::ios::binary); if (dst.good()) { dst << src.rdbuf();