diff = pos + GetIntPosition();
if ( (diff > last_access) || (diff < 0) ) {
- ret_off = m_stream->OnSysSeek(pos, wxFromCurrent);
+ // We must take into account the fact that we have read something
+ // previously.
+ ret_off = m_stream->OnSysSeek(diff-last_access, wxFromCurrent);
ResetBuffer();
return ret_off;
} else {
return s_toget;
}
-size_t wxInputStream::Ungetch(void *buf, size_t bufsize)
+size_t wxInputStream::Ungetch(const void *buf, size_t bufsize)
{
char *ptrback;
off_t wxInputStream::SeekI(off_t pos, wxSeekMode mode)
{
- return wxInvalidOffset;
+ return OnSysSeek(pos, mode);
}
off_t wxInputStream::TellI() const
{
- return wxInvalidOffset;
+ return OnSysTell();
}
// --------------------
off_t wxOutputStream::TellO() const
{
- return wxInvalidOffset;
+ return OnSysTell();
}
off_t wxOutputStream::SeekO(off_t pos, wxSeekMode mode)
{
- return wxInvalidOffset;
+ return OnSysSeek(pos, mode);
}
void wxOutputStream::Sync()