diff --git a/ext/ghoul b/ext/ghoul index 4b64684acd..4a17b2a165 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 4b64684acd728069e80948f9a4767b30baf268a3 +Subproject commit 4a17b2a1653cc596ab8610d93a53c639930ddb85 diff --git a/include/openspace/scene/scene.h b/include/openspace/scene/scene.h index 03e7ec71ce..4ebabe66f2 100644 --- a/include/openspace/scene/scene.h +++ b/include/openspace/scene/scene.h @@ -343,8 +343,6 @@ private: ghoul::MemoryPool<4096> _memoryPool; }; -void trimSurroundingCharacters(std::string& valueString, const char c); - } // namespace openspace #endif // __OPENSPACE_CORE___SCENE___H__ diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index b8b570193d..cc5420524b 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -621,7 +622,7 @@ void Scene::setPropertiesFromProfile(const Profile& p) { ghoul::lua::push(L, 0.0); std::string workingValue = prop.value; - trimSurroundingCharacters(workingValue, ' '); + ghoul::trimSurroundingCharacters(workingValue, ' '); // Later functions expect the value to be at the last position on the stack propertyPushProfileValueToLua(L, workingValue); @@ -678,16 +679,16 @@ ProfilePropertyLua Scene::propertyProcessValue(ghoul::lua::LuaState& L, result = ghoul::lua::nil_t(); break; case PropertyValueType::Table: - trimSurroundingCharacters(const_cast(value), '{'); - trimSurroundingCharacters(const_cast(value), '}'); + ghoul::trimSurroundingCharacters(const_cast(value), '{'); + ghoul::trimSurroundingCharacters(const_cast(value), '}'); handlePropertyLuaTableEntry(L, value); _valueIsTable = true; break; case PropertyValueType::String: default: - trimSurroundingCharacters(const_cast(value), '\"'); - trimSurroundingCharacters(const_cast(value), '['); - trimSurroundingCharacters(const_cast(value), ']'); + ghoul::trimSurroundingCharacters(const_cast(value), '\"'); + ghoul::trimSurroundingCharacters(const_cast(value), '['); + ghoul::trimSurroundingCharacters(const_cast(value), ']'); result = value; break; } @@ -752,7 +753,7 @@ void Scene::processPropertyValueTableEntries(ghoul::lua::LuaState& L, else { nextValue = value.substr(prevPos); } - trimSurroundingCharacters(nextValue, ' '); + ghoul::trimSurroundingCharacters(nextValue, ' '); ProfilePropertyLua tableElement = propertyProcessValue(L, nextValue); try { table.push_back(std::get(tableElement)); @@ -784,15 +785,6 @@ PropertyValueType Scene::propertyValueType(const std::string& value) { } } -void trimSurroundingCharacters(std::string& valueString, const char c) { - while (valueString.front() == c) { - valueString.erase(0, 1); - } - while (valueString.back() == c) { - valueString.pop_back(); - } -} - scripting::LuaLibrary Scene::luaLibrary() { return { "",