new struct `finger_cost`
[evolve-layout.git] / C / File.cpp
blobcb183aa5513c6596af003c518e5c0ec714297517
1 #pragma once
3 #include <fstream>
5 class File {
6 public:
7 File(const std::string &name)
8 : _stream(name.c_str()) {
9 if(!_stream.is_open()) {
10 //throw new std::runtime_error("Error opening file");
13 virtual ~File() {
14 this->_stream.close();
17 std::fstream &stream() {
18 return this->_stream;
20 private:
21 std::fstream _stream;
22 // no copying
23 File(const File &);
24 File &operator=(const File &);