00001 /* Copyright (c) 2006, Gennady Bystritsky <bystr@mac.com> 00002 * 00003 * Distributed under the MIT Licence. 00004 * This is free software. See 'LICENSE' for details. 00005 * You must read and accept the license prior to use. 00006 */ 00007 00008 #ifndef _SK_IO_FILESTREAMCOUPLER_HXX_ 00009 #define _SK_IO_FILESTREAMCOUPLER_HXX_ 00010 00011 #include <sk/io/File.h> 00012 #include <sk/util/Holder.hxx> 00013 #include <memory> 00014 00015 namespace sk { 00016 namespace io { 00017 template<class Stream> 00018 class FileStreamCoupler 00019 : public Stream 00020 { 00021 public: 00022 FileStreamCoupler(std::auto_ptr<sk::io::File> file_auto_ptr); 00023 00024 sk::io::File& getFile() const; 00025 00026 private: 00027 FileStreamCoupler(const FileStreamCoupler& other); 00028 FileStreamCoupler& operator = (const FileStreamCoupler& other); 00029 00030 sk::util::Holder<sk::io::File> _fileHolder; 00031 }; 00032 } 00033 } 00034 00035 #endif /* _SK_IO_FILESTREAMCOUPLER_HXX_ */