ByteStream: Add error feedback

This commit is contained in:
Stenzek
2024-04-07 13:10:30 +10:00
parent f4584f48f9
commit 9dd686a994
2 changed files with 21 additions and 8 deletions

View File

@ -10,6 +10,8 @@
#include <string_view>
#include <vector>
class Error;
// base byte stream creation functions
enum BYTESTREAM_OPEN_MODE
{
@ -104,7 +106,7 @@ public:
// base byte stream creation functions
// opens a local file-based stream. fills in error if passed, and returns false if the file cannot be opened.
static std::unique_ptr<ByteStream> OpenFile(const char* FileName, u32 OpenMode);
static std::unique_ptr<ByteStream> OpenFile(const char* FileName, u32 OpenMode, Error* error = nullptr);
// memory byte stream, caller is responsible for management, therefore it can be located on either the stack or on the
// heap.