Commit 931b835b authored by Andrea Bulgarelli's avatar Andrea Bulgarelli
Browse files

File seek and ftell as long

parent a42d5ce3
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -78,11 +78,11 @@ public:

    ///  Sets the position into file.
    ///  \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.
    ///  \pre The file must be opened.
    virtual dword getpos();
    virtual long getpos();

    ///  Stores the current position
    ///  \pre The file must be opened.
@@ -96,7 +96,7 @@ public:
    virtual bool isEOF();

    ///  \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.
    ///  \pre The file name must be set.
@@ -128,9 +128,9 @@ protected:

    FILE* fp;

    dword bookmarkPos;
    long bookmarkPos;

    dword startPosition;
    long startPosition;

    char* filename;

+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ public:
        return 0;
    };
    
    virtual dword setpos(dword offset) throw(PacketExceptionIO*);
    virtual dword setpos(long offset) throw(PacketExceptionIO*);

protected:

+4 −4
Original line number Diff line number Diff line
@@ -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);
    f =  fseek(fp, offset, 0);
    if(feof(fp))
@@ -247,7 +247,7 @@ dword File::setpos(dword offset) throw(PacketExceptionIO*)



dword File::getpos()
long File::getpos()
{
    return ftell(fp);
}
@@ -283,7 +283,7 @@ bool File::isEOF()



int File::setFirstPos()  throw(PacketExceptionIO*)
long File::setFirstPos()  throw(PacketExceptionIO*)
{
    return setpos(startPosition);
}
+1 −1
Original line number Diff line number Diff line
@@ -75,6 +75,6 @@ char* InputFile::readString() throw(PacketExceptionIO*)
    return c;
}

dword InputFile::setpos(dword offset) throw(PacketExceptionIO*) {
dword InputFile::setpos(long offset) throw(PacketExceptionIO*) {
	return file->setpos(offset);
}
+1 −0
Original line number Diff line number Diff line
3.0.0