![]() |
Gorgon Game Engine
|
Classes | |
class | MemoryInputBuffer |
This class is an input only memory stream buffer. More... | |
class | MemoryInputStream |
Functions | |
template<class T_ > | |
void | ReadArray (std::istream &stream, T_ *data, unsigned long size) |
Reads an array from the stream. More... | |
bool | ReadBool (std::istream &stream) |
Reads a boolean value. In resource 1.0, booleans are stored as 32bit integers. More... | |
double | ReadDouble (std::istream &stream) |
Reads a 64 bit IEEE double precision floating point number from the stream. More... | |
template<class E_ > | |
E_ | ReadEnum32 (std::istream &stream) |
Reads an enumeration that is saved as 32bit integer. More... | |
float | ReadFloat (std::istream &stream) |
Reads a 32 bit IEEE floating point number from the stream. More... | |
SGuid | ReadGuid (std::istream &stream) |
Reads a GUID from the given stream. More... | |
int | ReadInt16 (std::istream &stream) |
Reads a 16-bit integer from the stream. More... | |
long | ReadInt32 (std::istream &stream) |
Reads a 32-bit integer from the stream. More... | |
char | ReadInt8 (std::istream &stream) |
Reads an 8-bit integer from the stream. More... | |
Geometry::Point | ReadPoint (std::istream &stream) |
Geometry::Pointf | ReadPointf (std::istream &stream) |
Graphics::RGBA | ReadRGBA (std::istream &stream) |
Reads a RGBA color, R will be read first. More... | |
Graphics::RGBAf | ReadRGBAf (std::istream &stream) |
Reads a RGBAf color, R will be read first. More... | |
Geometry::Size | ReadSize (std::istream &stream) |
std::string | ReadString (std::istream &stream) |
Reads a string from a given stream. More... | |
std::string | ReadString (std::istream &stream, unsigned long size) |
Reads a string with the given size. More... | |
unsigned | ReadUInt16 (std::istream &stream) |
Reads a 16-bit unsigned integer from the stream. More... | |
unsigned long | ReadUInt32 (std::istream &stream) |
Reads a 32-bit unsigned integer from the stream. More... | |
Byte | ReadUInt8 (std::istream &stream) |
Reads an 8-bit unsigned integer from the stream. More... | |
template<class T_ > | |
void | WriteArray (std::ostream &stream, const T_ *data, unsigned long size) |
Writes an array to the stream. More... | |
void | WriteBool (std::ostream &stream, bool value) |
Writes a boolean value. In resource 1.0, booleans are stored as 32bit integers. More... | |
void | WriteDouble (std::ostream &stream, double value) |
Writes a 64 bit IEEE double precision floating point number from the stream. More... | |
template<class E_ > | |
void | WriteEnum32 (std::ostream &stream, E_ v) |
Writes an enumeration as a 32-bit integer. More... | |
void | WriteFloat (std::ostream &stream, float value) |
Writes a 32 bit IEEE floating point number from the stream. More... | |
void | WriteGuid (std::ostream &stream, const SGuid &value) |
Writes a GUID from the given stream. More... | |
void | WriteInt16 (std::ostream &stream, int value) |
Writes a 16-bit integer from the stream. More... | |
void | WriteInt32 (std::ostream &stream, long value) |
Writes a 32-bit integer to the stream. More... | |
void | WriteInt8 (std::ostream &stream, char value) |
Writes an 8-bit integer from the stream. More... | |
void | WritePoint (std::ostream &stream, Geometry::Point p) |
Saves the point as two consecutive 32bit integers. More... | |
template<class F_ = Float> | |
std::enable_if< std::is_same< F_, float >::value, void >::type | WritePointf (std::ostream &stream, Geometry::Pointf p) |
Saves the point as two consecutive floats. This function will not work if float type is double. More... | |
void | WriteRGBA (std::ostream &stream, Graphics::RGBA value) |
Writes a RGBA color, R will be saved first. More... | |
void | WriteRGBAf (std::ostream &stream, Graphics::RGBAf value) |
Writes a RGBAf color, R will be saved first. More... | |
void | WriteSize (std::ostream &stream, Geometry::Size s) |
Saves the size as two consecutive 32bit integers. More... | |
void | WriteString (std::ostream &stream, const std::string &value) |
Writes a string without its size. More... | |
void | WriteStringWithSize (std::ostream &stream, const std::string &value) |
Writes a string from a given stream. More... | |
void | WriteUInt16 (std::ostream &stream, unsigned value) |
Writes a 16-bit unsigned integer from the stream. More... | |
void | WriteUInt32 (std::ostream &stream, unsigned long value) |
Writes a 32-bit unsigned integer from the stream. More... | |
void | WriteUInt8 (std::ostream &stream, Byte value) |
Writes an 8-bit unsigned integer from the stream. More... | |
template<class T_ > | |
void | WriteVector (std::ostream &stream, const std::vector< T_ > &data) |
Writes a vector to the stream. More... | |
void Gorgon::IO::ReadArray | ( | std::istream & | stream, |
T_ * | data, | ||
unsigned long | size | ||
) |
Reads an array from the stream.
Array type should be a fixed size construct (ie. a byte, int32_t), otherwise a mismatch between binary formats will cause trouble.
data | is the data to be read from the stream |
size | is the number of elements to be read |
bool Gorgon::IO::ReadBool | ( | std::istream & | stream | ) |
Reads a boolean value. In resource 1.0, booleans are stored as 32bit integers.
References ReadInt32().
double Gorgon::IO::ReadDouble | ( | std::istream & | stream | ) |
Reads a 64 bit IEEE double precision floating point number from the stream.
This function only works on systems that have native 64 bit doubles.
E_ Gorgon::IO::ReadEnum32 | ( | std::istream & | stream | ) |
Reads an enumeration that is saved as 32bit integer.
float Gorgon::IO::ReadFloat | ( | std::istream & | stream | ) |
Reads a 32 bit IEEE floating point number from the stream.
This function only works on systems that that have native 32 bit floats.
SGuid Gorgon::IO::ReadGuid | ( | std::istream & | stream | ) |
Reads a GUID from the given stream.
References Gorgon::Resource::GID::SGuid.
int Gorgon::IO::ReadInt16 | ( | std::istream & | stream | ) |
Reads a 16-bit integer from the stream.
An int is at least 16 bits, could be more however, only 2 bytes will be read from the stream
long Gorgon::IO::ReadInt32 | ( | std::istream & | stream | ) |
Reads a 32-bit integer from the stream.
A long is at least 32 bits, could be more however, only 4 bytes will be read from the stream
char Gorgon::IO::ReadInt8 | ( | std::istream & | stream | ) |
Reads an 8-bit integer from the stream.
A char is at least 8 bits, could be more however, only 1 byte will be read from the stream
Geometry::Point Gorgon::IO::ReadPoint | ( | std::istream & | stream | ) |
References ReadInt32().
Geometry::Pointf Gorgon::IO::ReadPointf | ( | std::istream & | stream | ) |
References ReadFloat().
Graphics::RGBA Gorgon::IO::ReadRGBA | ( | std::istream & | stream | ) |
Reads a RGBA color, R will be read first.
References RGBA::A, RGBA::B, RGBA::G, RGBA::R, and ReadUInt8().
Graphics::RGBAf Gorgon::IO::ReadRGBAf | ( | std::istream & | stream | ) |
Reads a RGBAf color, R will be read first.
References RGBAf::A, RGBAf::B, RGBAf::G, RGBAf::R, and ReadFloat().
Geometry::Size Gorgon::IO::ReadSize | ( | std::istream & | stream | ) |
References ReadInt32().
std::string Gorgon::IO::ReadString | ( | std::istream & | stream | ) |
Reads a string from a given stream.
Assumes the size of the string is appended before the string as 32-bit unsigned value.
References ReadUInt32().
std::string Gorgon::IO::ReadString | ( | std::istream & | stream, |
unsigned long | size | ||
) |
Reads a string with the given size.
unsigned Gorgon::IO::ReadUInt16 | ( | std::istream & | stream | ) |
Reads a 16-bit unsigned integer from the stream.
An unsigned int is at least 16 bits, could be more however, only 2 bytes will be read from the stream
unsigned long Gorgon::IO::ReadUInt32 | ( | std::istream & | stream | ) |
Reads a 32-bit unsigned integer from the stream.
An unsigned long is at least 32 bits, could be more however, only 4 bytes will be read from the stream
Byte Gorgon::IO::ReadUInt8 | ( | std::istream & | stream | ) |
Reads an 8-bit unsigned integer from the stream.
A char is at least 8 bits, could be more however, only 1 byte will be read from the stream
void Gorgon::IO::WriteArray | ( | std::ostream & | stream, |
const T_ * | data, | ||
unsigned long | size | ||
) |
Writes an array to the stream.
Array type should be a fixed size construct (ie. a byte, int32_t), otherwise a mismatch between binary formats will cause trouble.
data | is the data to be written to the stream |
size | is the number of elements to be write |
void Gorgon::IO::WriteBool | ( | std::ostream & | stream, |
bool | value | ||
) |
Writes a boolean value. In resource 1.0, booleans are stored as 32bit integers.
References WriteInt32().
void Gorgon::IO::WriteDouble | ( | std::ostream & | stream, |
double | value | ||
) |
Writes a 64 bit IEEE double precision floating point number from the stream.
This function only works on systems that have native 64 bit doubles.
void Gorgon::IO::WriteEnum32 | ( | std::ostream & | stream, |
E_ | v | ||
) |
Writes an enumeration as a 32-bit integer.
void Gorgon::IO::WriteFloat | ( | std::ostream & | stream, |
float | value | ||
) |
Writes a 32 bit IEEE floating point number from the stream.
This function only works on systems that that have native 32 bit floats.
void Gorgon::IO::WriteGuid | ( | std::ostream & | stream, |
const SGuid & | value | ||
) |
Writes a GUID from the given stream.
References SGuid::Bytes, and WriteArray().
void Gorgon::IO::WriteInt16 | ( | std::ostream & | stream, |
int | value | ||
) |
Writes a 16-bit integer from the stream.
An int is at least 16 bits, could be more however, only 2 bytes will be written to the stream
void Gorgon::IO::WriteInt32 | ( | std::ostream & | stream, |
long | value | ||
) |
Writes a 32-bit integer to the stream.
void Gorgon::IO::WriteInt8 | ( | std::ostream & | stream, |
char | value | ||
) |
Writes an 8-bit integer from the stream.
A char is at least 8 bits, could be more however, only 1 byte will be written to the stream
void Gorgon::IO::WritePoint | ( | std::ostream & | stream, |
Geometry::Point | p | ||
) |
Saves the point as two consecutive 32bit integers.
References WriteInt32(), basic_Point< T_ >::X, and basic_Point< T_ >::Y.
std::enable_if<std::is_same<F_, float>::value, void>::type Gorgon::IO::WritePointf | ( | std::ostream & | stream, |
Geometry::Pointf | p | ||
) |
Saves the point as two consecutive floats. This function will not work if float type is double.
References WriteFloat(), basic_Point< T_ >::X, and basic_Point< T_ >::Y.
void Gorgon::IO::WriteRGBA | ( | std::ostream & | stream, |
Graphics::RGBA | value | ||
) |
Writes a RGBA color, R will be saved first.
References RGBA::A, RGBA::B, RGBA::G, RGBA::R, and WriteUInt8().
void Gorgon::IO::WriteRGBAf | ( | std::ostream & | stream, |
Graphics::RGBAf | value | ||
) |
Writes a RGBAf color, R will be saved first.
References RGBAf::A, RGBAf::B, RGBAf::G, RGBAf::R, and WriteFloat().
void Gorgon::IO::WriteSize | ( | std::ostream & | stream, |
Geometry::Size | s | ||
) |
Saves the size as two consecutive 32bit integers.
References basic_Size< T_ >::Height, basic_Size< T_ >::Width, and WriteInt32().
void Gorgon::IO::WriteString | ( | std::ostream & | stream, |
const std::string & | value | ||
) |
Writes a string without its size.
void Gorgon::IO::WriteStringWithSize | ( | std::ostream & | stream, |
const std::string & | value | ||
) |
Writes a string from a given stream.
The size of the string is appended before the string as 32-bit unsigned value.
References WriteUInt32().
void Gorgon::IO::WriteUInt16 | ( | std::ostream & | stream, |
unsigned | value | ||
) |
Writes a 16-bit unsigned integer from the stream.
An unsigned int is at least 16 bits, could be more however, only 2 bytes will be written to the stream
void Gorgon::IO::WriteUInt32 | ( | std::ostream & | stream, |
unsigned long | value | ||
) |
Writes a 32-bit unsigned integer from the stream.
An unsigned long is at least 32 bits, could be more however, only 4 bytes will be written to the stream
void Gorgon::IO::WriteUInt8 | ( | std::ostream & | stream, |
Byte | value | ||
) |
Writes an 8-bit unsigned integer from the stream.
A char is at least 8 bits, could be more however, only 1 byte will be written to the stream
void Gorgon::IO::WriteVector | ( | std::ostream & | stream, |
const std::vector< T_ > & | data | ||
) |
Writes a vector to the stream.
Type of vector elements should be given a fixed size construct, otherwise a mismatch between binary formats will cause trouble.