base_text_stream.hpp
Go to the documentation of this file.
00001 
00008 /*****************************************************************************
00009 ** Ifdefs
00010 *****************************************************************************/
00011 
00012 #ifndef ECL_STREAMS_BASE_TEXT_STREAM_HPP_
00013 #define ECL_STREAMS_BASE_TEXT_STREAM_HPP_
00014 
00015 /*****************************************************************************
00016 ** Includes
00017 *****************************************************************************/
00018 
00019 #include <ecl/config/macros.hpp>
00020 #include <ecl/errors/handlers.hpp>
00021 #include "../macros.hpp"
00022 
00023 /*****************************************************************************
00024 ** Namespaces
00025 *****************************************************************************/
00026 
00027 namespace ecl {
00028 namespace interfaces {
00029 
00030 /*****************************************************************************
00031 ** Interface [BaseTextStream]
00032 *****************************************************************************/
00042 template <typename Device>
00043 class ECL_PUBLIC BaseTextStream {
00044 public:
00045         BaseTextStream() : error(ecl::NoError) {};
00046         virtual ~BaseTextStream() {}
00047     Device& device();
00048     bool fail() const;
00049     const ecl::Error& errorStatus() const;
00050 
00051 protected:
00052     ecl::Error error;
00053         Device io_device;
00054 };
00055 
00056 /*****************************************************************************
00057 ** Implementation [BaseTextStream]
00058 *****************************************************************************/
00065 template <typename Device>
00066 Device& BaseTextStream<Device>::device() { return io_device; }
00067 
00077 template <typename Device>
00078 bool BaseTextStream<Device>::fail() const {
00079         if ( error.flag() != ecl::NoError ) {
00080                 return true;
00081         } else {
00082                 return false;
00083         }
00084 }
00093 template <typename Device>
00094 const ecl::Error& BaseTextStream<Device>::errorStatus() const {
00095         return error;
00096 }
00097 
00098 } // namespace interfaces
00099 } // namespace ecl
00100 
00101 #endif /* ECL_STREAMS_BASE_TEXT_STREAM_HPP_ */


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