blob: 3fd489cd74943c2a3deb3d70a1757f5049516fdc (
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
35
36
37
|
#ifndef MERT_FILE_STREAM_H_
#define MERT_FILE_STREAM_H_
#include <fstream>
#include <iostream>
#include <streambuf>
#include <string>
class inputfilestream : public std::istream
{
protected:
std::streambuf *m_streambuf;
bool m_is_good;
public:
explicit inputfilestream(const std::string &filePath);
virtual ~inputfilestream();
bool good() const { return m_is_good; }
void close();
};
class outputfilestream : public std::ostream
{
protected:
std::streambuf *m_streambuf;
bool m_is_good;
public:
explicit outputfilestream(const std::string &filePath);
virtual ~outputfilestream();
bool good() const { return m_is_good; }
void close();
};
#endif // MERT_FILE_STREAM_H_
|