|
ActiveLib
|
#include <AnyValueWrap.h>


Public Member Functions | |
| AnyValueWrap () | |
| AnyValueWrap (const setting::Value &val) | |
| virtual bool | write (utility::String &dest) const override |
| setting::Value::Unique | releaseIncoming () |
| virtual bool | read (const utility::String &source) override |
| virtual bool | read (const setting::Value &source) override |
| virtual void | setDefault () override |
| virtual std::optional< Item::Type > | type () const override |
Public Member Functions inherited from active::serialise::Item | |
| virtual bool | fillInventory (Inventory &inventory) const |
| virtual Cargo::Unique | getCargo (const Inventory::Item &item) const |
Public Member Functions inherited from active::serialise::Cargo | |
| Cargo () | |
| Cargo (const Cargo &source) | |
| virtual | ~Cargo ()=default |
| virtual void | clear () |
| virtual bool | validate () |
Additional Inherited Members | |
Public Types inherited from active::serialise::Item | |
| enum class | Type { text , number , boolean } |
Public Types inherited from active::serialise::Cargo | |
| using | Unique = std::unique_ptr<Cargo> |
| Unique pointer. | |
| using | Shared = std::shared_ptr<Cargo> |
| Shared pointer. | |
| using | size_type = std::string::size_type |
| Class size type. | |
| using | sizeOption = std::optional<size_type> |
| Optional size type (used to indicate an unspecified or non-existant position) | |
Interface for a lightweight wrapper for a serialisable value of a potentially unspecified type
This is primarily intended to support classes like XMLValueSetting, which may contain an array of values of different types. On export, the type of value is established by each outgoing value, but on import the value type may not be known until it is read, e.g. a JSON parser may detect text/number/bool/null. XML does not have an explicit format for value types, so this will need to be post-processed by the receiving package (if it has explicit type specifications)
|
inline |
Default constructor
|
inline |
Constructor
| val | The item value |
|
overridevirtual |
Read the cargo data from the specified setting
| source | The setting to read |
Reimplemented from active::serialise::Item.

|
overridevirtual |
Read the item from a string
| source | The string to read |
Implements active::serialise::Item.
|
inline |
Release the incoming value held by this wrapper
|
overridevirtual |
Set to the default package content
Implements active::serialise::Cargo.


|
overridevirtual |
Get the serialisation type for the item value
Reimplemented from active::serialise::Item.
|
overridevirtual |
Write the item to a string
| dest | The string to write the data to |
Implements active::serialise::Item.