diff options
author | David Robillard <d@drobilla.net> | 2008-11-28 20:07:49 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-11-28 20:07:49 +0000 |
commit | 0ecd2b8f0ebc5a384759435c81bb3314f6d12e79 (patch) | |
tree | bcb45104122260a807b93c8df53c5dc5860c4845 | |
parent | 0a5f1e4311d047b12738e435e5a7ac403689938d (diff) | |
download | ingen-0ecd2b8f0ebc5a384759435c81bb3314f6d12e79.tar.gz ingen-0ecd2b8f0ebc5a384759435c81bb3314f6d12e79.tar.bz2 ingen-0ecd2b8f0ebc5a384759435c81bb3314f6d12e79.zip |
Cleanup.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1815 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/serialisation/Parser.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp index d99af1fa..4e886e43 100644 --- a/src/serialisation/Parser.cpp +++ b/src/serialisation/Parser.cpp @@ -248,20 +248,19 @@ Parser::parse( for (Redland::Query::Results::iterator i = results.begin(); i != results.end(); ++i) { const Redland::Node& subject = (object_uri ? subject_uri : (*i)["subject"]); const Redland::Node& rdf_class = (*i)["class"]; + //cout << "SUBJECT: " << subject.to_c_string() << endl; //cout << "CLASS: " << rdf_class.to_c_string() << endl; - if (!object_uri) { + + if (!object_uri) path_str = uri_relative_to_base(base_uri, subject.to_c_string()); - //cout << "BASE: " << base_uri.c_str() << endl; - //cout << "PATH: " << path_str.c_str() << endl; - if (path_str[0] != '/') - path_str = string("/").append(path_str); - if (!Path::is_valid(path_str)) { - //cerr << "INVALID PATH: " << path_str << endl; - //} else if (Path(path_str).parent() != "/") { - //cout << "Non-root parent object " << path_str << endl; - //continue; - } + + if (path_str[0] != '/') + path_str = string("/").append(path_str); + + if (!Path::is_valid(path_str)) { + cerr << "WARNING: Invalid path '" << path_str << "', object skipped" << endl; + continue; } const bool is_plugin = (rdf_class == ladspa_class) @@ -276,9 +275,6 @@ Parser::parse( if (is_object) { Raul::Path path(path_str == "" ? "/" : path_str); - //if (path.parent() != "/") - // continue; - if (rdf_class == patch_class) { ret = parse_patch(world, target, model, base_uri, engine_base, path_str, data); } else if (rdf_class == node_class) { @@ -335,8 +331,8 @@ Parser::parse_patch( if (subject[0] == '<' && subject[1] == '/') subject = string("<").append(subject.substr(2)); - //cout << "**** LOADING PATCH URI " << object_uri << ", SUBJ " << subject - // << ", ENG BASE " << engine_base << endl; + //cout << "Parse patch URI: " << object_uri << ", Subject: " << subject + // << ", Engine Base: " << engine_base << endl; /* Get polyphony from file (mandatory if not specified in parameters) */ if (patch_poly == 0) { |