MCPcopy Create free account
hub / github.com/OpenMW/openmw / getStringArray

Method getStringArray

components/settings/settings.cpp:216–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214 }
215
216 std::vector<std::string> Manager::getStringArray(std::string_view setting, std::string_view category)
217 {
218 // TODO: it is unclear how to handle empty value -
219 // there is no difference between empty serialized array
220 // and a serialized array which has one empty value
221 std::vector<std::string> values;
222 const std::string& value = getString(setting, category);
223 if (value.empty())
224 return values;
225
226 Misc::StringUtils::split(value, values, ",");
227 for (auto& item : values)
228 Misc::StringUtils::trim(item);
229 return values;
230 }
231
232 float Manager::getFloat(std::string_view setting, std::string_view category)
233 {

Callers

nothing calls this directly

Calls 3

splitFunction · 0.85
trimFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected