diff --git a/src/UESaveFile/BinaryReader.h b/src/UESaveFile/BinaryReader.h index 253d14f..5a11280 100644 --- a/src/UESaveFile/BinaryReader.h +++ b/src/UESaveFile/BinaryReader.h @@ -53,6 +53,11 @@ class BinaryReader { auto readDouble(Double& value) -> bool; auto readArray(Containers::Array& array, std::size_t count) -> bool; + template + auto readValue(T& value) -> bool { + return fread(&value, sizeof(T), 1, _file) == sizeof(T); + } + template auto readStaticArray(Containers::StaticArray& array) -> bool { return std::fread(array.data(), sizeof(char), S, _file) == S;