|
Enrollment 28.2.0
|
JSON implementation of Writer abstraction. More...
#include <JsonWriter.h>
Public Member Functions | |
| const char * | Output () const |
| Provides serialization output. | |
| void | Write (const char *name, const Serializable &s) final |
| Serialize serializable. | |
| void | WriteRoot (Serializable &s) final |
| Serialize serializable as root object. | |
| void | WriteNull (const char *name) final |
| Serialize null object. | |
| void | Write (const char *name, const char *value) final |
| Serialize string. | |
| void | Write (const char *name, int value) final |
| Serialize int. | |
| void | Write (const char *name, unsigned int value) final |
| Serialize unsigned int. | |
| void | Write (const char *name, double value) final |
| Serialize double. | |
| void | Write (const char *name, int64_t value) final |
| Serialize int64_t integer. | |
| void | Write (const char *name, uint64_t value) final |
| Serialize uint64_t integer. | |
| void | Write (const char *name, const std::shared_ptr< Image > &image) final |
| Serialize Image. | |
| JsonWriter () | |
| Constructor sets up serialization backend. | |
| void | Write (const char *name, const std::shared_ptr< const Serializable > &s) |
| Serialize const serializable given as shared_ptr. | |
| template<typename T> | |
| void | Write (const char *name, const std::optional< T > &s) |
| Serialize serializable given as shared_ptr. | |
| void | WriteArray (const char *name, const std::vector< uint8_t > &value) |
| Serialize bytes from vector. | |
| template<typename T> | |
| void | WriteArray (const char *name, const T &array) |
| Serialize array of elements that are suitable for range-based for loop. | |
| void | SetBytesStrategy (BytesWriterStrategy &s) |
| Set bytes serialization strategy . | |
JSON implementation of Writer abstraction.
It uses RapidJSON
|
inlinenodiscard |
Provides serialization output.
|
inlineinherited |
Set bytes serialization strategy .
| s | strategy to serialize bytes |
|
inlinefinalvirtual |
|
inlinefinalvirtual |
Serialize serializable.
| name | name of serializable |
| s | class that implements Serializable interface |
Implements Writer.
|
inlinefinalvirtual |
Serialize Image.
Once the image serialization needs to be modified e.g. all images are serialized in specific format, then strategy can be used similar as BytesWriterStrategy.
| name | name of value (key) |
| value | Image |
Implements Writer.
References Writer::WriteArray(), and WriteNull().
|
inlinefinalvirtual |
|
inlinefinalvirtual |
|
inlinefinalvirtual |
Serialize int64_t integer.
| name | name of value (key) |
| value | unsigned integer value |
Implements Writer.
|
inlinefinalvirtual |
Serialize uint64_t integer.
| name | name of value (key) |
| value | unsigned integer value |
Implements Writer.
|
inlinefinalvirtual |
Serialize unsigned int.
| name | name of value (key) |
| value | unsigned integer value |
Implements Writer.
|
inlineinherited |
Serialize serializable given as shared_ptr.
| name | name of serializable |
| s | class that implements Serializable interface |
References Write(), and WriteNull().
|
inlineinherited |
Serialize const serializable given as shared_ptr.
| name | name of serializable |
| s | class that implements Serializable interface |
References Write(), and WriteNull().
|
inlineinherited |
Serialize bytes from vector.
It uses BytesWriterStrategy to serialize bytes. The strategy can be set by SetBytesStrategy function.
| name | name of value (key) |
| value | vector of bytes |
Referenced by JsonWriter::Write(), EmbeddingTemplate::WriteTo(), FaceTemplate::WriteTo(), ICSTemplate::WriteTo(), IrisTemplate::WriteTo(), ModalitiesICSTemplate::WriteTo(), and ModalitiesTemplate::WriteTo().
|
inherited |
Serialize array of elements that are suitable for range-based for loop.
| name | name of value (key) |
| array | array suitable for range-based for loop. |
| T | type suitable for range-based for loop. |
|
inlinefinalvirtual |
|
inlinefinalvirtual |
Serialize serializable as root object.
| s | class that implements Serializable interface |
Implements Writer.