Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/serialization/IDeserializer.h
/* Copyright (C) 2017 Wildfire Games. | /* Copyright (C) 2020 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | public: | ||||
virtual void NumberFixed_Unbounded(const char* name, fixed& out); | virtual void NumberFixed_Unbounded(const char* name, fixed& out); | ||||
virtual void Bool(const char* name, bool& 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 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 String(const char* name, std::wstring& out, uint32_t minlength, uint32_t maxlength); | ||||
/// Deserialize a JS::Value, replacing 'out' | /// Deserialize a JS::Value, replacing 'out' | ||||
virtual void ScriptVal(const char* name, JS::MutableHandleValue out) = 0; | virtual void ScriptVal(const char* name, JS::MutableHandleValue out) = 0; | ||||
/// Deserialize an object value, appending properties to object 'objVal' | /** | ||||
virtual void ScriptObjectAppend(const char* name, JS::HandleValue objVal) = 0; | * Deserialize an object and assign its properties to objVal | ||||
* (Essentially equivalent to Object.assign(objVal, serialized)) | |||||
*/ | |||||
virtual void ScriptObjectAssign(const char* name, JS::HandleValue objVal) = 0; | |||||
/// Deserialize a JSString | /// Deserialize a JSString | ||||
virtual void ScriptString(const char* name, JS::MutableHandleString out) = 0; | virtual void ScriptString(const char* name, JS::MutableHandleString out) = 0; | ||||
virtual void RawBytes(const char* name, u8* data, size_t len); | virtual void RawBytes(const char* name, u8* data, size_t len); | ||||
// Features for simulation-state serialisation: | // Features for simulation-state serialisation: | ||||
virtual int GetVersion() const; | virtual int GetVersion() const; | ||||
Show All 24 Lines |
Wildfire Games · Phabricator