Loading...
Searching...
No Matches
FilteringInputStreambuf< Extractor > Class Template Reference

`#include <openbabel/lineend.h>`

Inheritance diagram for FilteringInputStreambuf< Extractor >:
[legend]

## Public Member Functions

| FilteringInputStreambuf (std::istream *source=nullptr)
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()

template<class Extractor>

FilteringInputStreambuf | ( | std::istream * | source = nullptr | ) |

Referenced by FilteringInputStream< LineEndingExtractor >::FilteringInputStream().

## ~FilteringInputStreambuf()

template<class Extractor>

virtual ~FilteringInputStreambuf | ( |  | ) |

inline virtual

## Member Function Documentation

## overflow()

template<class Extractor>

virtual int overflow | ( | int |  | ) |

inline virtual

## underflow()

template<class Extractor>

int underflow | ( |  | ) |

virtual

## sync()

template<class Extractor>

int sync | ( |  | ) |

virtual

## seekoff()

template<class Extractor>

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 )

inline virtual

## seekpos()

template<class Extractor>

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

inline virtual

## GetSource()

template<class Extractor>

std::istream * GetSource | ( |  | ) | const

inline

Returns current source.

## SetSource()

template<class Extractor>

void SetSource | ( | std::istream * | newsource | ) |

inline

Changes the source.

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

- lineend.h