summaryrefslogtreecommitdiffstats
path: root/src/serialisation/Serialiser.cpp
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 /src/serialisation/Serialiser.cpp
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 'src/serialisation/Serialiser.cpp')
-rw-r--r--src/serialisation/Serialiser.cpp39
1 files changed, 9 insertions, 30 deletions
diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp
index dd1be2b4..3cd05ef4 100644
--- a/src/serialisation/Serialiser.cpp
+++ b/src/serialisation/Serialiser.cpp
@@ -54,6 +54,8 @@ namespace Ingen {
namespace Serialisation {
struct Serialiser::Impl {
+ typedef Resource::Properties Properties;
+
explicit Impl(World& world)
: _root_path("/")
, _world(world)
@@ -116,16 +118,6 @@ Serialiser::~Serialiser()
}
void
-Serialiser::to_file(SPtr<const Node> object,
- const std::string& filename)
-{
- me->_root_path = object->path();
- me->start_to_filename(filename);
- serialise(object);
- finish();
-}
-
-void
Serialiser::Impl::write_manifest(const std::string& bundle_path,
SPtr<const Node> graph,
const std::string& graph_symbol)
@@ -196,15 +188,6 @@ Serialiser::Impl::write_bundle(SPtr<const Node> graph,
write_manifest(path, graph, symbol);
}
-string
-Serialiser::to_string(SPtr<const Node> object,
- const string& base_uri)
-{
- start_to_string(object->path(), base_uri);
- serialise(object);
- return finish();
-}
-
/** Begin a serialization to a file.
*
* This must be called before any serializing methods.
@@ -223,16 +206,6 @@ Serialiser::Impl::start_to_filename(const string& filename)
_mode = Mode::TO_FILE;
}
-/** 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)
- */
void
Serialiser::start_to_string(const Raul::Path& root, const string& base_uri)
{
@@ -242,6 +215,13 @@ Serialiser::start_to_string(const Raul::Path& root, const string& base_uri)
me->_mode = Impl::Mode::TO_STRING;
}
+void
+Serialiser::start_to_file(const Raul::Path& root, const string& filename)
+{
+ me->_root_path = root;
+ me->start_to_filename(filename);
+}
+
std::string
Serialiser::finish()
{
@@ -274,7 +254,6 @@ Serialiser::Impl::path_rdf_node(const Raul::Path& path)
{
assert(_model);
assert(path == _root_path || path.is_child_of(_root_path));
- // FIXME: if path == root_path() then "/" ?
return Sord::URI(_model->world(),
path.substr(_root_path.base().length()),
_base_uri);