diff options
author | Thomas Dinges <blender@dingto.org> | 2015-05-22 00:43:18 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2015-05-22 00:43:18 +0300 |
commit | a9347303688336af5c320348a311c76049ba9ca4 (patch) | |
tree | 9ab4d147b5d7e68fa60cd0d575f91ed58bd8903e /intern/cycles/util/util_string.cpp | |
parent | 53eab562b4adeae69e6a9f594455a7b2db47f769 (diff) |
Cycles: Remove TM / R and whitespace from OpenCL device names.
Was already done for CPU devices, now we also do this for OpenCL.
Diffstat (limited to 'intern/cycles/util/util_string.cpp')
-rw-r--r-- | intern/cycles/util/util_string.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/intern/cycles/util/util_string.cpp b/intern/cycles/util/util_string.cpp index 8675ff3679d..66856dd8331 100644 --- a/intern/cycles/util/util_string.cpp +++ b/intern/cycles/util/util_string.cpp @@ -105,5 +105,22 @@ string string_strip(const string& s) } +void string_replace(string& haystack, const string& needle, const string& other) +{ + size_t i; + + while((i = haystack.find(needle)) != string::npos) + haystack.replace(i, needle.length(), other); +} + +string string_remove_trademark(const string &s) +{ + string result = s; + string_replace(result, "(TM)", ""); + string_replace(result, "(R)", ""); + + return string_strip(result); +} + CCL_NAMESPACE_END |