summaryrefslogtreecommitdiffstats
path: root/ingen/serialisation/Serialiser.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'ingen/serialisation/Serialiser.hpp')
-rw-r--r--ingen/serialisation/Serialiser.hpp38
1 files changed, 30 insertions, 8 deletions
diff --git a/ingen/serialisation/Serialiser.hpp b/ingen/serialisation/Serialiser.hpp
index d0b65893..80a01b89 100644
--- a/ingen/serialisation/Serialiser.hpp
+++ b/ingen/serialisation/Serialiser.hpp
@@ -46,27 +46,49 @@ public:
explicit Serialiser(World& world);
virtual ~Serialiser();
- typedef Node::Properties Properties;
-
- virtual void to_file(SPtr<const Node> object,
- const std::string& filename);
-
+ /** Write a graph and all its contents as a complete bundle. */
virtual void write_bundle(SPtr<const Node> graph,
const std::string& path);
- virtual std::string to_string(SPtr<const Node> object,
- const std::string& base_uri);
-
+ /** Begin a serialization to a string.
+ *
+ * This must be called before any serializing methods.
+ *
+ * The results of the serialization will be returned by the finish() method after
+ * the desired objects have been serialised.
+ *
+ * All serialized paths will have the root path chopped from their prefix
+ * (therefore all serialized paths must be descendants of the root)
+ */
virtual void start_to_string(const Raul::Path& root,
const std::string& base_uri);
+ /** Begin a serialization to a file.
+ *
+ * This must be called before any serializing methods.
+ *
+ * All serialized paths will have the root path chopped from their prefix
+ * (therefore all serialized paths must be descendants of the root)
+ */
+ virtual void start_to_file(const Raul::Path& root,
+ const std::string& filename);
+
+ /** Serialize an object (graph, block, or port). */
virtual void serialise(SPtr<const Node> object)
throw (std::logic_error);
+ /** Serialize an arc. */
virtual void serialise_arc(const Sord::Node& parent,
SPtr<const Arc> arc)
throw (std::logic_error);
+ /** Finish serialization.
+ *
+ * If this is a file serialization, this must be called to finish and close
+ * the output file, and the empty string is returned.
+ *
+ * If this is a string serialization, the serialized result is returned.
+ */
virtual std::string finish();
private: