Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
IDeserializer Class Referenceabstract

Deserialization interface; see serialization overview. More...

#include <IDeserializer.h>

Inheritance diagram for IDeserializer:

Public Member Functions

virtual ~IDeserializer ()
 
virtual void NumberU8 (const char *name, uint8_t &out, uint8_t lower, uint8_t upper)
 
virtual void NumberI8 (const char *name, int8_t &out, int8_t lower, int8_t upper)
 
virtual void NumberU16 (const char *name, uint16_t &out, uint16_t lower, uint16_t upper)
 
virtual void NumberI16 (const char *name, int16_t &out, int16_t lower, int16_t upper)
 
virtual void NumberU32 (const char *name, uint32_t &out, uint32_t lower, uint32_t upper)
 
virtual void NumberI32 (const char *name, int32_t &out, int32_t lower, int32_t upper)
 
virtual void NumberU8_Unbounded (const char *name, uint8_t &out)
 
virtual void NumberI8_Unbounded (const char *name, int8_t &out)
 
virtual void NumberU16_Unbounded (const char *name, uint16_t &out)
 
virtual void NumberI16_Unbounded (const char *name, int16_t &out)
 
virtual void NumberU32_Unbounded (const char *name, uint32_t &out)
 
virtual void NumberI32_Unbounded (const char *name, int32_t &out)
 
virtual void NumberFloat_Unbounded (const char *name, float &out)
 
virtual void NumberDouble_Unbounded (const char *name, double &out)
 
virtual void NumberFixed_Unbounded (const char *name, fixed &out)
 
virtual void Bool (const char *name, bool &out)
 
virtual void StringASCII (const char *name, std::string &out, uint32_t minlength, uint32_t maxlength)
 
virtual void String (const char *name, std::wstring &out, uint32_t minlength, uint32_t maxlength)
 
virtual void ScriptVal (const char *name, JS::MutableHandleValue out)=0
 Deserialize a JS::Value, replacing 'out'. More...
 
virtual void ScriptObjectAssign (const char *name, JS::HandleValue objVal)=0
 Deserialize an object and assign its properties to objVal (Essentially equivalent to Object.assign(objVal, serialized)) More...
 
virtual void ScriptString (const char *name, JS::MutableHandleString out)=0
 Deserialize a JSString. More...
 
virtual void RawBytes (const char *name, u8 *data, size_t len)
 
virtual int GetVersion () const
 
virtual std::istream & GetStream ()=0
 Returns a stream which can be used to deserialize data directly. More...
 
virtual void RequireBytesInStream (size_t numBytes)=0
 Throws an exception if the stream definitely cannot provide the required number of bytes. More...
 

Protected Member Functions

virtual void Get (const char *name, u8 *data, size_t len)=0
 

Detailed Description

Deserialization interface; see serialization overview.

Constructor & Destructor Documentation

◆ ~IDeserializer()

IDeserializer::~IDeserializer ( )
virtual

Member Function Documentation

◆ Bool()

void IDeserializer::Bool ( const char *  name,
bool &  out 
)
virtual

◆ Get()

virtual void IDeserializer::Get ( const char *  name,
u8 data,
size_t  len 
)
protectedpure virtual

Implemented in CStdDeserializer.

◆ GetStream()

virtual std::istream & IDeserializer::GetStream ( )
pure virtual

Returns a stream which can be used to deserialize data directly.

(This is particularly useful for chaining multiple deserializers together.)

Implemented in CStdDeserializer.

◆ GetVersion()

int IDeserializer::GetVersion ( ) const
virtual

◆ NumberDouble_Unbounded()

void IDeserializer::NumberDouble_Unbounded ( const char *  name,
double &  out 
)
virtual

◆ NumberFixed_Unbounded()

void IDeserializer::NumberFixed_Unbounded ( const char *  name,
fixed out 
)
virtual

◆ NumberFloat_Unbounded()

void IDeserializer::NumberFloat_Unbounded ( const char *  name,
float &  out 
)
virtual

◆ NumberI16()

void IDeserializer::NumberI16 ( const char *  name,
int16_t out,
int16_t  lower,
int16_t  upper 
)
virtual

◆ NumberI16_Unbounded()

void IDeserializer::NumberI16_Unbounded ( const char *  name,
int16_t out 
)
virtual

◆ NumberI32()

void IDeserializer::NumberI32 ( const char *  name,
int32_t &  out,
int32_t  lower,
int32_t  upper 
)
virtual

◆ NumberI32_Unbounded()

void IDeserializer::NumberI32_Unbounded ( const char *  name,
int32_t &  out 
)
virtual

◆ NumberI8()

void IDeserializer::NumberI8 ( const char *  name,
int8_t out,
int8_t  lower,
int8_t  upper 
)
virtual

◆ NumberI8_Unbounded()

void IDeserializer::NumberI8_Unbounded ( const char *  name,
int8_t out 
)
virtual

◆ NumberU16()

void IDeserializer::NumberU16 ( const char *  name,
uint16_t out,
uint16_t  lower,
uint16_t  upper 
)
virtual

◆ NumberU16_Unbounded()

void IDeserializer::NumberU16_Unbounded ( const char *  name,
uint16_t out 
)
virtual

◆ NumberU32()

void IDeserializer::NumberU32 ( const char *  name,
uint32_t out,
uint32_t  lower,
uint32_t  upper 
)
virtual

◆ NumberU32_Unbounded()

void IDeserializer::NumberU32_Unbounded ( const char *  name,
uint32_t out 
)
virtual

◆ NumberU8()

void IDeserializer::NumberU8 ( const char *  name,
uint8_t out,
uint8_t  lower,
uint8_t  upper 
)
virtual

◆ NumberU8_Unbounded()

void IDeserializer::NumberU8_Unbounded ( const char *  name,
uint8_t out 
)
virtual

◆ RawBytes()

void IDeserializer::RawBytes ( const char *  name,
u8 data,
size_t  len 
)
virtual

◆ RequireBytesInStream()

virtual void IDeserializer::RequireBytesInStream ( size_t  numBytes)
pure virtual

Throws an exception if the stream definitely cannot provide the required number of bytes.

(It might be conservative and not throw an exception in some cases where the stream actually can't provide the required bytes.) (This should be used when allocating memory based on data in the stream, e.g. reading strings, to avoid dangerously large allocations when the data is invalid.)

Implemented in CStdDeserializer.

◆ ScriptObjectAssign()

virtual void IDeserializer::ScriptObjectAssign ( const char *  name,
JS::HandleValue  objVal 
)
pure virtual

Deserialize an object and assign its properties to objVal (Essentially equivalent to Object.assign(objVal, serialized))

Implemented in CStdDeserializer.

◆ ScriptString()

virtual void IDeserializer::ScriptString ( const char *  name,
JS::MutableHandleString  out 
)
pure virtual

Deserialize a JSString.

Implemented in CStdDeserializer.

◆ ScriptVal()

virtual void IDeserializer::ScriptVal ( const char *  name,
JS::MutableHandleValue  out 
)
pure virtual

Deserialize a JS::Value, replacing 'out'.

Implemented in CStdDeserializer.

◆ String()

void IDeserializer::String ( const char *  name,
std::wstring &  out,
uint32_t  minlength,
uint32_t  maxlength 
)
virtual

◆ StringASCII()

void IDeserializer::StringASCII ( const char *  name,
std::string &  out,
uint32_t  minlength,
uint32_t  maxlength 
)
virtual

The documentation for this class was generated from the following files: