diff options
author | David Robillard <d@drobilla.net> | 2006-12-09 07:43:15 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-12-09 07:43:15 +0000 |
commit | d5e8ce8127784fc67953ab3b6247e911be697cc2 (patch) | |
tree | 41ed069b23a9cab56b4443cf699b26080a590ae5 /src/libs/client/Serializer.cpp | |
parent | d2d755b0db3b4779d581c7a70841609257250c12 (diff) | |
download | ingen-d5e8ce8127784fc67953ab3b6247e911be697cc2.tar.gz ingen-d5e8ce8127784fc67953ab3b6247e911be697cc2.tar.bz2 ingen-d5e8ce8127784fc67953ab3b6247e911be697cc2.zip |
Preliminary patch loading (just loads nodes from RDF).
git-svn-id: http://svn.drobilla.net/lad/ingen@214 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client/Serializer.cpp')
-rw-r--r-- | src/libs/client/Serializer.cpp | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/src/libs/client/Serializer.cpp b/src/libs/client/Serializer.cpp index 3984a49a..b8929546 100644 --- a/src/libs/client/Serializer.cpp +++ b/src/libs/client/Serializer.cpp @@ -47,18 +47,6 @@ namespace Ingen { namespace Client { -Serializer::Serializer(SharedPtr<ModelEngineInterface> engine) - : _patch_search_path(".") - , _engine(engine) -{ -} - - -Serializer::~Serializer() -{ -} - - /** Begin a serialization to a file. * * This must be called before any serializing methods. @@ -111,7 +99,7 @@ Serializer::path_to_node_id(const Path& path) return RdfId(RdfId::ANONYMOUS, ret); } - +#if 0 /** Searches for the filename passed in the path, returning the full * path of the file, or the empty string if not found. * @@ -160,7 +148,7 @@ Serializer::find_file(const string& filename, const string& additional_path) return ""; } - +#endif void Serializer::serialize(SharedPtr<ObjectModel> object) throw (std::logic_error) @@ -235,8 +223,18 @@ Serializer::serialize_patch(SharedPtr<PatchModel> patch, unsigned depth) for (ConnectionList::const_iterator c = patch->connections().begin(); c != patch->connections().end(); ++c) { serialize_connection(*c); } - - //_engine->set_metadata(patch->path(), "uri", uri); +} + + +void +Serializer::serialize_plugin(SharedPtr<PluginModel> plugin) +{ + const RdfId plugin_id = RdfId(RdfId::RESOURCE, plugin->uri()); + + _writer.write( + plugin_id, + NS_RDF("type"), + RdfId(RdfId::RESOURCE, plugin->type_uri())); } @@ -249,11 +247,25 @@ Serializer::serialize_node(SharedPtr<NodeModel> node, unsigned depth) ? RdfId(RdfId::RESOURCE, string("#") + node->path().substr(1)) : path_to_node_id(node->path()); // anonymous + const RdfId plugin_id = RdfId(RdfId::RESOURCE, node->plugin()->uri()); + _writer.write( node_id, NS_RDF("type"), NS_INGEN("Node")); + _writer.write( + node_id, + NS_INGEN("name"), + node->path().name()); + + _writer.write( + node_id, + NS_INGEN("plugin"), + plugin_id); + + //serialize_plugin(node->plugin()); + /*_writer.write(_serializer, node_uri_ref.c_str(), NS_INGEN("name"), |