Skip to content
Snippets Groups Projects
Commit 931b835b authored by Andrea Bulgarelli's avatar Andrea Bulgarelli
Browse files

File seek and ftell as long

parent a42d5ce3
No related branches found
No related tags found
No related merge requests found
...@@ -78,11 +78,11 @@ public: ...@@ -78,11 +78,11 @@ public:
/// Sets the position into file. /// Sets the position into file.
/// \pre The file must be opened. /// \pre The file must be opened.
virtual dword setpos(dword offset) throw(PacketExceptionIO*); virtual long setpos(long offset) throw(PacketExceptionIO*);
/// Gets the current file position. /// Gets the current file position.
/// \pre The file must be opened. /// \pre The file must be opened.
virtual dword getpos(); virtual long getpos();
/// Stores the current position /// Stores the current position
/// \pre The file must be opened. /// \pre The file must be opened.
...@@ -96,7 +96,7 @@ public: ...@@ -96,7 +96,7 @@ public:
virtual bool isEOF(); virtual bool isEOF();
/// \pre The file must be opened. /// \pre The file must be opened.
int setFirstPos() throw(PacketExceptionIO*); long setFirstPos() throw(PacketExceptionIO*);
/// Changes directory. The path is in the filename of file opened. /// Changes directory. The path is in the filename of file opened.
/// \pre The file name must be set. /// \pre The file name must be set.
...@@ -128,9 +128,9 @@ protected: ...@@ -128,9 +128,9 @@ protected:
FILE* fp; FILE* fp;
dword bookmarkPos; long bookmarkPos;
dword startPosition; long startPosition;
char* filename; char* filename;
......
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
return 0; return 0;
}; };
virtual dword setpos(dword offset) throw(PacketExceptionIO*); virtual dword setpos(long offset) throw(PacketExceptionIO*);
protected: protected:
......
...@@ -233,9 +233,9 @@ char* File::getLastLineRead() ...@@ -233,9 +233,9 @@ char* File::getLastLineRead()
} }
dword File::setpos(dword offset) throw(PacketExceptionIO*) long File::setpos(long offset) throw(PacketExceptionIO*)
{ {
dword f; long f;
//clearerr(fp); //clearerr(fp);
f = fseek(fp, offset, 0); f = fseek(fp, offset, 0);
if(feof(fp)) if(feof(fp))
...@@ -247,7 +247,7 @@ dword File::setpos(dword offset) throw(PacketExceptionIO*) ...@@ -247,7 +247,7 @@ dword File::setpos(dword offset) throw(PacketExceptionIO*)
dword File::getpos() long File::getpos()
{ {
return ftell(fp); return ftell(fp);
} }
...@@ -283,7 +283,7 @@ bool File::isEOF() ...@@ -283,7 +283,7 @@ bool File::isEOF()
int File::setFirstPos() throw(PacketExceptionIO*) long File::setFirstPos() throw(PacketExceptionIO*)
{ {
return setpos(startPosition); return setpos(startPosition);
} }
......
...@@ -75,6 +75,6 @@ char* InputFile::readString() throw(PacketExceptionIO*) ...@@ -75,6 +75,6 @@ char* InputFile::readString() throw(PacketExceptionIO*)
return c; return c;
} }
dword InputFile::setpos(dword offset) throw(PacketExceptionIO*) { dword InputFile::setpos(long offset) throw(PacketExceptionIO*) {
return file->setpos(offset); return file->setpos(offset);
} }
3.0.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment