51 _(
"Null XML element."));
58 return getInstance().createObject(typ, el);
70 if (getInstance().data.find(name) == getInstance().data.end())
72 getInstance().data[name] = std::move(cstr);
88 for (
auto & elem : getInstance().data)
90 s += (elem).first + U
"\n";
98 DataFactory::DataFactory()
119 if (data.find(name) != data.end())
120 return data[name]->Create(el);
124 "const String &name, xml::Element &el): " +
StringUTF8(
_(
"Unknown type: "))) +
~DataFactory()
Destructor.
const char * CStr() const
Conversion to UTF8 cstring.
static bool RegisterClass(const String &name, std::unique_ptr< DataFactoryElementBase > &&cstr)
Registers a class in the factory.
Produces CRNData objects from XML.
static UObject CreateData(xml::Element &el)
Creates and initializes a SObject from an XML element.
A UTF32 character string class.
bool IsEmpty() const noexcept
Checks if the string is empty.
virtual StringUTF8 GetValue() const
Gets the content of the node.
static String GetKnownTypes()
Returns the list of registered classes.
A character string class.
Invalid argument error (e.g.: nullptr pointer)
An item was not found in a container.