5namespace StevEngine::Resources {
9namespace StevEngine::Utilities {
47 template <
typename T> T
Read();
54 template <
typename T>
void Write(
const T& data);
101 operator std::stringstream&() {
return stream; }
107 const std::stringstream&
GetStream()
const {
return stream; }
108 operator const std::stringstream&()
const {
return stream; }
118 std::stringstream stream;
Container for loaded resource data.
Definition ResourceManager.hpp:11
T Read()
Read data of specified type from stream.
void Write(const T &data)
Write data of specified type to stream.
Stream & operator>>(T &out)
Read data of specified type from stream.
Definition Stream.hpp:71
bool ReadFromFile(const Resources::Resource &file)
Read content from a file to stream.
Definition Stream.cpp:17
void WriteToFile(const char *path) const
Write full stream content to a file.
Definition Stream.cpp:10
Stream(StreamType type=Binary)
Create new stream of type.
Definition Stream.hpp:30
std::stringstream & GetStream()
Get underlying std::stringstream object.
Definition Stream.hpp:100
const StreamType type
Type of serialization used by stream.
Definition Stream.hpp:24
Stream(const Stream &stream)
make a copy of a stream
Definition Stream.hpp:114
const std::stringstream & GetStream() const
Get underlying std::stringstream object.
Definition Stream.hpp:107
Stream(const T &data, StreamType type=Binary)
Create new stream of type, with data already added.
Definition Stream.hpp:37
Stream & operator<<(const T &data)
Write data of specified type to stream.
Definition Stream.hpp:62