UESaveFile: add API to append a property.

This commit is contained in:
Guillaume Jacquemin 2021-09-23 15:08:20 +02:00
parent 0006c90a21
commit 9c1aeb753e
2 changed files with 8 additions and 0 deletions

View file

@ -47,6 +47,12 @@ auto UESaveFile::reloadData() -> bool {
return valid(); return valid();
} }
void UESaveFile::appendProperty(UnrealPropertyBase::ptr prop) {
auto none_prop = std::move(_properties.back());
_properties.back() = std::move(prop);
arrayAppend(_properties, std::move(none_prop));
}
auto UESaveFile::props() -> Containers::ArrayView<UnrealPropertyBase::ptr> { auto UESaveFile::props() -> Containers::ArrayView<UnrealPropertyBase::ptr> {
return _properties; return _properties;
} }

View file

@ -51,6 +51,8 @@ class UESaveFile {
return nullptr; return nullptr;
} }
void appendProperty(UnrealPropertyBase::ptr prop);
auto props() -> Containers::ArrayView<UnrealPropertyBase::ptr>; auto props() -> Containers::ArrayView<UnrealPropertyBase::ptr>;
auto saveToFile() -> bool; auto saveToFile() -> bool;