From 0b616909e3472a4360e22d6b01749ee44092e967 Mon Sep 17 00:00:00 2001 From: faketruth Date: Sun, 19 Feb 2012 23:00:00 +0000 Subject: Using own ASSERT() that logs to file git-svn-id: http://mc-server.googlecode.com/svn/trunk@297 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cFile.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/cFile.cpp') diff --git a/source/cFile.cpp b/source/cFile.cpp index 019b125ee..5ea71107a 100644 --- a/source/cFile.cpp +++ b/source/cFile.cpp @@ -57,7 +57,7 @@ cFile::~cFile() bool cFile::Open(const AString & iFileName, EMode iMode) { - assert(!IsOpen()); // You should close the file before opening another one + ASSERT(!IsOpen()); // You should close the file before opening another one if (IsOpen()) { @@ -72,7 +72,7 @@ bool cFile::Open(const AString & iFileName, EMode iMode) case fmReadWrite: Mode = "ab+"; break; default: { - assert(!"Unhandled file mode"); + ASSERT(!"Unhandled file mode"); return false; } } @@ -86,7 +86,7 @@ bool cFile::Open(const AString & iFileName, EMode iMode) void cFile::Close(void) { - assert(IsOpen()); // You should not close file objects that don't have an open file. + ASSERT(IsOpen()); // You should not close file objects that don't have an open file. if (!IsOpen()) { @@ -112,7 +112,7 @@ bool cFile::IsOpen(void) const bool cFile::IsEOF(void) const { - assert(IsOpen()); + ASSERT(IsOpen()); if (!IsOpen()) { @@ -130,7 +130,7 @@ 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()); + ASSERT(IsOpen()); if (!IsOpen()) { @@ -147,7 +147,7 @@ int cFile::Read (void * iBuffer, int iNumBytes) /// Writes up to iNumBytes bytes from iBuffer, returns the number of bytes actually written, or -1 on failure; asserts if not open int cFile::Write(const void * iBuffer, int iNumBytes) { - assert(IsOpen()); + ASSERT(IsOpen()); if (!IsOpen()) { @@ -165,7 +165,7 @@ int cFile::Write(const void * iBuffer, int iNumBytes) /// Seeks to iPosition bytes from file start, returns old position or -1 for failure int cFile::Seek (int iPosition) { - assert(IsOpen()); + ASSERT(IsOpen()); if (!IsOpen()) { @@ -187,7 +187,7 @@ int cFile::Seek (int iPosition) /// Returns the current position (bytes from file start) int cFile::Tell (void) const { - assert(IsOpen()); + ASSERT(IsOpen()); if (!IsOpen()) { @@ -204,7 +204,7 @@ int cFile::Tell (void) const /// Returns the size of file, in bytes, or -1 for failure; asserts if not open int cFile::GetSize(void) const { - assert(IsOpen()); + ASSERT(IsOpen()); if (!IsOpen()) { @@ -234,7 +234,7 @@ int cFile::GetSize(void) const int cFile::ReadRestOfFile(AString & a_Contents) { - assert(IsOpen()); + ASSERT(IsOpen()); if (!IsOpen()) { -- cgit v1.2.3