All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Valuable::SerializationOptions Class Reference

Options that define the behaviour of the (de)serialize() methods. More...

#include <Valuable/Archive.hpp>

Inheritance diagram for Valuable::SerializationOptions:
Valuable::Archive Valuable::XMLArchive

Public Types

enum  Options {
  LAYER_DEFAULT = 1 << 0, LAYER_STYLE = 1 << 1, LAYER_USER = 1 << 2, LAYER_STYLE_IMPORTANT = 1 << 3,
  DEFAULTS = LAYER_USER, ONLY_CHANGED = LAYER_STYLE | LAYER_USER | LAYER_STYLE_IMPORTANT, EVERYTHING = LAYER_DEFAULT | LAYER_STYLE | LAYER_USER | LAYER_STYLE_IMPORTANT
}
 Serialization bitflags. More...
 

Public Member Functions

bool checkFlags (Options flag)
 Check if given flag is enabled. More...
 
 SerializationOptions (unsigned int options=DEFAULTS)
 Construct an options object with given flags.
 
void setOptions (Options flags)
 Set the options for serialization.
 

Protected Attributes

unsigned int m_options
 Actual bitmask of flags.
 

Detailed Description

Options that define the behaviour of the (de)serialize() methods.

Member Enumeration Documentation

Serialization bitflags.

The actual value that is serialized is from the layer with highest priority that is included in serialization with LAYER_-flags. The default is LAYER_USER, meaning that only manually set values will be serialized. If an attribute has a value set only from a CSS file, that whole attribute is ignored.

See Also
Valuable::Attribute::Layer
Enumerator
LAYER_STYLE 

Serialize values from Valuable::Attribute::DEFAULT layer.

LAYER_USER 

Serialize values from Valuable::Attribute::STYLE layer.

LAYER_STYLE_IMPORTANT 

Serialize values from Valuable::Attribute::USER layer.

DEFAULTS 

Serialize values from Valuable::Attribute::STYLE_IMPORTANT layer.

Normal behaviour, serialize manually set values

ONLY_CHANGED 

Serialize only values that are different from the original values.

EVERYTHING 

Serialize all values.

Member Function Documentation

bool Valuable::SerializationOptions::checkFlags ( Options  flag)
inline

Check if given flag is enabled.

Parameters
flagFlag to test
Returns
True if given flag is enabled in the options.