FileSystem: Add read/write binary stream helpers

This commit is contained in:
Connor McLaughlin
2021-01-30 21:24:36 +10:00
parent 41be96ef93
commit 61d0af30a2
2 changed files with 36 additions and 0 deletions

View File

@ -187,6 +187,9 @@ bool WriteFileToString(const char* filename, const std::string_view& sv);
std::string ReadStreamToString(ByteStream* stream, bool seek_to_start = true);
bool WriteStreamToString(const std::string_view& sv, ByteStream* stream);
std::vector<u8> ReadBinaryStream(ByteStream* stream, bool seek_to_start = true);
bool WriteBinaryToSTream(ByteStream* stream, const void* data, size_t data_length);
// creates a directory in the local filesystem
// if the directory already exists, the return value will be true.
// if Recursive is specified, all parent directories will be created