cMHN 1.0
C++ library for learning MHNs with pRC
read_header.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef cMHN_UTILITY_READ_HEADER_H
4#define cMHN_UTILITY_READ_HEADER_H
5
6#include <sstream>
7#include <string>
8
9namespace cMHN
10{
16 static inline auto readHeader(std::string const &filename)
17 {
18 std::ifstream file(filename);
19
20 if(!file.is_open())
21 {
22 pRC::Logging::error("Unable to open input file!");
23 }
24
25 std::string line;
26 std::getline(file, line);
27
28 return line;
29 }
30}
31
32#endif // cMHN_UTILITY_READ_HEADER_H
Definition: calculate_pTheta.hpp:15
static auto readHeader(std::string const &filename)
Reads the header of a dataset from file.
Definition: read_header.hpp:16