Utilities for reading and writing binary and text files.
- Binary
bool read(const std::filesystem::path& path, std::vector<uint8_t>& out)– load raw bytes from disk.bool write(const std::filesystem::path& path, const std::vector<uint8_t>& data)– save raw bytes to disk.
- Text
bool readText(const std::filesystem::path& path, std::string& out)– read a UTF-8 text file.bool writeText(const std::filesystem::path& path, std::string_view text)– write UTF-8 text to a file.
#include <Core/FileSystem.h>
void loadData() {
std::vector<uint8_t> data;
if (FileSystem::read("data.bin", data)) {
// use data
}
}Test coverage: 0%