summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-10-09 14:19:14 +0200
committermadmaxoft <github@xoft.cz>2013-10-09 14:19:14 +0200
commit76d056e5f73a3a7a30bd755669d77029995373bb (patch)
treec394994d7404be260ae92ac59392df7780e452bb /source
parentAPIDump: Documented the new cFile API functions. (diff)
downloadcuberite-76d056e5f73a3a7a30bd755669d77029995373bb.tar
cuberite-76d056e5f73a3a7a30bd755669d77029995373bb.tar.gz
cuberite-76d056e5f73a3a7a30bd755669d77029995373bb.tar.bz2
cuberite-76d056e5f73a3a7a30bd755669d77029995373bb.tar.lz
cuberite-76d056e5f73a3a7a30bd755669d77029995373bb.tar.xz
cuberite-76d056e5f73a3a7a30bd755669d77029995373bb.tar.zst
cuberite-76d056e5f73a3a7a30bd755669d77029995373bb.zip
Diffstat (limited to 'source')
-rw-r--r--source/OSSupport/File.cpp10
1 files 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 <fstream>
-
-/// 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();