#include <vil1_stream_section.h>
Inheritance diagram for vil1_stream_section:

It is possible to have multiple vil1_stream_sections using the same underlying stream simultaneously. This is accomplished by keeping a note of the current position and seeking a lot.
Note however that this is *not* threadsafe.
Definition at line 21 of file vil1_stream_section.h.
Public Member Functions | |
| vil1_stream_section (vil1_stream *underlying, int begin) | |
| skip to position 'begin' in underlying stream and translate seeks, reads and writes relative to that position into seeks, reads and writes in the underlying stream. | |
| vil1_stream_section (vil1_stream *underlying, int begin, int end) | |
| as above, but will not allow seeks, reads or writes past 'end'. | |
| bool | ok () const |
| Return false if the stream is broken. | |
| vil1_streampos | write (void const *buf, vil1_streampos n) |
| Write n bytes from buf. Returns number of bytes written. | |
| vil1_streampos | read (void *buf, vil1_streampos n) |
| Read n bytes into buf. Returns number of bytes read. | |
| vil1_streampos | tell () const |
| Return file pointer. | |
| void | seek (vil1_streampos position) |
| Goto file pointer. | |
| void | ref () |
| up/down the reference count. | |
| void | unref () |
Protected Member Functions | |
| ~vil1_stream_section () | |
Private Attributes | |
| vil1_stream * | underlying_ |
| vil1_streampos | begin_ |
| vil1_streampos | end_ |
| vil1_streampos | current_ |
| vil1_stream_section::vil1_stream_section | ( | vil1_stream * | underlying, | |
| int | begin | |||
| ) |
skip to position 'begin' in underlying stream and translate seeks, reads and writes relative to that position into seeks, reads and writes in the underlying stream.
Definition at line 18 of file vil1_stream_section.cxx.
| vil1_stream_section::vil1_stream_section | ( | vil1_stream * | underlying, | |
| int | begin, | |||
| int | end | |||
| ) |
as above, but will not allow seeks, reads or writes past 'end'.
Definition at line 29 of file vil1_stream_section.cxx.
| vil1_stream_section::~vil1_stream_section | ( | ) | [protected] |
Definition at line 41 of file vil1_stream_section.cxx.
| bool vil1_stream_section::ok | ( | ) | const [inline, virtual] |
Return false if the stream is broken.
Implements vil1_stream.
Definition at line 34 of file vil1_stream_section.h.
| vil1_streampos vil1_stream_section::write | ( | void const * | buf, | |
| vil1_streampos | n | |||
| ) | [virtual] |
Write n bytes from buf. Returns number of bytes written.
The return value is less than n only in case of device failure.
Implements vil1_stream.
Definition at line 50 of file vil1_stream_section.cxx.
| vil1_streampos vil1_stream_section::read | ( | void * | buf, | |
| vil1_streampos | n | |||
| ) | [virtual] |
Read n bytes into buf. Returns number of bytes read.
The return value is less than n only at eof.
Implements vil1_stream.
Definition at line 77 of file vil1_stream_section.cxx.
| vil1_streampos vil1_stream_section::tell | ( | ) | const [inline, virtual] |
| void vil1_stream_section::seek | ( | vil1_streampos | position | ) | [virtual] |
| void vil1_stream::ref | ( | ) | [inline, inherited] |
| void vil1_stream::unref | ( | ) | [inherited] |
Definition at line 31 of file vil1_stream.cxx.
vil1_stream* vil1_stream_section::underlying_ [private] |
Definition at line 44 of file vil1_stream_section.h.
vil1_streampos vil1_stream_section::begin_ [private] |
Definition at line 45 of file vil1_stream_section.h.
vil1_streampos vil1_stream_section::end_ [private] |
Definition at line 46 of file vil1_stream_section.h.
vil1_streampos vil1_stream_section::current_ [private] |
Definition at line 47 of file vil1_stream_section.h.
1.5.1