#include <streambuf.hpp>
|
typedef std::basic_streambuf< char > | base_t |
|
ecto::py::streambuf::streambuf |
( |
bp::object & |
python_file_obj, |
|
|
std::size_t |
buffer_size_ = 0 |
|
) |
| |
|
inline |
Construct from a Python file object.
if buffer_size is 0 the current default_buffer_size is used.
virtual ecto::py::streambuf::~streambuf |
( |
| ) |
|
|
inlinevirtual |
Mundane destructor freeing the allocated resources.
C.f. C++ standard section 27.5.2.4.5.
virtual pos_type ecto::py::streambuf::seekoff |
( |
off_type |
off, |
|
|
std::ios_base::seekdir |
way, |
|
|
std::ios_base::openmode |
which = std::ios_base::in | std::ios_base::out |
|
) |
| |
|
inlinevirtual |
C.f. C++ standard section 27.5.2.4.2.
This implementation is optimised to look whether the position is within the buffers, so as to avoid calling Python seek or tell. It is important for many applications that the overhead of calling into Python is avoided as much as possible (e.g. parsers which may do a lot of backtracking)
boost::optional<off_type> ecto::py::streambuf::seekoff_without_calling_python |
( |
off_type |
off, |
|
|
std::ios_base::seekdir |
way, |
|
|
std::ios_base::openmode |
which |
|
) |
| |
|
inlineprivate |
virtual pos_type ecto::py::streambuf::seekpos |
( |
pos_type |
sp, |
|
|
std::ios_base::openmode |
which = std::ios_base::in | std::ios_base::out |
|
) |
| |
|
inlinevirtual |
C.f. C++ standard section 27.5.2.4.2.
virtual std::streamsize ecto::py::streambuf::showmanyc |
( |
| ) |
|
|
inlinevirtual |
C.f. C++ standard section 27.5.2.4.3.
It is essential to override this virtual function for the stream member function readsome to work correctly (c.f. 27.6.1.3, alinea 30)
virtual int ecto::py::streambuf::sync |
( |
| ) |
|
|
inlinevirtual |
Update the python file to reflect the state of this stream buffer.
Empty the write buffer into the Python file object and set the seek position of the latter accordingly (C++ standard section 27.5.2.4.2). If there is no write buffer or it is empty, but there is a non-empty read buffer, set the Python file object seek position to the seek position in that read buffer.
static int ecto::py::streambuf::traits_type_eof |
( |
| ) |
|
|
inlinestatic |
virtual int_type ecto::py::streambuf::underflow |
( |
| ) |
|
|
inlinevirtual |
C.f. C++ standard section 27.5.2.4.3.
std::size_t ecto::py::streambuf::buffer_size |
|
private |
std::size_t ecto::py::streambuf::default_buffer_size = 1024 |
|
static |
The default size of the read and write buffer.
They are respectively used to buffer data read from and data written to the Python file object. It can be modified from Python.
char* ecto::py::streambuf::farthest_pptr |
|
private |
bp::object ecto::py::streambuf::file_obj |
off_type ecto::py::streambuf::pos_of_read_buffer_end_in_py_file |
|
private |
off_type ecto::py::streambuf::pos_of_write_buffer_end_in_py_file |
|
private |
bp::object ecto::py::streambuf::py_read |
|
private |
bp::object ecto::py::streambuf::py_seek |
|
private |
bp::object ecto::py::streambuf::py_tell |
|
private |
bp::object ecto::py::streambuf::py_write |
|
private |
bp::object ecto::py::streambuf::read_buffer |
|
private |
char* ecto::py::streambuf::write_buffer |
|
private |
The documentation for this class was generated from the following file:
- /home/vrabaud/workspace/recognition_kitchen/src/ecto/include/ecto/python/streambuf.hpp