Fixed seeking for simultaneous in- and output

This commit is contained in:
Bob Polis 2022-12-12 19:04:05 +01:00
parent b7112f0d23
commit 03ccac4d1f

View File

@ -72,7 +72,8 @@ std::streambuf::pos_type sc::io::memstreambuf::seekoff(std::streambuf::off_type
break; break;
} }
return gptr() - _mem; return gptr() - _mem;
} else if (which & std::ios::out) { // writing }
if (which & std::ios::out) { // writing
switch (dir) { // TODO switch (dir) { // TODO
case std::ios::beg: case std::ios::beg:
break; break;
@ -92,7 +93,8 @@ std::streambuf::pos_type sc::io::memstreambuf::seekpos(std::streambuf::pos_type
if (pos < 0 || static_cast<size_t>(pos) > _size) return EOF; if (pos < 0 || static_cast<size_t>(pos) > _size) return EOF;
setg(_mem, _mem + pos, _mem + _size); setg(_mem, _mem + pos, _mem + _size);
return pos; return pos;
} else if (which & std::ios::out) { }
if (which & std::ios::out) {
// TODO // TODO
return pos; return pos;
} }