From 6a92ee5fbc7d47998fc399efe424e451cf75657c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 5 Mar 2010 04:46:06 +0000 Subject: Shrink extensions (to .ing.lv2 and .ing.ttl) and move definitions to central place so they aren't littered everywhere. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2525 a436a847-0d15-0410-975c-d299462d15a1 --- src/serialisation/Parser.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/serialisation/Parser.cpp') diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp index 11c0efb1..9fe1d036 100644 --- a/src/serialisation/Parser.cpp +++ b/src/serialisation/Parser.cpp @@ -32,6 +32,7 @@ #include "module/World.hpp" #include "shared/LV2URIMap.hpp" #include "Parser.hpp" +#include "names.hpp" #define LOG(s) s << "[Parser] " @@ -86,12 +87,13 @@ Parser::parse_document( normalise_uri(document_uri); const std::string filename(Glib::filename_from_uri(document_uri)); - const size_t ext = filename.find(".ingen.lv2"); - if (ext == filename.length() - 10 - || (ext == filename.length() - 11 && filename[filename.length() - 1] == '/')) { + const size_t ext = filename.find(INGEN_BUNDLE_EXT); + const size_t ext_len = strlen(INGEN_BUNDLE_EXT); + if (ext == filename.length() - ext_len + || (ext == filename.length() - ext_len - 1 && filename[filename.length() - 1] == '/')) { std::string basename(Glib::path_get_basename(filename)); basename = basename.substr(0, basename.find('.')); - document_uri += "/" + basename + ".ingen.ttl"; + document_uri += "/" + basename + INGEN_PATCH_FILE_EXT; } Redland::Model model(*world->rdf_world, document_uri, document_uri); -- cgit v1.2.1