00001 // This is core/vil1/vil1_stream_fstream.h 00002 #ifndef vil1_stream_fstream_h_ 00003 #define vil1_stream_fstream_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \brief A vil1_stream implementation using vcl_fstream 00010 // \author awf@robots.ox.ac.uk 00011 // \date 16 Feb 00 00012 00013 #include <vcl_fstream.h> 00014 #include <vil1/vil1_stream.h> 00015 00016 //: A vil1_stream implementation using vcl_fstream 00017 class vil1_stream_fstream : public vil1_stream 00018 { 00019 public: 00020 vil1_stream_fstream(char const* filename, char const* mode); 00021 00022 // implement virtual vil1_stream interface: 00023 bool ok() const { return f_.good(); } 00024 vil1_streampos write(void const* buf, vil1_streampos n); 00025 vil1_streampos read(void* buf, vil1_streampos n); 00026 vil1_streampos tell() const; 00027 void seek(vil1_streampos position); 00028 00029 protected: 00030 ~vil1_stream_fstream(); 00031 00032 private: 00033 vcl_ios_openmode flags_; 00034 mutable vcl_fstream f_; 00035 int id_; 00036 }; 00037 00038 #endif // vil1_stream_fstream_h_
1.5.1