From d982f0263481a067d5e31abd4a75cc5b27eb38ce Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Tue, 17 Mar 2015 01:13:29 -0300 Subject: [PATCH] Renamed File:eof to File:isEOF (closes issue #683.) --- src/modules/filesystem/DroppedFile.cpp | 2 +- src/modules/filesystem/DroppedFile.h | 28 ++++++++++----------- src/modules/filesystem/File.h | 2 +- src/modules/filesystem/physfs/File.cpp | 2 +- src/modules/filesystem/physfs/File.h | 28 ++++++++++----------- src/modules/filesystem/wrap_DroppedFile.cpp | 2 +- src/modules/filesystem/wrap_File.cpp | 10 ++++---- src/modules/filesystem/wrap_File.h | 2 +- 8 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/modules/filesystem/DroppedFile.cpp b/src/modules/filesystem/DroppedFile.cpp index b51cd510b..38c92f507 100644 --- a/src/modules/filesystem/DroppedFile.cpp +++ b/src/modules/filesystem/DroppedFile.cpp @@ -157,7 +157,7 @@ bool DroppedFile::flush() return fflush(file) == 0; } -bool DroppedFile::eof() +bool DroppedFile::isEOF() { return file == nullptr || feof(file) != 0; } diff --git a/src/modules/filesystem/DroppedFile.h b/src/modules/filesystem/DroppedFile.h index d5256fcc4..3e5417280 100644 --- a/src/modules/filesystem/DroppedFile.h +++ b/src/modules/filesystem/DroppedFile.h @@ -47,20 +47,20 @@ public: // Implements File. using File::read; using File::write; - bool open(Mode mode); - bool close(); - bool isOpen() const; - int64 getSize(); - int64 read(void *dst, int64 size); - bool write(const void *data, int64 size); - bool flush(); - bool eof(); - int64 tell(); - bool seek(uint64 pos); - bool setBuffer(BufferMode bufmode, int64 size); - BufferMode getBuffer(int64 &size) const; - Mode getMode() const; - const std::string &getFilename() const; + bool open(Mode mode) override; + bool close() override; + bool isOpen() const override; + int64 getSize() override; + int64 read(void *dst, int64 size) override; + bool write(const void *data, int64 size) override; + bool flush() override; + bool isEOF() override; + int64 tell() override; + bool seek(uint64 pos) override; + bool setBuffer(BufferMode bufmode, int64 size) override; + BufferMode getBuffer(int64 &size) const override; + Mode getMode() const override; + const std::string &getFilename() const override; private: diff --git a/src/modules/filesystem/File.h b/src/modules/filesystem/File.h index 4b83fb2cb..923ddb728 100644 --- a/src/modules/filesystem/File.h +++ b/src/modules/filesystem/File.h @@ -147,7 +147,7 @@ public: * * @return True if EOF, false otherwise. **/ - virtual bool eof() = 0; + virtual bool isEOF() = 0; /** * Gets the current position in the File. diff --git a/src/modules/filesystem/physfs/File.cpp b/src/modules/filesystem/physfs/File.cpp index 50c3ec768..8b07390bd 100644 --- a/src/modules/filesystem/physfs/File.cpp +++ b/src/modules/filesystem/physfs/File.cpp @@ -212,7 +212,7 @@ inline bool test_eof(File *, PHYSFS_File *file) } #endif -bool File::eof() +bool File::isEOF() { return file == nullptr || test_eof(this, file); } diff --git a/src/modules/filesystem/physfs/File.h b/src/modules/filesystem/physfs/File.h index 01357ade8..999c28e34 100644 --- a/src/modules/filesystem/physfs/File.h +++ b/src/modules/filesystem/physfs/File.h @@ -56,20 +56,20 @@ public: // Implements love::filesystem::File. using love::filesystem::File::read; using love::filesystem::File::write; - bool open(Mode mode); - bool close(); - bool isOpen() const; - int64 getSize(); - virtual int64 read(void *dst, int64 size); - bool write(const void *data, int64 size); - bool flush(); - bool eof(); - int64 tell(); - bool seek(uint64 pos); - bool setBuffer(BufferMode bufmode, int64 size); - BufferMode getBuffer(int64 &size) const; - Mode getMode() const; - const std::string &getFilename() const; + bool open(Mode mode) override; + bool close() override; + bool isOpen() const override; + int64 getSize() override; + virtual int64 read(void *dst, int64 size) override; + bool write(const void *data, int64 size) override; + bool flush() override; + bool isEOF() override; + int64 tell() override; + bool seek(uint64 pos) override; + bool setBuffer(BufferMode bufmode, int64 size) override; + BufferMode getBuffer(int64 &size) const override; + Mode getMode() const override; + const std::string &getFilename() const override; private: diff --git a/src/modules/filesystem/wrap_DroppedFile.cpp b/src/modules/filesystem/wrap_DroppedFile.cpp index b59502c0a..b38982558 100644 --- a/src/modules/filesystem/wrap_DroppedFile.cpp +++ b/src/modules/filesystem/wrap_DroppedFile.cpp @@ -41,7 +41,7 @@ static const luaL_Reg functions[] = { "read", w_File_read }, { "write", w_File_write }, { "flush", w_File_flush }, - { "eof", w_File_eof }, + { "isEOF", w_File_isEOF }, { "tell", w_File_tell }, { "seek", w_File_seek }, { "lines", w_File_lines }, diff --git a/src/modules/filesystem/wrap_File.cpp b/src/modules/filesystem/wrap_File.cpp index ee06ce952..6444573f2 100644 --- a/src/modules/filesystem/wrap_File.cpp +++ b/src/modules/filesystem/wrap_File.cpp @@ -186,10 +186,10 @@ int w_File_flush(lua_State *L) return 1; } -int w_File_eof(lua_State *L) +int w_File_isEOF(lua_State *L) { File *file = luax_checkfile(L, 1); - luax_pushboolean(L, file->eof()); + luax_pushboolean(L, file->isEOF()); return 1; } @@ -246,7 +246,7 @@ int w_File_lines_i(lua_State *L) file->seek(pos); } - while (!newline && !file->eof()) + while (!newline && !file->isEOF()) { // This 64-bit to 32-bit integer cast should be safe as it never exceeds bufsize. int read = (int) file->read(buf, bufsize); @@ -266,7 +266,7 @@ int w_File_lines_i(lua_State *L) } } - if (newline || (file->eof() && linesize > 0)) + if (newline || (file->isEOF() && linesize > 0)) { if (linesize < bufsize) { @@ -422,7 +422,7 @@ static const luaL_Reg functions[] = { "read", w_File_read }, { "write", w_File_write }, { "flush", w_File_flush }, - { "eof", w_File_eof }, + { "isEOF", w_File_isEOF }, { "tell", w_File_tell }, { "seek", w_File_seek }, { "lines", w_File_lines }, diff --git a/src/modules/filesystem/wrap_File.h b/src/modules/filesystem/wrap_File.h index e0ae68152..50ee0f137 100644 --- a/src/modules/filesystem/wrap_File.h +++ b/src/modules/filesystem/wrap_File.h @@ -41,7 +41,7 @@ int w_File_isOpen(lua_State *L); int w_File_read(lua_State *L); int w_File_write(lua_State *L); int w_File_flush(lua_State *L); -int w_File_eof(lua_State *L); +int w_File_isEOF(lua_State *L); int w_File_tell(lua_State *L); int w_File_seek(lua_State *L); int w_File_lines_i(lua_State *L);