|
MIRA
|
A property hint gives optional instructions to the property editor, i.e. More...
#include <serialization/PropertyHint.h>
Public Types | |
| typedef std::list< std::pair< std::string, std::string > > | AttributeValueList |
Public Member Functions | |
| PropertyHint () | |
| PropertyHint (const std::string &attribute, const std::string &value) | |
| Constructs a single hint from the given attribute value pair. More... | |
| PropertyHint (PropertyHint &&other) noexcept | |
| move constructor More... | |
| ~PropertyHint () | |
| AttributeValueList | toList () const |
| Returns the attributes/value list containing the property hints. More... | |
| void | fromList (const AttributeValueList &list) |
| Sets the property hints from the specified list of attribute/value pairs. More... | |
| PropertyHint & | operator= (PropertyHint &&other) noexcept |
| move assignment operator More... | |
| PropertyHint | clone () const |
| Creates an explicit copy as replacement for the copy constructor. More... | |
| bool | has (const std::string &attribute) const |
| Returns true if the specified attribute exists. More... | |
| template<typename T > | |
| T | get (const std::string &attribute, const T &defaultValue=T()) const |
| Returns the specified value for the given attribute. More... | |
Friends | |
| PropertyHint | operator| (PropertyHint &&hint, PropertyHint &&otherHint) |
| Concatenates two hints. More... | |
A property hint gives optional instructions to the property editor, i.e.
minimum and maximum value and which kind of editor to use. Each property hint may consist of a list of hints and attributes that are stored as Attribute-Value pairs.
Hints can be concatenated easily using the | operator, e.g.
| typedef std::list<std::pair<std::string, std::string> > AttributeValueList |
|
inline |
|
inline |
Constructs a single hint from the given attribute value pair.
|
inlinenoexcept |
move constructor
|
inline |
|
inline |
Returns the attributes/value list containing the property hints.
|
inline |
Sets the property hints from the specified list of attribute/value pairs.
|
inlinenoexcept |
move assignment operator
|
inline |
Creates an explicit copy as replacement for the copy constructor.
The copy constructor was made private do avoid any performance penalties within the serialization framework whenever property hints are used.
|
inline |
Returns true if the specified attribute exists.
|
inline |
Returns the specified value for the given attribute.
If no such attribute is set in this hint, then the defaultValue is returned.
|
friend |
Concatenates two hints.
NOTE: to increase performance this operator takes the content of the second hint and moves it into the first hint. Therefore, after calling this operator the second hint will be empty.
1.8.14