Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

File::stream Class Reference

base stream class. More...

Inheritance diagram for File::stream::

File::file_stream File::mem_stream List of all members.

Public Types

enum  Type { FILE_STREAM, MEM_STREAM }
 < stream type. More...


Public Methods

 stream (std::string name, std::ios_base::openmode mode, Type type)
virtual ~stream ()
bool is_valid () const
bool operator! () const
void operator++ ()
 increase the line number of the stream. More...

void operator-- ()
 decrease the line number of the stream. More...

std::iostream & get_io ()
 returns an iostream pointer. More...

template<class T> void operator<< (T t)
template<class T> void operator>> (T &t)
int get_refs () const
int add_ref ()
int sub_ref ()
std::string get_name () const
 returns the name of the stream. More...

std::ios_base::openmode get_mode () const
void set_mode (std::ios_base::openmode m)
virtual void trunc ()=0
 truncate the file. More...

int get_line () const
void set_line (int l)
void seekg (long pos)
long tellg ()
void seekp (long pos)
long tellp ()
int eof ()
std::ostream & flush ()
std::ostream & put (char c)
std::ostream & write (std::string s)
std::ostream & write (std::string s, std::streamsize n)
std::istream & get (char &c)
std::istream & read (char *ptr, std::streamsize n)
void clear ()
Type get_type ()

Protected Attributes

std::string name
bool valid
int line
int count
 reference counter. More...

std::iostream * io
std::ios_base::openmode mode
 open mode. More...

Type type

Detailed Description

base stream class.

A base wrapper class for std::iostream's. All functions will be forewarded to the io stream.


Member Enumeration Documentation

enum File::stream::Type
 

< stream type.

Enumeration values:
FILE_STREAM 
MEM_STREAM 


Constructor & Destructor Documentation

File::stream::stream std::string    name,
std::ios_base::openmode    mode,
Type    type
 

File::stream::~stream   [virtual]
 


Member Function Documentation

int File::stream::add_ref   [inline]
 

void File::stream::clear   [inline]
 

int File::stream::eof   [inline]
 

std::ostream& File::stream::flush   [inline]
 

std::istream& File::stream::get char &    c [inline]
 

std::iostream& File::stream::get_io   [inline]
 

returns an iostream pointer.

int File::stream::get_line   const [inline]
 

std::ios_base::openmode File::stream::get_mode   const [inline]
 

std::string File::stream::get_name   const [inline]
 

returns the name of the stream.

int File::stream::get_refs   const [inline]
 

Type File::stream::get_type   [inline]
 

bool File::stream::is_valid   const [inline]
 

bool File::stream::operator!   const [inline]
 

void File::stream::operator++   [inline]
 

increase the line number of the stream.

void File::stream::operator--   [inline]
 

decrease the line number of the stream.

template<class T>
void File::stream::operator<<   t [inline]
 

template<class T>
void File::stream::operator>> T &    t [inline]
 

std::ostream& File::stream::put char    c [inline]
 

std::istream& File::stream::read char *    ptr,
std::streamsize    n
[inline]
 

void File::stream::seekg long    pos [inline]
 

void File::stream::seekp long    pos [inline]
 

void File::stream::set_line int    l [inline]
 

void File::stream::set_mode std::ios_base::openmode    m [inline]
 

int File::stream::sub_ref   [inline]
 

long File::stream::tellg   [inline]
 

long File::stream::tellp   [inline]
 

virtual void File::stream::trunc   [pure virtual]
 

truncate the file.

Reimplemented in File::file_stream, and File::mem_stream.

std::ostream& File::stream::write std::string    s,
std::streamsize    n
[inline]
 

std::ostream& File::stream::write std::string    s [inline]
 


Member Data Documentation

int File::stream::count [protected]
 

reference counter.

std::iostream* File::stream::io [protected]
 

int File::stream::line [protected]
 

std::ios_base::openmode File::stream::mode [protected]
 

open mode.

std::string File::stream::name [protected]
 

Type File::stream::type [protected]
 

bool File::stream::valid [protected]
 


The documentation for this class was generated from the following files:
Generated on Tue Nov 20 02:20:01 2001 for Leo<HTML> by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001