summaryrefslogtreecommitdiffstats
path: root/ingen/serialisation/Serialiser.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-02-08 07:02:59 +0000
committerDavid Robillard <d@drobilla.net>2015-02-08 07:02:59 +0000
commit0f9c8151d5b42b243a499bb31a1e1f0b2e8c5f6f (patch)
tree1ed4df4df4c3f160120544d92c681f1b4519e1aa /ingen/serialisation/Serialiser.hpp
parent8733afb7ae9a04f46ac6318667182da16eca9fe5 (diff)
downloadingen-0f9c8151d5b42b243a499bb31a1e1f0b2e8c5f6f.tar.gz
ingen-0f9c8151d5b42b243a499bb31a1e1f0b2e8c5f6f.tar.bz2
ingen-0f9c8151d5b42b243a499bb31a1e1f0b2e8c5f6f.zip
Server-side copy paste with LV2 state support.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5541 a436a847-0d15-0410-975c-d299462d15a1
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: