update io::Device::write

This commit is contained in:
MihailRis
2025-02-04 17:38:43 +03:00
parent 3e67d887f4
commit 1c98d6cb37
6 changed files with 50 additions and 12 deletions
+7 -1
View File
@@ -142,11 +142,17 @@ namespace io {
bool compressed = false
);
bool read(const io::path& file, char* data, size_t size);
/// @brief Open file for reading
/// @throw std::runtime_error if file cannot be opened
std::unique_ptr<std::istream> read(const io::path& file);
/// @brief Read bytes array from the file
bool read(const io::path& file, char* data, size_t size);
util::Buffer<ubyte> read_bytes_buffer(const path& file);
std::unique_ptr<ubyte[]> read_bytes(const path& file, size_t& length);
std::vector<ubyte> read_bytes(const path& file);
/// @brief Read string from the file
std::string read_string(const path& file);
/// @brief Read JSON or BJSON file