summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-07-29 04:39:59 +0000
committerDavid Robillard <d@drobilla.net>2008-07-29 04:39:59 +0000
commit87ee1fdbffa3c2575015cee307a9cb671b98ce71 (patch)
tree631fc0ddc6d85a48167e11100f3ed2c7b15df600 /src
parentbd62fe5f33e5f02031a324d9282d063eb2dc55dd (diff)
downloadraul-87ee1fdbffa3c2575015cee307a9cb671b98ce71.tar.gz
raul-87ee1fdbffa3c2575015cee307a9cb671b98ce71.tar.bz2
raul-87ee1fdbffa3c2575015cee307a9cb671b98ce71.zip
Bump Ingen librdf dependency to 1.0.8.
Several serialization fixes. Include Smack 808 Om patches converted to Ingen files. git-svn-id: http://svn.drobilla.net/lad/raul@1301 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/Path.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/Path.cpp b/src/Path.cpp
index 04f89e7..24ab2bd 100644
--- a/src/Path.cpp
+++ b/src/Path.cpp
@@ -128,12 +128,18 @@ Path::replace_invalid_chars(string& str, bool replace_slash)
{
size_t open_bracket = str.find_first_of('(');
if (open_bracket != string::npos)
- str = str.substr(0, open_bracket-1);
+ str = str.substr(0, open_bracket);
open_bracket = str.find_first_of('[');
if (open_bracket != string::npos)
- str = str.substr(0, open_bracket-1);
+ str = str.substr(0, open_bracket);
+ if (str[str.length()-1] == ' ')
+ str = str.substr(0, str.length()-1);
+
+//#define STRICT_SYMBOLS
+
+#ifdef STRICT_SYMBOLS
// dB = special case, need to avoid CamelCase killing below
while (true) {
size_t decibels = str.find("dB");
@@ -143,20 +149,25 @@ Path::replace_invalid_chars(string& str, bool replace_slash)
break;
}
-
// Kill CamelCase in favour of god_fearing_symbol_names
for (size_t i=1; i < str.length(); ++i) {
if (str[i] >= 'A' && str[i] <= 'Z' && str[i-1] >= 'a' && str[i-1] <= 'z')
str = str.substr(0, i) + '_' + str.substr(i);
}
+#endif
for (size_t i=0; i < str.length(); ++i) {
if (str[i] == '\'') {
str = str.substr(0, i) + str.substr(i+1);
+#ifdef STRICT_SYMBOLS
} else if (str[i] >= 'A' && str[i] <= 'Z') {
str[i] = std::tolower(str[i]);
+#endif
} else if ( str[i] != '_' && str[i] != '/'
&& (str[i] < 'a' || str[i] > 'z')
+#ifndef STRICT_SYMBOLS
+ && (str[i] < 'A' || str[i] > 'Z')
+#endif
&& (str[i] < '0' || str[i] > '9') ) {
if (i > 0 && str[i-1] == '_') {
str = str.substr(0, i) + str.substr(i+1);