MCPcopy Create free account
hub / github.com/axmolengine/axmol / setString

Method setString

core/base/Properties.cpp:833–860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

831}
832
833bool Properties::setString(const char* name, const char* value)
834{
835 if (name)
836 {
837 for (auto&& itr : _properties)
838 {
839 if (itr.name == name)
840 {
841 // Update the first property that matches this name
842 itr.value = value ? value : "";
843 return true;
844 }
845 }
846
847 // There is no property with this name, so add one
848 _properties.emplace_back(Property(name, value ? value : ""));
849 }
850 else
851 {
852 // If there's a current property, set its value
853 if (_propertiesItr == _properties.end())
854 return false;
855
856 _propertiesItr->value = value ? value : "";
857 }
858
859 return true;
860}
861
862bool Properties::getBool(const char* name, bool defaultValue) const
863{

Callers 2

mergeWithMethod · 0.95
showStatsMethod · 0.45

Calls 3

PropertyClass · 0.70
emplace_backMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected