blob: afa8d9a290109091ee25856df19164aee43f1713 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#ifndef FILESTREAM_H_
#define FILESTREAM_H_
#include <fstream>
#include <streambuf>
#include <string>
class inputfilestream : public std::istream
{
protected:
std::streambuf *m_streambuf;
bool is_good;
public:
explicit inputfilestream(const std::string &filePath);
~inputfilestream();
bool good() const { return is_good; }
void close();
};
class outputfilestream : public std::ostream
{
protected:
std::streambuf *m_streambuf;
bool is_good;
public:
explicit outputfilestream(const std::string &filePath);
~outputfilestream();
bool good() const { return is_good; }
void close();
};
#endif // FILESTREAM_H_
|