.. _program_listing_file__tmp_ws_src_ecl_core_ecl_streams_include_ecl_streams_file_streams.hpp: Program Listing for File file_streams.hpp ========================================= |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/ecl_core/ecl_streams/include/ecl/streams/file_streams.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /***************************************************************************** ** Ifdefs *****************************************************************************/ #ifndef ECL_STREAMS_FILE_STREAM_HPP_ #define ECL_STREAMS_FILE_STREAM_HPP_ /***************************************************************************** ** Includes *****************************************************************************/ #include #include #include #include #include "text_stream.hpp" /***************************************************************************** ** Namespaces *****************************************************************************/ namespace ecl { /***************************************************************************** ** Interfaces [OFileStream] *****************************************************************************/ class ecl_streams_PUBLIC OFileStream : public TextStream { public: OFileStream() {}; OFileStream(const std::string &file_name, const WriteMode &mode = New) { ecl_try { if( !this->device().open(file_name, mode) ) { error = this->device().error(); } } ecl_catch(StandardException &e) { ecl_throw(StandardException(LOC,e)); } } virtual ~OFileStream() {}; }; } // namespace ecl #endif /* ECL_STREAMS_FILE_STREAM_HPP_ */