file_streams.hpp
Go to the documentation of this file.
00001 
00008 /*****************************************************************************
00009 ** Ifdefs
00010 *****************************************************************************/
00011 
00012 #ifndef ECL_STREAMS_FILE_STREAM_HPP_
00013 #define ECL_STREAMS_FILE_STREAM_HPP_
00014 
00015 /*****************************************************************************
00016 ** Includes
00017 *****************************************************************************/
00018 
00019 #include <string>
00020 #include <ecl/config/macros.hpp>
00021 #include <ecl/devices/ofile.hpp>
00022 #include <ecl/exceptions/standard_exception.hpp>
00023 #include "text_stream.hpp"
00024 
00025 /*****************************************************************************
00026 ** Namespaces
00027 *****************************************************************************/
00028 
00029 namespace ecl {
00030 
00031 /*****************************************************************************
00032 ** Interfaces [OFileStream]
00033 *****************************************************************************/
00042 class ecl_streams_PUBLIC OFileStream : public TextStream<OFile> {
00043 public:
00050         OFileStream() {};
00051 
00063         OFileStream(const std::string &file_name, const WriteMode &mode = New) ecl_throw_decl(StandardException) {
00064                 ecl_try {
00065                         if( !this->device().open(file_name, mode) ) {
00066                                 error = this->device().error();
00067                         }
00068                 } ecl_catch(StandardException &e) {
00069                         ecl_throw(StandardException(LOC,e));
00070                 }
00071         }
00072 
00073         virtual ~OFileStream() {};
00074 };
00075 
00076 } // namespace ecl
00077 
00078 #endif /* ECL_STREAMS_FILE_STREAM_HPP_ */


ecl_streams
Author(s): Daniel Stonier
autogenerated on Sun Oct 5 2014 23:36:00