base_text_stream.hpp
Go to the documentation of this file.
1 
8 /*****************************************************************************
9 ** Ifdefs
10 *****************************************************************************/
11 
12 #ifndef ECL_STREAMS_BASE_TEXT_STREAM_HPP_
13 #define ECL_STREAMS_BASE_TEXT_STREAM_HPP_
14 
15 /*****************************************************************************
16 ** Includes
17 *****************************************************************************/
18 
19 #include <ecl/config/macros.hpp>
20 #include <ecl/errors/handlers.hpp>
21 #include "../macros.hpp"
22 
23 /*****************************************************************************
24 ** Namespaces
25 *****************************************************************************/
26 
27 namespace ecl {
28 namespace interfaces {
29 
30 /*****************************************************************************
31 ** Interface [BaseTextStream]
32 *****************************************************************************/
42 template <typename Device>
44 public:
45  BaseTextStream() : error(ecl::NoError) {};
46  virtual ~BaseTextStream() {}
47  Device& device();
48  bool fail() const;
49  const ecl::Error& errorStatus() const;
50 
51 protected:
53  Device io_device;
54 };
55 
56 /*****************************************************************************
57 ** Implementation [BaseTextStream]
58 *****************************************************************************/
65 template <typename Device>
66 Device& BaseTextStream<Device>::device() { return io_device; }
67 
77 template <typename Device>
79  if ( error.flag() != ecl::NoError ) {
80  return true;
81  } else {
82  return false;
83  }
84 }
93 template <typename Device>
95  return error;
96 }
97 
98 } // namespace interfaces
99 } // namespace ecl
100 
101 #endif /* ECL_STREAMS_BASE_TEXT_STREAM_HPP_ */
Parent class for text stream functionality.
bool fail() const
Denotes the status of the last device operation.
Device & device()
Provides access to the underlying output device.
const ecl::Error & errorStatus() const
Enumeration indicating the exit status of the last read operation.
#define ECL_PUBLIC


ecl_streams
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:08:50