Public Member Functions | Protected Member Functions | Private Attributes | Related Functions
vil_stream_fstream Class Reference

A vil_stream implementation using vcl_fstream. More...

#include <vil_stream_fstream.h>

Inheritance diagram for vil_stream_fstream:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 vil_stream_fstream (char const *filename, char const *mode)
bool ok () const
 Return false if the stream is broken.
vil_streampos write (void const *buf, vil_streampos n)
 Write n bytes from buf. Returns number of bytes written.
vil_streampos read (void *buf, vil_streampos n)
 Read n bytes into buf. Returns number of bytes read.
vil_streampos tell () const
 Return file pointer.
void seek (vil_streampos position)
 Goto file pointer.
vil_streampos file_size () const
 Amount of data in the stream.
void ref ()
 up/down the reference count.
void unref ()

Protected Member Functions

 ~vil_stream_fstream ()
vcl_fstream & underlying_stream ()

Private Attributes

vcl_ios_openmode flags_
vcl_fstream f_
int id_
vil_streampos end_

Related Functions

(Note that these are not member functions.)

vil_streamvil_open (char const *what, char const *how="r")
 make a vil_stream from a filename, an URL, etc.
float vil_stream_read_big_endian_float (vil_stream *is)
 Reads in a 4-byte big-endian float.
void vil_stream_read_big_endian_int_16 (vil_stream *is, vxl_uint_16 *data, unsigned n)
 Reads in n 16 bit unsigned ints.
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)

Detailed Description

A vil_stream implementation using vcl_fstream.

Definition at line 23 of file vil_stream_fstream.h.


Constructor & Destructor Documentation

vil_stream_fstream::vil_stream_fstream ( char const *  filename,
char const *  mode 
)

Definition at line 39 of file vil_stream_fstream.cxx.

vil_stream_fstream::~vil_stream_fstream ( ) [protected]

Definition at line 71 of file vil_stream_fstream.cxx.


Member Function Documentation

vil_streampos vil_stream_fstream::file_size ( ) const [virtual]

Amount of data in the stream.

Implements vil_stream.

Definition at line 198 of file vil_stream_fstream.cxx.

bool vil_stream_fstream::ok ( ) const [inline, virtual]

Return false if the stream is broken.

Implements vil_stream.

Definition at line 33 of file vil_stream_fstream.h.

vil_streampos vil_stream_fstream::read ( void *  buf,
vil_streampos  n 
) [virtual]

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 102 of file vil_stream_fstream.cxx.

void vil_stream::ref ( ) [inline, inherited]

up/down the reference count.

Definition at line 48 of file vil_stream.h.

void vil_stream_fstream::seek ( vil_streampos  position) [virtual]

Goto file pointer.

Implements vil_stream.

Definition at line 155 of file vil_stream_fstream.cxx.

vil_streampos vil_stream_fstream::tell ( ) const [virtual]

Return file pointer.

Implements vil_stream.

Definition at line 138 of file vil_stream_fstream.cxx.

vcl_fstream& vil_stream_fstream::underlying_stream ( ) [inline, protected]

Definition at line 45 of file vil_stream_fstream.h.

void vil_stream::unref ( ) [inherited]

Definition at line 31 of file vil_stream.cxx.

vil_streampos vil_stream_fstream::write ( void const *  buf,
vil_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 vil_stream.

Definition at line 76 of file vil_stream_fstream.cxx.


Friends And Related Function Documentation

vil_stream * vil_open ( char const *  what,
char const *  how = "r" 
) [related]

make a vil_stream from a filename, an URL, etc.

Definition at line 19 of file vil_open.cxx.

float vil_stream_read_big_endian_float ( vil_stream is) [related]

Reads in a 4-byte big-endian float.

Definition at line 109 of file vil_stream_read.cxx.

void vil_stream_read_big_endian_int_16 ( vil_stream is,
vxl_uint_16 *  data,
unsigned  n 
) [related]

Reads in n 16 bit unsigned ints.

Caller is responsible for allocating enough space.

Definition at line 121 of file vil_stream_read.cxx.

void vil_stream_write_big_endian_uint_16 ( vil_stream ,
vxl_uint_16   
) [related]

Definition at line 17 of file vil_stream_write.cxx.

void vil_stream_write_big_endian_uint_32 ( vil_stream ,
vxl_uint_32   
) [related]

Definition at line 33 of file vil_stream_write.cxx.

void vil_stream_write_little_endian_uint_16 ( vil_stream ,
vxl_uint_16   
) [related]

Definition at line 25 of file vil_stream_write.cxx.

void vil_stream_write_little_endian_uint_32 ( vil_stream ,
vxl_uint_32   
) [related]

Definition at line 43 of file vil_stream_write.cxx.


Member Data Documentation

Definition at line 50 of file vil_stream_fstream.h.

vcl_fstream vil_stream_fstream::f_ [mutable, private]

Definition at line 48 of file vil_stream_fstream.h.

vcl_ios_openmode vil_stream_fstream::flags_ [private]

Definition at line 47 of file vil_stream_fstream.h.

int vil_stream_fstream::id_ [private]

Definition at line 49 of file vil_stream_fstream.h.


The documentation for this class was generated from the following files: