00001 #ifndef MERT_FILE_STREAM_H_ 00002 #define MERT_FILE_STREAM_H_ 00003 00004 #include <fstream> 00005 #include <iostream> 00006 #include <streambuf> 00007 #include <string> 00008 00009 class inputfilestream : public std::istream 00010 { 00011 protected: 00012 std::streambuf *m_streambuf; 00013 bool m_is_good; 00014 00015 public: 00016 explicit inputfilestream(const std::string &filePath); 00017 virtual ~inputfilestream(); 00018 00019 bool good() const { 00020 return m_is_good; 00021 } 00022 void close(); 00023 }; 00024 00025 #endif // MERT_FILE_STREAM_H_