resonance 1.0.1
Loading...
Searching...
No Matches
fileio.h File Reference
#include <cstdint>
#include <expected>
#include <filesystem>
#include <span>
#include <string_view>
#include <vector>
#include "error.h"
Include dependency graph for fileio.h:

Go to the source code of this file.

Namespaces

namespace  Tools
 Host tools that the build runs.

Functions

std::expected< std::vector< std::uint8_t >, Error > Tools::readFile (const std::filesystem::path &path)
 Read a whole file.
std::expected< void, Error > Tools::writeFile (const std::filesystem::path &path, std::span< const std::uint8_t > data)
 Replace a file with the given bytes.
std::expected< void, Error > Tools::writeFile (const std::filesystem::path &path, std::string_view text)
 Replace a file with the given text, written as is.