mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-11-10 10:59:21 +03:00
35 lines
635 B
C++
35 lines
635 B
C++
#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_
|