| 117 | } |
| 118 | |
| 119 | bool EELParser::loadDefaults() |
| 120 | { |
| 121 | if (!isFileLoaded()) |
| 122 | { |
| 123 | return false; |
| 124 | } |
| 125 | |
| 126 | for(const auto& prop : std::as_const(properties)) |
| 127 | { |
| 128 | if(prop->getType() == EELPropertyType::NumberRange) |
| 129 | { |
| 130 | auto* nr = dynamic_cast<EELNumberRangeProperty<float>*>(prop); |
| 131 | nr->setValue(nr->getDefault()); |
| 132 | manipulateProperty(prop); |
| 133 | } |
| 134 | else if (prop->getType() == EELPropertyType::List) { |
| 135 | auto* list = dynamic_cast<EELListProperty*>(prop); |
| 136 | list->setValue(list->getDefault()); |
| 137 | manipulateProperty(prop); |
| 138 | } |
| 139 | } |
| 140 | return true; |
| 141 | } |
| 142 | |
| 143 | bool EELParser::hasDefaultsDefined() |
| 144 | { |
no test coverage detected