repo.or.cz
/
evolve-layout.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
WIP
[evolve-layout.git]
/
C
/
File.cpp
blob
cb183aa5513c6596af003c518e5c0ec714297517
1
#pragma once
2
3
#include <fstream>
4
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");
11
}
12
}
13
virtual
~
File
() {
14
this
->
_stream
.
close
();
15
}
16
17
std
::
fstream
&
stream
() {
18
return this
->
_stream
;
19
}
20
private
:
21
std
::
fstream _stream
;
22
// no copying
23
File
(
const
File
&);
24
File
&
operator
=(
const
File
&);
25
};