| 831 | } |
| 832 | |
| 833 | bool 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 | |
| 862 | bool Properties::getBool(const char* name, bool defaultValue) const |
| 863 | { |
no test coverage detected