Open Babel  3.0
Public Member Functions | List of all members
FilteringInputStreambuf< Extractor > Class Template Reference

#include <openbabel/lineend.h>

Inheritance diagram for FilteringInputStreambuf< Extractor >:
FilteringInputStream< Extractor >

Public Member Functions

 FilteringInputStreambuf (std::istream *source=NULL)
 
virtual ~FilteringInputStreambuf ()
 
virtual int overflow (int)
 
virtual int underflow ()
 
virtual int sync ()
 
virtual std::streampos seekoff (std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 
virtual std::streampos seekpos (std::streampos sp, std::ios_base::openmode which=std::ios_base::in|std::ios_base::out)
 
std::istream * GetSource () const
 
void SetSource (std::istream *newsource)
 

Detailed Description

template<class Extractor>
class OpenBabel::FilteringInputStreambuf< Extractor >

Delivers characters from an istream or streambuf from a source while filtering.

Based on an article by James Kanze, "Filtering Streambufs" http://kanze.james.neuf.fr/articles/fltrsbf1.html

A FilteringInputStreambuf delivers characters on request to an istream or a destination rdbuf(). It receives them from a source rdbuf. In doing the transfer it filters them in a way decided by the class specified in template parameter Extractor.

seekg and tellg requests from the stream are passed through to source rdbuf. This allows return to a position in the input data that was previously noted. This is adequate to allow OpenBabel's fastsearch indexing, but may not be good enough for some other applications that use random access.

A class LineEndingExtractor converts DOS and MAC line endings to the UNIX line ending.

This filtering process is potentially extendable, with a chain of FilteringInputStreambufs each carrying out its filtering task. For instance a decompression streambuf could feed a LineEnding filter, which in tern was read by an input stream.

Constructor & Destructor Documentation

◆ FilteringInputStreambuf()

FilteringInputStreambuf ( std::istream *  source = NULL)

◆ ~FilteringInputStreambuf()

virtual ~FilteringInputStreambuf ( )
inlinevirtual

Member Function Documentation

◆ overflow()

virtual int overflow ( int  )
inlinevirtual

◆ underflow()

int underflow ( )
virtual

◆ sync()

int sync ( )
virtual

◆ seekoff()

virtual std::streampos seekoff ( std::streamoff  off,
std::ios_base::seekdir  way,
std::ios_base::openmode  which = std::ios_base::in | std::ios_base::out 
)
inlinevirtual

◆ seekpos()

virtual std::streampos seekpos ( std::streampos  sp,
std::ios_base::openmode  which = std::ios_base::in | std::ios_base::out 
)
inlinevirtual

◆ GetSource()

std::istream* GetSource ( ) const
inline

Returns current source.

◆ SetSource()

void SetSource ( std::istream *  newsource)
inline

Changes the source.


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