bpp-popgen3  3.0.0
AbstractIDataSet.cpp
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #include "AbstractIDataSet.h"
6 
7 using namespace bpp;
8 
9 // From STL
10 #include <fstream>
11 
12 using namespace std;
13 
15 
16 void AbstractIDataSet::read(const std::string& path, DataSet& data_set)
17 {
18  ifstream input(path.c_str(), ios::in);
19  read(input, data_set);
20  input.close();
21 }
22 
23 DataSet* AbstractIDataSet::read(std::istream& is)
24 {
25  DataSet* data_set = new DataSet();
26  read(is, *data_set);
27  return data_set;
28 }
29 
30 DataSet* AbstractIDataSet::read(const std::string& path)
31 {
32  DataSet* data_set = new DataSet();
33  read(path, *data_set);
34  return data_set;
35 }
virtual void read(std::istream &is, DataSet &data_set)=0
Read a DataSet on istream.
The DataSet class.
Definition: DataSet.h:37