+ support of seek operation on PyStreambuf

This commit is contained in:
wmayer
2016-06-14 13:59:02 +02:00
parent 1c1faafed7
commit 6bf04e358e
2 changed files with 55 additions and 3 deletions

View File

@@ -240,6 +240,12 @@ protected:
class BaseExport PyStreambuf : public std::streambuf
{
typedef std::streambuf::int_type int_type;
typedef std::streambuf::pos_type pos_type;
typedef std::streambuf::off_type off_type;
typedef std::ios::seekdir seekdir;
typedef std::ios::openmode openmode;
public:
PyStreambuf(PyObject* o, std::size_t buf_size = 256, std::size_t put_back = 8);
virtual ~PyStreambuf();
@@ -249,6 +255,8 @@ protected:
int_type overflow(int_type c = EOF);
std::streamsize xsputn (const char* s, std::streamsize num);
int sync();
pos_type seekoff(off_type offset, seekdir dir, openmode);
pos_type seekpos(pos_type offset, openmode mode);
private:
bool flushBuffer();