diff options
author | David Robillard <d@drobilla.net> | 2012-08-12 15:56:21 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-12 15:56:21 +0000 |
commit | 6ec0c7c6c4bb341926c45db99e7287cce91a8da2 (patch) | |
tree | 9166b13d686364856923ba97f9cd2dd85513a74f /src | |
parent | 37c7755e38037cfa359e9b3bbee9bd17d9606d73 (diff) | |
download | raul-6ec0c7c6c4bb341926c45db99e7287cce91a8da2.tar.gz raul-6ec0c7c6c4bb341926c45db99e7287cce91a8da2.tar.bz2 raul-6ec0c7c6c4bb341926c45db99e7287cce91a8da2.zip |
Stricter symbol construction and conversion.
git-svn-id: http://svn.drobilla.net/lad/trunk/raul@4670 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/Symbol.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/Symbol.cpp b/src/Symbol.cpp index fdaf711..4fe049e 100644 --- a/src/Symbol.cpp +++ b/src/Symbol.cpp @@ -53,19 +53,14 @@ Symbol::is_valid(const std::basic_string<char>& symbol) * This will make a best effort at turning @a str into a complete, valid * Symbol, and will always return one. */ -string +Raul::Symbol Symbol::symbolify(const std::basic_string<char>& str) { string symbol = str; Path::replace_invalid_chars(symbol, 0, true); - if (symbol.length() == 0) - return "_"; - - assert(is_valid(symbol)); - - return symbol; + return Raul::Symbol(symbol.empty() ? "_" : symbol); } } // namespace Raul |