diff options
author | David Robillard <d@drobilla.net> | 2015-06-09 04:25:00 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-06-09 04:25:00 +0000 |
commit | 6b199af8033f2176cef6128aaf744398a6ed50b5 (patch) | |
tree | e3311dc0a9d05f9e537f6a7e6f04423ef5cd80d1 /src/ingen | |
parent | d2760bc7ec7845b4e11966d035a91e863efc21e8 (diff) | |
download | ingen-6b199af8033f2176cef6128aaf744398a6ed50b5.tar.gz ingen-6b199af8033f2176cef6128aaf744398a6ed50b5.tar.bz2 ingen-6b199af8033f2176cef6128aaf744398a6ed50b5.zip |
Server side loading.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5692 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/ingen')
-rw-r--r-- | src/ingen/ingen.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/ingen/ingen.cpp b/src/ingen/ingen.cpp index 164eded5..b5605197 100644 --- a/src/ingen/ingen.cpp +++ b/src/ingen/ingen.cpp @@ -181,6 +181,20 @@ main(int argc, char** argv) std::lock_guard<std::mutex> lock(world->rdf_mutex()); world->parser()->parse_file( world, engine_interface.get(), graph, parent, symbol); + } else if (conf.option("server-load").is_valid()) { + const char* path = conf.option("server-load").ptr<char>(); + if (serd_uri_string_has_scheme((const uint8_t*)path)) { + std::cout << "Loading " << path << " (server side)" << std::endl; + engine_interface->copy(Raul::URI(path), Node::root_graph_uri()); + } else { + SerdNode uri = serd_node_new_file_uri( + (const uint8_t*)path, NULL, NULL, true); + std::cout << "Loading " << (const char*)uri.buf + << " (server side)" << std::endl; + engine_interface->copy(Raul::URI((const char*)uri.buf), + Node::root_graph_uri()); + serd_node_free(&uri); + } } // Save the currently loaded graph @@ -188,12 +202,12 @@ main(int argc, char** argv) const char* path = conf.option("save").ptr<char>(); if (serd_uri_string_has_scheme((const uint8_t*)path)) { std::cout << "Saving to " << path << std::endl; - engine_interface->copy(Raul::Path("/"), Raul::URI(path)); + engine_interface->copy(Node::root_graph_uri(), Raul::URI(path)); } else { SerdNode uri = serd_node_new_file_uri( (const uint8_t*)path, NULL, NULL, true); std::cout << "Saving to " << (const char*)uri.buf << std::endl; - engine_interface->copy(Raul::Path("/"), + engine_interface->copy(Node::root_graph_uri(), Raul::URI((const char*)uri.buf)); serd_node_free(&uri); } |