ReFRACtor
ifstream_cs.cc
Go to the documentation of this file.
1 #include "ifstream_cs.h"
2 #include <boost/iostreams/filter/gzip.hpp>
3 #include <boost/iostreams/filter/regex.hpp>
4 
5 using namespace FullPhysics;
6 
7 //-----------------------------------------------------------------------
10 //-----------------------------------------------------------------------
11 
12 IfstreamCs::IfstreamCs(const std::string& Fname, const std::string&
13  Comment_char)
14 : FilteringIstream(Fname)
15 {
16  sb.push(boost::iostreams::regex_filter(
17  boost::regex(Comment_char + ".*"),"",
18  boost::match_not_dot_newline));
19  if(boost::regex_search(Fname, boost::regex("\\.gz$")))
20  sb.push(boost::iostreams::gzip_decompressor());
21  sb.push(f);
22 }
boost::iostreams::filtering_istreambuf sb
Filtering streambuf.
std::ifstream f
Underlying ifstream.
IfstreamCs(const std::string &Fname, const std::string &Comment_start="#")
Open file to read, decompressing if necessary and filtering comments.
Definition: ifstream_cs.cc:12
This allows filtering stream to created on top of an underlying ifstream.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1

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