ReFRACtor
fstream_compress.cc
Go to the documentation of this file.
1 #include "fstream_compress.h"
2 #include <boost/regex.hpp>
3 #include <boost/iostreams/filter/gzip.hpp>
4 
5 using namespace FullPhysics;
6 
7 //-----------------------------------------------------------------------
11 //-----------------------------------------------------------------------
12 
13 OstreamCompress::OstreamCompress(const std::string& Fname)
14  : FilteringOstream(Fname)
15 {
16  if(boost::regex_search(Fname, boost::regex("\\.gz$")))
17  sb.push(boost::iostreams::gzip_compressor());
18  sb.push(f);
19 }
20 
21 //-----------------------------------------------------------------------
28 //-----------------------------------------------------------------------
29 
30 IstreamCompress::IstreamCompress(const std::string& Fname)
31 : FilteringIstream(Fname)
32 {
33  if(boost::regex_search(Fname, boost::regex("\\.gz$")))
34  sb.push(boost::iostreams::gzip_decompressor());
35  sb.push(f);
36 }
OstreamCompress(const std::string &Fname)
This opens a file for writing, possibly with automatic compression.
boost::iostreams::filtering_istreambuf sb
Filtering streambuf.
std::ifstream f
Underlying ifstream.
boost::iostreams::filtering_ostreambuf sb
Filtering streambuf.
This allows filtering stream to created on top of an underlying ifstream.
This allows filtering stream to created on top of an underlying ofstream.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
IstreamCompress(const std::string &Fname)
This opens a file for reading, possibly with automatic decompression.
std::ofstream f
Underlying ofstream.

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:11