more win32 goodness

This commit is contained in:
David Rose 2002-08-05 16:33:10 +00:00
parent 566986eda0
commit 1ce6f9db76
2 changed files with 20 additions and 0 deletions

View File

@ -155,6 +155,25 @@ seekoff(streamoff off, ios::seek_dir dir, int mode) {
return new_pos - _start;
}
////////////////////////////////////////////////////////////////////
// Function: SubStreamBuf::seekpos
// Access: Public, Virtual
// Description: A variant on seekoff() to implement seeking within a
// stream.
//
// The MSDN Library claims that it is necessary to
// redefine this only seekoff(), and not seekpos() as
// well, as the default implementation of seekpos() is
// supposed to map to seekoff() exactly as I am doing
// here; but in fact it must do something else, because
// seeking didn't work on Windows until I redefined this
// function as well.
////////////////////////////////////////////////////////////////////
streampos SubStreamBuf::
seekpos(streampos pos, int mode) {
return seekoff(pos, ios::beg, mode);
}
////////////////////////////////////////////////////////////////////
// Function: SubStreamBuf::overflow
// Access: Protected, Virtual

View File

@ -34,6 +34,7 @@ public:
void close();
virtual streampos seekoff(streamoff off, ios::seek_dir dir, int mode);
virtual streampos seekpos(streampos pos, int mode);
protected:
virtual int overflow(int c);