76 Map &act(getInstance().actions);
77 auto it = act.
Find(name);
79 return std::static_pointer_cast<Action>(it->second);
91 getInstance().actions.
Set(name, action);
106 getInstance().actions.
Load(filename);
119 getInstance().actions.
Save(filename);
128 std::vector<String> lst;
129 Map &act(getInstance().actions);
130 for (
auto & elem : act)
132 lst.push_back(elem.first);
iterator Find(const String &key)
Returns an iterator to a specific key.
StringUTF8 GetName() const
Gets the label of the element.
void Set(const String &key, SObject value)
Sets a value for a key with constraints check.
void Deserialize(xml::Element &el)
Reads from an XML node if applicable.
void Deserialize(xml::Element &el)
xml::Element Serialize(xml::Element &parent) const
void Load(const Path &fname)
Element BeginElement()
Gets the first child element.
A UTF32 character string class.
static void Load(const Path &filename)
Loads a set of default actions.
void Save(const Path &fname) const
static SAction GetAction(const String &name)
Gets a default action.
A convenience class for file paths.
xml::Element Serialize(xml::Element &parent) const
Dumps to an XML node if applicable.
virtual xml::Element serialize(xml::Element &parent) const
void SetAttribute(const StringUTF8 &name, const StringUTF8 &value)
Sets the value of an attribute.
virtual StringUTF8 GetClassName() const =0
virtual void deserialize(xml::Element &el)
static void Save(const Path &filename)
Saves the set of default actions.
static std::vector< String > GetActionList()
Gets the list of default actions.
bool IsEmpty() const noexcept
Tests if the map is empty.
A class containing functors.
A character string class.
iterator end()
Returns an iterator after the last element.
Element PushBackElement(const StringUTF8 &name)
Adds an element at the end of the children list.
Element EndElement()
Gets a null node.
static void SetAction(const String &name, SAction action)
Sets a default action.
Invalid argument error (e.g.: nullptr pointer)