Loading include/File.h +3 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,9 @@ public: /// Count the number of string lines into a text file. long getNumberOfStringLines(); /// The dimension of the file dword fsize(); static dword byte_read; static dword char_read; Loading include/InputFile.h +4 −2 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ public: return 0; }; virtual dword setpos(dword offset) throw(PacketExceptionIO*); protected: File* file; Loading include/OutputFile.h +2 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ public: virtual void close() throw(PacketExceptionIO*); ///first parameter: filename ///second parameter: fopen modes: w, r, a (optional) virtual bool open(char** parameters) throw(PacketExceptionIO*); virtual bool writeByteStream(ByteStreamPtr b) throw(PacketExceptionIO*); Loading src/File.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -345,3 +345,18 @@ bool File::writeByteStream(ByteStreamPtr b) throw(PacketExceptionIO*) return true; } dword File::fsize(){ if(closed) return 0; long prev=ftell(fp); if(prev == -1L) return 0; fseek(fp, 0L, SEEK_END); long sz=ftell(fp); if(sz == -1L) return 0; fseek(fp,prev,SEEK_SET); //go back to where we were return sz; } src/InputFile.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -74,3 +74,7 @@ char* InputFile::readString() throw(PacketExceptionIO*) eof = file->isEOF(); return c; } dword InputFile::setpos(dword offset) throw(PacketExceptionIO*) { return file->setpos(offset); } Loading
include/File.h +3 −0 Original line number Diff line number Diff line Loading @@ -115,6 +115,9 @@ public: /// Count the number of string lines into a text file. long getNumberOfStringLines(); /// The dimension of the file dword fsize(); static dword byte_read; static dword char_read; Loading
include/InputFile.h +4 −2 Original line number Diff line number Diff line Loading @@ -46,6 +46,8 @@ public: return 0; }; virtual dword setpos(dword offset) throw(PacketExceptionIO*); protected: File* file; Loading
include/OutputFile.h +2 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ public: virtual void close() throw(PacketExceptionIO*); ///first parameter: filename ///second parameter: fopen modes: w, r, a (optional) virtual bool open(char** parameters) throw(PacketExceptionIO*); virtual bool writeByteStream(ByteStreamPtr b) throw(PacketExceptionIO*); Loading
src/File.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -345,3 +345,18 @@ bool File::writeByteStream(ByteStreamPtr b) throw(PacketExceptionIO*) return true; } dword File::fsize(){ if(closed) return 0; long prev=ftell(fp); if(prev == -1L) return 0; fseek(fp, 0L, SEEK_END); long sz=ftell(fp); if(sz == -1L) return 0; fseek(fp,prev,SEEK_SET); //go back to where we were return sz; }
src/InputFile.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -74,3 +74,7 @@ char* InputFile::readString() throw(PacketExceptionIO*) eof = file->isEOF(); return c; } dword InputFile::setpos(dword offset) throw(PacketExceptionIO*) { return file->setpos(offset); }