Belle II Software  release-08-01-10
FileContext Class Reference

InputContext which serves the content of a plain file. More...

#include <FileHandler.h>

Inheritance diagram for FileContext:
Collaboration diagram for FileContext:

Public Member Functions

 FileContext (const std::string &filename, bool compressed)
 Open the given filename. More...
 
virtual int readXmlData (char *buffer, int buffsize) override
 Return a block of the data.
 
virtual ~FileContext ()
 Close the file.
 

Protected Attributes

boost::iostreams::filtering_istream m_stream
 stream to read data from
 

Detailed Description

InputContext which serves the content of a plain file.

Definition at line 23 of file FileHandler.h.

Constructor & Destructor Documentation

◆ FileContext()

FileContext ( const std::string &  filename,
bool  compressed 
)

Open the given filename.

Parameters
filenameabsolute filename name of the file
compressedif true, decompress the file on the fly

Definition at line 28 of file FileHandler.cc.

29  {
30  B2DEBUG(100, "Opening " << filename << (compressed ? " (gzip)" : ""));
31  if (compressed) m_stream.push(io::gzip_decompressor());
32  m_stream.push(io::file_source(filename));
33  }
boost::iostreams::filtering_istream m_stream
stream to read data from
Definition: FileHandler.h:40

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