From aacc1a5e49d2fe6e9ed28f68381eaa84c6d79468 Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Fri, 3 Sep 2021 13:39:05 -0700 Subject: [PATCH] IOFile: Add std::array functions --- Source/Core/Common/IOFile.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/Core/Common/IOFile.h b/Source/Core/Common/IOFile.h index 27285ce0df..858e634933 100644 --- a/Source/Core/Common/IOFile.h +++ b/Source/Core/Common/IOFile.h @@ -3,6 +3,7 @@ #pragma once +#include #include #include #include @@ -57,6 +58,18 @@ public: return m_good; } + template + bool ReadArray(std::array& elements, size_t* num_read = nullptr) + { + return ReadArray(elements.data(), elements.size(), num_read); + } + + template + bool WriteArray(const std::array& elements) + { + return WriteArray(elements.data(), elements.size()); + } + bool ReadBytes(void* data, size_t length) { return ReadArray(reinterpret_cast(data), length);