NRE Software
(toggle)
Home
My work
Main Page
Namespaces
Classes
Files
File List
src
IO
FileStream
Input
Stream
NRE_InputStream.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
InputStream
{
32
public
:
// Methods
33
//## Constructor ##//
37
InputStream
() =
default
;
38
39
//## Copy-Constructor ##//
44
InputStream
(
InputStream
const
& i) =
delete
;
45
46
//## Move-Constructor ##//
51
InputStream
(
InputStream
&& i) =
default
;
52
53
//## Deconstructor ##//
57
virtual
~InputStream
() =
default
;
58
59
//## Getter ##//
63
virtual
std::fstream&
getStream
() = 0;
67
std::streampos
getPosition
();
68
69
//## Methods ##//
74
template
<
class
T>
75
void
read
(T&
object
) {
76
getStream
() >> object;
77
}
82
void
readLine
(Utility::String& line);
87
void
seekBegin
(
size_t
offset = 0);
92
void
seekEnd
(
size_t
offset = 0);
93
94
//## Assignment Operator ##//
100
InputStream
&
operator =
(
InputStream
const
& i) =
delete
;
106
InputStream
&
operator =
(
InputStream
&& i) =
default
;
107
};
108
}
109
}
110
111
#include "NRE_InputStream.tpp"
NRE::IO::InputStream::~InputStream
virtual ~InputStream()=default
NRE::IO::InputStream::getPosition
std::streampos getPosition()
IO
IO's API.
NRE::IO::InputStream::InputStream
InputStream()=default
NRE::IO::InputStream::getStream
virtual std::fstream & getStream()=0
NRE::IO::InputStream::readLine
void readLine(Utility::String &line)
NRE::IO::InputStream::seekBegin
void seekBegin(size_t offset=0)
NRE
The NearlyRealEngine's global namespace.
NRE::IO::InputStream::seekEnd
void seekEnd(size_t offset=0)
NRE::IO::InputStream
Base interface for input related stream.
Definition:
NRE_InputStream.hpp:31
NRE::IO::InputStream::operator=
InputStream & operator=(InputStream const &i)=delete
NRE::IO::InputStream::read
void read(T &object)
Definition:
NRE_InputStream.hpp:75