summaryrefslogtreecommitdiffstats
path: root/src/Path.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-01-01 19:52:36 +0000
committerDavid Robillard <d@drobilla.net>2008-01-01 19:52:36 +0000
commitcb21a7b08354134307637eb822a3c1ad9cb7ed23 (patch)
treefed8b9484141e723317a00886b0bd8bc841c9397 /src/Path.cpp
parent143d9b1599a82a35165fd8e17f249998f95f15d0 (diff)
downloadraul-cb21a7b08354134307637eb822a3c1ad9cb7ed23.tar.gz
raul-cb21a7b08354134307637eb822a3c1ad9cb7ed23.tar.bz2
raul-cb21a7b08354134307637eb822a3c1ad9cb7ed23.zip
RAUL code cleanup.
git-svn-id: http://svn.drobilla.net/lad/raul@999 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/Path.cpp')
-rw-r--r--src/Path.cpp27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/Path.cpp b/src/Path.cpp
index 284cf16..04f89e7 100644
--- a/src/Path.cpp
+++ b/src/Path.cpp
@@ -17,6 +17,8 @@
#include <raul/Path.hpp>
+using namespace std;
+
namespace Raul {
@@ -124,27 +126,6 @@ Path::nameify(const std::basic_string<char>& str)
void
Path::replace_invalid_chars(string& str, bool replace_slash)
{
-#if 0
- for (size_t i=0; i < str.length(); ++i) {
- if (str[i] == ' ' || str[i] == '_') {
- str[i+1] = std::toupper(str[i+1]); // capitalize next char
- str = str.substr(0, i) + str.substr(i+1); // chop space/underscore
- --i;
- } else if (str[i] == '[' || str[i] == '{') {
- str[i] = '(';
- } else if (str[i] == ']' || str[i] == '}') {
- str[i] = ')';
- } else if (str[i] < 32 || str.at(i) > 126
- || str[i] == '#'
- || str[i] == '*'
- || str[i] == ','
- || str[i] == '?'
- || (replace_slash && str[i] == '/')) {
- str[i] = '.';
- }
- }
-#endif
-
size_t open_bracket = str.find_first_of('(');
if (open_bracket != string::npos)
str = str.substr(0, open_bracket-1);
@@ -165,10 +146,8 @@ Path::replace_invalid_chars(string& str, bool replace_slash)
// 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[i] = std::tolower(str[i]);
+ if (str[i] >= 'A' && str[i] <= 'Z' && str[i-1] >= 'a' && str[i-1] <= 'z')
str = str.substr(0, i) + '_' + str.substr(i);
- }
}
for (size_t i=0; i < str.length(); ++i) {