mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-08 12:30:00 -05:00
Remove extra " characters when a StringProperty is set by a string
This commit is contained in:
@@ -42,7 +42,15 @@ REGISTER_TEMPLATEPROPERTY_SOURCE(StringProperty, std::string, "",
|
||||
return true;
|
||||
},
|
||||
[](std::string value, bool& success) -> std::string {
|
||||
success = true;
|
||||
// An incoming string is of the form
|
||||
// "value"
|
||||
// so we want to remove the leading and trailing " characters
|
||||
if (value.size() > 2 && (value[0] == '"' && value[value.size() - 1] == '"')) {
|
||||
// Removing the first and last "
|
||||
success = true;
|
||||
return value.substr(1, value.size() - 2);
|
||||
}
|
||||
success = false;
|
||||
return value;
|
||||
},
|
||||
[](std::string& outValue, std::string inValue) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user