cartobase  4.5.0
carto::cuifstream Class Reference

Filtering ifstream - counts lines and skips comments. More...

#include <cartobase/stream/cuifstream.h>

Inheritance diagram for carto::cuifstream:
Collaboration diagram for carto::cuifstream:

Public Types

typedef std::ios_base::openmode openmode
 open modes are not a standard type in C++, they changed from int in g++ 2.9x to std::ios_base::openmode in gcc 3.x More...
 

Public Member Functions

Open, close
virtual void open (const char *name, openmode mode=in)
 
virtual void close ()
 
Count
int line () const
 Get the current line number. More...
 
Stream state
virtual bool operator! () const
 Return the state of both associated streams. More...
 
virtual bool is_open () const
 Is the ifstream open? More...
 
void enableUncomment (bool)
 
bool uncommentEnabled () const
 
virtual bool eof () const
 

Protected Attributes

Data
std::ifstream _base
 
fistreambuf< CounterExtractor > * _counter
 
fistreambuf< UncommentExtractor > * _uncomment
 
bool _enableuncomment
 

Constructors, destructor

 cuifstream ()
 
 cuifstream (const char *name, openmode mode=in)
 
virtual ~cuifstream ()
 
virtual void init_buffers ()
 
virtual void destroy_buffers ()
 

Detailed Description

Filtering ifstream - counts lines and skips comments.

Definition at line 63 of file cuifstream.h.

Member Typedef Documentation

typedef std::ios_base::openmode carto::cuifstream::openmode

open modes are not a standard type in C++, they changed from int in g++ 2.9x to std::ios_base::openmode in gcc 3.x

Definition at line 72 of file cuifstream.h.

Constructor & Destructor Documentation

carto::cuifstream::cuifstream ( )
carto::cuifstream::cuifstream ( const char *  name,
openmode  mode = in 
)
virtual carto::cuifstream::~cuifstream ( )
virtual

Member Function Documentation

virtual void carto::cuifstream::close ( )
virtual

Reimplemented in carto::attachable_cuifstream.

virtual void carto::cuifstream::destroy_buffers ( )
protectedvirtual

Reimplemented in carto::attachable_cuifstream.

void carto::cuifstream::enableUncomment ( bool  )
virtual bool carto::cuifstream::eof ( ) const
virtual
virtual void carto::cuifstream::init_buffers ( )
protectedvirtual

Reimplemented in carto::attachable_cuifstream.

virtual bool carto::cuifstream::is_open ( ) const
virtual

Is the ifstream open?

Reimplemented in carto::attachable_cuifstream.

int carto::cuifstream::line ( ) const
inline

Get the current line number.

Returns
current line number

Definition at line 160 of file cuifstream.h.

References _counter.

virtual void carto::cuifstream::open ( const char *  name,
openmode  mode = in 
)
virtual
virtual bool carto::cuifstream::operator! ( ) const
virtual

Return the state of both associated streams.

Reimplemented in carto::attachable_cuifstream.

bool carto::cuifstream::uncommentEnabled ( ) const
inline

Definition at line 122 of file cuifstream.h.

Member Data Documentation

std::ifstream carto::cuifstream::_base
mutableprotected

Definition at line 144 of file cuifstream.h.

fistreambuf<CounterExtractor>* carto::cuifstream::_counter
protected

Definition at line 146 of file cuifstream.h.

Referenced by line().

bool carto::cuifstream::_enableuncomment
protected

Definition at line 148 of file cuifstream.h.

fistreambuf<UncommentExtractor>* carto::cuifstream::_uncomment
protected

Definition at line 147 of file cuifstream.h.


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