18#ifndef INCLUDED_ISERIALIZER
19#define INCLUDED_ISERIALIZER
142 void NumberI32(
const char* name, int32_t value, int32_t lower, int32_t upper);
199 void Bool(
const char* name,
bool value)
223 void ScriptVal(
const char* name, JS::MutableHandleValue value);
230 void RawBytes(
const char* name,
const u8* data,
size_t len);
253 virtual void PutNumber(
const char* name, int32_t value) = 0;
254 virtual void PutNumber(
const char* name,
float value) = 0;
255 virtual void PutNumber(
const char* name,
double value) = 0;
257 virtual void PutBool(
const char* name,
bool value) = 0;
258 virtual void PutString(
const char* name,
const std::string& value) = 0;
260 virtual void PutScriptVal(
const char* name, JS::MutableHandleValue value) = 0;
261 virtual void PutRaw(
const char* name,
const u8* data,
size_t len) = 0;
ERROR_TYPE(Serialize, OutOfBounds)
A simple fixed-point number class.
Definition: Fixed.h:120
Serialization interface; see serialization overview.
Definition: ISerializer.h:121
void NumberU16(const char *name, uint16_t value, uint16_t lower, uint16_t upper)
Serialize a number, which must be lower <= value <= upper.
Definition: ISerializer.cpp:42
void NumberI8(const char *name, int8_t value, int8_t lower, int8_t upper)
Definition: ISerializer.cpp:35
void NumberI32(const char *name, int32_t value, int32_t lower, int32_t upper)
Serialize a number, which must be lower <= value <= upper.
Definition: ISerializer.cpp:63
virtual void PutNumber(const char *name, uint32_t value)=0
void NumberI8_Unbounded(const char *name, int8_t value)
Serialize a number.
Definition: ISerializer.h:156
void String(const char *name, const std::wstring &value, uint32_t minlength, uint32_t maxlength)
Serialize a Unicode string.
Definition: ISerializer.cpp:82
void NumberU8_Unbounded(const char *name, uint8_t value)
Serialize a number.
Definition: ISerializer.h:150
void RawBytes(const char *name, const u8 *data, size_t len)
Serialize a stream of bytes.
Definition: ISerializer.cpp:100
virtual void PutNumber(const char *name, double value)=0
virtual void PutNumber(const char *name, fixed value)=0
void NumberFloat_Unbounded(const char *name, float value)
Serialize a number.
Definition: ISerializer.h:181
void ScriptVal(const char *name, JS::MutableHandleValue value)
Serialize a JS::MutableHandleValue.
Definition: ISerializer.cpp:95
void NumberI16_Unbounded(const char *name, int16_t value)
Serialize a number.
Definition: ISerializer.h:166
virtual void PutNumber(const char *name, int8_t value)=0
virtual bool IsDebug() const
Returns true if the serializer is being used in debug mode.
Definition: ISerializer.cpp:105
virtual void PutNumber(const char *name, uint8_t value)=0
virtual void PutRaw(const char *name, const u8 *data, size_t len)=0
void NumberU32(const char *name, uint32_t value, uint32_t lower, uint32_t upper)
Serialize a number, which must be lower <= value <= upper.
Definition: ISerializer.cpp:56
void NumberU32_Unbounded(const char *name, uint32_t value)
Serialize a number.
Definition: ISerializer.h:171
virtual ~ISerializer()
Definition: ISerializer.cpp:24
virtual void PutScriptVal(const char *name, JS::MutableHandleValue value)=0
void NumberI32_Unbounded(const char *name, int32_t value)
Serialize a number.
Definition: ISerializer.h:176
void NumberI16(const char *name, int16_t value, int16_t lower, int16_t upper)
Serialize a number, which must be lower <= value <= upper.
Definition: ISerializer.cpp:49
virtual std::ostream & GetStream()=0
Returns a stream which can be used to serialize data directly.
virtual void PutNumber(const char *name, uint16_t value)=0
virtual void PutNumber(const char *name, int32_t value)=0
void NumberFixed_Unbounded(const char *name, fixed value)
Serialize a number.
Definition: ISerializer.h:191
void Bool(const char *name, bool value)
Serialize a boolean.
Definition: ISerializer.h:199
virtual void PutNumber(const char *name, int16_t value)=0
virtual void PutNumber(const char *name, float value)=0
void StringASCII(const char *name, const std::string &value, uint32_t minlength, uint32_t maxlength)
Serialize an ASCII string.
Definition: ISerializer.cpp:70
void NumberU16_Unbounded(const char *name, uint16_t value)
Serialize a number.
Definition: ISerializer.h:161
void NumberDouble_Unbounded(const char *name, double value)
Serialize a number.
Definition: ISerializer.h:186
virtual void PutBool(const char *name, bool value)=0
void NumberU8(const char *name, uint8_t value, uint8_t lower, uint8_t upper)
Serialize a number, which must be lower <= value <= upper.
Definition: ISerializer.cpp:28
virtual void PutString(const char *name, const std::string &value)=0
Definition: SerializeTemplates.h:64
uint8_t u8
Definition: types.h:37
unsigned short uint16_t
Definition: wposix_types.h:52
unsigned int uint32_t
Definition: wposix_types.h:53
short int16_t
Definition: wposix_types.h:38
unsigned char uint8_t
Definition: wposix_types.h:51
signed char int8_t
Definition: wposix_types.h:37