1.10 |
Abstract base serializer class. More...
#include <serialize.h>
Public Types | |
using | Attributes = std::list< std::pair< std::string, std::string > > |
Attributes array type. | |
using | Context = void |
using | Properties = std::list< std::tuple< std::string, std::string, Serializer::Attributes > > |
Public Member Functions | |
Serializer () noexcept=default | |
Serializer (const Serializer &)=default | |
Serializer (Serializer &&) noexcept=default | |
virtual | ~Serializer () noexcept=default |
virtual bool | add (const Widget *widget)=0 |
Add a widget to the serializer. | |
void | add_property (const std::string &name, bool value, const Attributes &attrs={}) |
Add a property. | |
void | add_property (const std::string &name, const AlignFlags &value, const Attributes &attrs={}) |
Add a property. | |
void | add_property (const std::string &name, const char *value, const Attributes &attrs={}) |
Add a property. | |
virtual void | add_property (const std::string &name, const Pattern &value, const Attributes &attrs={})=0 |
Add a property. | |
virtual void | add_property (const std::string &name, const std::string &value, const Attributes &attrs={})=0 |
Add a property. | |
void | add_property (const std::string &name, double value, const Attributes &attrs={}) |
Add a property. | |
void | add_property (const std::string &name, float value, const Attributes &attrs={}) |
Add a property. | |
void | add_property (const std::string &name, int value, const Attributes &attrs={}) |
Add a property. | |
void | add_property (const std::string &name, unsigned int value, const Attributes &attrs={}) |
Add a property. | |
virtual Context * | begin_child (const std::string &nodename)=0 |
Create a new child. | |
virtual void | end_child (Context *context)=0 |
Complete a child. | |
Serializer & | operator= (const Serializer &)=default |
Serializer & | operator= (Serializer &&) noexcept=default |
virtual void | write (std::ostream &out)=0 |
Write to the specified ostream. | |
Abstract base serializer class.
using Attributes = std::list<std::pair<std::string, std::string> > |
Attributes array type.
using Context = void |
using Properties = std::list<std::tuple<std::string, std::string, Serializer::Attributes> > |
|
defaultnoexcept |
|
default |
|
defaultnoexcept |
|
virtualdefaultnoexcept |
|
pure virtual |
Add a widget to the serializer.
Implemented in OstreamWidgetSerializer, and XmlWidgetSerializer.
void add_property | ( | const std::string & | name, |
bool | value, | ||
const Attributes & | attrs = {} |
||
) |
Add a property.
void add_property | ( | const std::string & | name, |
const AlignFlags & | value, | ||
const Attributes & | attrs = {} |
||
) |
Add a property.
|
inline |
Add a property.
|
pure virtual |
Add a property.
Implemented in OstreamWidgetSerializer, XmlWidgetSerializer, OstreamWidgetSerializer, and XmlWidgetSerializer.
|
pure virtual |
Add a property.
Implemented in OstreamWidgetSerializer, XmlWidgetSerializer, OstreamWidgetSerializer, and XmlWidgetSerializer.
void add_property | ( | const std::string & | name, |
double | value, | ||
const Attributes & | attrs = {} |
||
) |
Add a property.
void add_property | ( | const std::string & | name, |
float | value, | ||
const Attributes & | attrs = {} |
||
) |
Add a property.
void add_property | ( | const std::string & | name, |
int | value, | ||
const Attributes & | attrs = {} |
||
) |
Add a property.
void add_property | ( | const std::string & | name, |
unsigned int | value, | ||
const Attributes & | attrs = {} |
||
) |
Add a property.
|
pure virtual |
Create a new child.
Implemented in OstreamWidgetSerializer, and XmlWidgetSerializer.
|
pure virtual |
Complete a child.
Implemented in OstreamWidgetSerializer, and XmlWidgetSerializer.
|
default |
|
defaultnoexcept |
|
pure virtual |
Write to the specified ostream.
Implemented in OstreamWidgetSerializer, and XmlWidgetSerializer.