yat  0.21pre
VcfFile.h
1 #ifndef theplu_yat_omic_vcf_file
2 #define theplu_yat_omic_vcf_file
3 
4 // $Id: VcfFile.h 4207 2022-08-26 04:36:28Z peter $
5 
6 /*
7  Copyright (C) 2018, 2019, 2020, 2021 Peter Johansson
8 
9  This file is part of the yat library, http://dev.thep.lu.se/yat
10 
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 3 of the
14  License, or (at your option) any later version.
15 
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with yat. If not, see <http://www.gnu.org/licenses/>.
23 */
24 
25 #include "VcfHeader.h"
26 
27 #include <boost/noncopyable.hpp>
28 #include <boost/iostreams/filtering_stream.hpp>
29 
30 #include <fstream>
31 #include <memory>
32 #include <string>
33 
34 namespace theplu {
35 namespace yat {
36 namespace omic {
37 
38  class VCF;
39 
43  class VcfFile : private boost::noncopyable
44  {
45  public:
49  VcfFile(void);
50 
56  explicit VcfFile(const std::string& fn);
57 
61  void close(void);
62 
69  bool good(void) const;
70 
74  bool is_open(void) const;
75 
90  void open(const std::string& fn);
91 
99  bool read(VCF& vcf);
100 
109  VcfHeader& header(void);
110 
116  const VcfHeader& header(void) const;
117  private:
118  std::unique_ptr<VcfHeader> header_;
119  boost::iostreams::filtering_istream fis_;
120  // store here for easy garbage collection
121  std::unique_ptr<std::ifstream> file_stream_;
122  std::string name_;
123  friend class VcfIterator;
124  };
125 
126 }}}
127 
128 #endif
Definition: VCF.h:49
bool is_open(void) const
VcfFile(void)
default constructor
The Department of Theoretical Physics namespace as we define it.
void close(void)
close file
Definition: VcfHeader.h:34
VcfHeader & header(void)
Definition: VcfFile.h:43
Definition: VcfIterator.h:42
void open(const std::string &fn)
open file named fn

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14