NRE_OutputStream.hpp
Go to the documentation of this file.
1 
10  #pragma once
11 
12  #include <fstream>
13 
14  #include <Header/NRE_Utility.hpp>
15 
20  namespace NRE {
25  namespace IO {
26 
31  class OutputStream {
32  public: // Methods
33  //## Constructor ##//
37  OutputStream() = default;
38 
39  //## Copy-Constructor ##//
44  OutputStream(OutputStream const& o) = delete;
45 
46  //## Move-Constructor ##//
51  OutputStream(OutputStream && o) = default;
52 
53  //## Deconstructor ##//
57  virtual ~OutputStream() = default;
58 
59  //## Getter ##//
63  virtual std::fstream& getStream() = 0;
67  std::streampos getPosition();
68 
69  //## Methods ##//
74  template <class T>
75  void write(T const& object) {
76  getStream() << object;
77  }
82  void seekBegin(size_t offset = 0);
87  void seekEnd(size_t offset = 0);
88 
89  //## Assignment Operator ##//
95  OutputStream& operator =(OutputStream const& o) = delete;
101  OutputStream& operator =(OutputStream && o) = default;
102  };
103  }
104  }
105 
106  #include "NRE_OutputStream.tpp"
void seekEnd(size_t offset=0)
void write(T const &object)
Definition: NRE_OutputStream.hpp:75
IO&#39;s API.
OutputStream & operator=(OutputStream const &o)=delete
virtual std::fstream & getStream()=0
Base interface for output related stream.
Definition: NRE_OutputStream.hpp:31
The NearlyRealEngine&#39;s global namespace.
virtual ~OutputStream()=default
std::streampos getPosition()
void seekBegin(size_t offset=0)