Serialize

Serialize — Functions for reading and writing XML representations of worlds.

Functions

Description

Functions

leecs_read_xml_node ()

LeecsWorld *
leecs_read_xml_node (LeecsRegistry *registry,
                     xmlNode *node);

Traverses an XML document from node and creates a new LeecsWorld with the entities specified in the document. registry is used as the registry for the new LeecsWorld, and its reference counter is incremented.

The components and serializable members which appear in the XML document must be registered to registry beforehand.

Parameters

registry

LeecsRegistry with serialization information about node .

[transfer none]

node

XML document node.

 

Returns

New LeecsWorld. Free with leecs_world_free().

[transfer full]


leecs_read_xml_string ()

LeecsWorld *
leecs_read_xml_string (LeecsRegistry *registry,
                       const char *string);

Reads an XML document stored as a string and creates a new LeecsWorld with the entities specified in the document. registry is used as the registry for the new LeecsWorld, and its reference counter is incremented.

The components and serializable members which appear in the XML document must be registered to registry beforehand.

Parameters

registry

LeecsRegistry with serialization information about string .

[transfer none]

string

XML document as a string.

 

Returns

New LeecsWorld. Free with leecs_world_free().

[transfer full]


leecs_read_xml_file ()

LeecsWorld *
leecs_read_xml_file (LeecsRegistry *registry,
                     const char *filename);

Reads an XML document stored as a file and creates a new LeecsWorld with the entities specified in the document. registry is used as the registry for the new LeecsWorld, and its reference counter is incremented.

The components and serializable members which appear in the XML document must be registered to registry beforehand.

Parameters

registry

LeecsRegistry with serialization information about filename .

[transfer none]

filename

Filename of an XML document.

 

Returns

New LeecsWorld. Free with leecs_world_free().

[transfer full]


leecs_write_xml_writer ()

void
leecs_write_xml_writer (const LeecsWorld *world,
                        xmlTextWriter *writer);

Writes an XML document representation of world to the location specified by writer .

The components and serializable members which appear in the XML document must be registered to the LeecsRegistry associated with world beforehand.

Parameters

world

LeecsWorld to store as an XML document.

 

writer

XML writer.

 

leecs_write_xml_string ()

char *
leecs_write_xml_string (const LeecsWorld *world);

Writes an XML document representation of world and returns it as a string.

The components and serializable members which appear in the XML document must be registered to the LeecsRegistry associated with world beforehand.

Parameters

world

LeecsWorld to store as an XML document.

 

Returns

XML document as a string.

[transfer full]