summaryrefslogtreecommitdiffstats
path: root/src/serialisation/Parser.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-13 04:05:32 +0000
committerDavid Robillard <d@drobilla.net>2009-05-13 04:05:32 +0000
commit19928bb583e72802746b89e322f71ecc0fcb7427 (patch)
tree95912dc84d8c9dcf57939398514feaf148c1cd63 /src/serialisation/Parser.cpp
parent96f839e64de70a23210847e322d24690299287fe (diff)
downloadingen-19928bb583e72802746b89e322f71ecc0fcb7427.tar.gz
ingen-19928bb583e72802746b89e322f71ecc0fcb7427.tar.bz2
ingen-19928bb583e72802746b89e322f71ecc0fcb7427.zip
The great ID refactoring of 2009.
Path is now actually URI (scheme path: for now). Therefore ingen nodes and such live in the same namespace as ... well, everything. Including plugins. Thar be profit, laddies. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1992 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/serialisation/Parser.cpp')
-rw-r--r--src/serialisation/Parser.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp
index f64e96ab..c68d6ccf 100644
--- a/src/serialisation/Parser.cpp
+++ b/src/serialisation/Parser.cpp
@@ -180,7 +180,7 @@ Parser::parse_string(
{
Redland::Model model(*world->rdf_world, str.c_str(), str.length(), base_uri);
- cout << "Parsing " << (data_path ? (string)*data_path : "*") << " from string";
+ cout << "Parsing " << (data_path ? data_path->str() : "*") << " from string";
if (base_uri != "")
cout << "(base " << base_uri << ")";
cout << endl;
@@ -274,7 +274,7 @@ Parser::parse(
const Redland::Node::Type res = Redland::Node::RESOURCE;
const Glib::ustring query_str = data_path
- ? Glib::ustring("SELECT DISTINCT ?t WHERE { <") + data_path->substr(1) + "> a ?t . }"
+ ? Glib::ustring("SELECT DISTINCT ?t WHERE { <") + data_path->chop_start("/") + "> a ?t . }"
: Glib::ustring("SELECT DISTINCT ?s ?t WHERE { ?s a ?t . }");
Redland::Query query(*world->rdf_world, query_str);
@@ -288,8 +288,8 @@ Parser::parse(
const Redland::Node out_port_class (*world->rdf_world, res, NS_LV2 "OutputPort");
const Redland::Node lv2_class (*world->rdf_world, res, NS_LV2 "Plugin");
- const Redland::Node subject_node = (data_path && *data_path != "/")
- ? Redland::Node(*world->rdf_world, res, data_path->substr(1))
+ const Redland::Node subject_node = (data_path && !data_path->is_root())
+ ? Redland::Node(*world->rdf_world, res, data_path->chop_start("/"))
: model.base_uri();
std::string path_str;
@@ -325,7 +325,7 @@ Parser::parse(
string path = (parent && symbol)
? parent->base() + *symbol
- : (parent ? parent->base() : "/") + path_str.substr(1);
+ : (parent ? parent->base() : "/") + path_str.substr(path_str.find("/")+1);
if (!Path::is_valid(path)) {
cerr << "WARNING: Invalid path '" << path << "' transformed to /" << endl;
@@ -345,7 +345,7 @@ Parser::parse(
return boost::optional<Path>();
}
- if (data_path && subject.to_string() == *data_path)
+ if (data_path && subject.to_string() == data_path->str())
root_path = ret;
} else if (is_plugin) {