make a section of a vil_stream behave like a vil_stream. More...
#include <vil_stream_section.h>

Public Member Functions | |
| vil_stream_section (vil_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. More... | |
| vil_stream_section (vil_stream *underlying, int begin, int end) | |
| as above, but will not allow seeks, reads or writes past 'end'. More... | |
| bool | ok () const override |
| Return false if the stream is broken. More... | |
| vil_streampos | write (void const *buf, vil_streampos n) override |
| Write n bytes from buf. Returns number of bytes written. More... | |
| vil_streampos | read (void *buf, vil_streampos n) override |
| Read n bytes into buf. Returns number of bytes read. More... | |
| vil_streampos | tell () const override |
| Return file pointer. More... | |
| void | seek (vil_streampos position) override |
| Goto file pointer. More... | |
| vil_streampos | file_size () const override |
| Amount of data in the stream. More... | |
| void | ref () |
| up/down the reference count. More... | |
| void | unref () |
Protected Member Functions | |
| ~vil_stream_section () override | |
Private Attributes | |
| vil_stream * | underlying_ |
| vil_streampos | begin_ |
| vil_streampos | end_ |
| vil_streampos | current_ |
Related Functions | |
(Note that these are not member functions.) | |
| vil_stream * | vil_open (char const *what, char const *how="r") |
| make a vil_stream from a filename, an URL, etc. More... | |
| float | vil_stream_read_big_endian_float (vil_stream *is) |
| Reads in a 4-byte big-endian float. More... | |
| void | vil_stream_read_big_endian_int_16 (vil_stream *is, vxl_uint_16 *data, unsigned n) |
| Reads in n 16 bit unsigned ints. More... | |
| void | vil_stream_write_big_endian_uint_16 (vil_stream *, vxl_uint_16) |
| void | vil_stream_write_little_endian_uint_16 (vil_stream *, vxl_uint_16) |
| void | vil_stream_write_big_endian_uint_32 (vil_stream *, vxl_uint_32) |
| void | vil_stream_write_little_endian_uint_32 (vil_stream *, vxl_uint_32) |
| void | vil_stream_write_big_endian_int_32 (vil_stream *, vxl_int_32) |
| void | vil_stream_write_little_endian_int_32 (vil_stream *, vxl_int_32) |
make a section of a vil_stream behave like a vil_stream.
It is possible to have multiple vil_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 18 of file vil_stream_section.h.
| vil_stream_section::vil_stream_section | ( | vil_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 vil_stream_section.cxx.
| vil_stream_section::vil_stream_section | ( | vil_stream * | underlying, |
| int | begin, | ||
| int | end | ||
| ) |
as above, but will not allow seeks, reads or writes past 'end'.
Definition at line 29 of file vil_stream_section.cxx.
|
overrideprotected |
Definition at line 41 of file vil_stream_section.cxx.
|
overridevirtual |
Amount of data in the stream.
Implements vil_stream.
Definition at line 116 of file vil_stream_section.cxx.
|
inlineoverridevirtual |
Return false if the stream is broken.
Implements vil_stream.
Definition at line 31 of file vil_stream_section.h.
|
overridevirtual |
Read n bytes into buf. Returns number of bytes read.
The return value is less than n only at eof.
Implements vil_stream.
Definition at line 77 of file vil_stream_section.cxx.
|
inlineinherited |
up/down the reference count.
Definition at line 45 of file vil_stream.h.
|
overridevirtual |
|
inlineoverridevirtual |
|
inherited |
Definition at line 31 of file vil_stream.cxx.
|
overridevirtual |
Write n bytes from buf. Returns number of bytes written.
The return value is less than n only in case of device failure.
Implements vil_stream.
Definition at line 50 of file vil_stream_section.cxx.
|
related |
make a vil_stream from a filename, an URL, etc.
Definition at line 18 of file vil_open.cxx.
|
related |
Reads in a 4-byte big-endian float.
Definition at line 122 of file vil_stream_read.cxx.
|
related |
Reads in n 16 bit unsigned ints.
Caller is responsible for allocating enough space.
Definition at line 134 of file vil_stream_read.cxx.
|
related |
Definition at line 50 of file vil_stream_write.cxx.
|
related |
Definition at line 14 of file vil_stream_write.cxx.
|
related |
Definition at line 30 of file vil_stream_write.cxx.
|
related |
Definition at line 60 of file vil_stream_write.cxx.
|
related |
Definition at line 22 of file vil_stream_write.cxx.
|
related |
Definition at line 40 of file vil_stream_write.cxx.
|
private |
Definition at line 44 of file vil_stream_section.h.
|
private |
Definition at line 46 of file vil_stream_section.h.
|
private |
Definition at line 45 of file vil_stream_section.h.
|
private |
Definition at line 43 of file vil_stream_section.h.
1.8.15