#include <cstdint>
#include <expected>
#include <filesystem>
#include <span>
#include <string>
#include <string_view>
#include <vector>
#include "error.h"
Go to the source code of this file.
|
| std::expected< std::vector< std::uint8_t >, Error > | Tools::Common::readFile (const std::filesystem::path &path) |
| | Read a whole file.
|
| std::expected< std::vector< std::string >, Error > | Tools::Common::readLines (const std::filesystem::path &path) |
| | Read the lines of a text file, without their line endings, skipping empty lines.
|
| std::expected< void, Error > | Tools::Common::writeLines (const std::filesystem::path &path, const std::vector< std::string > &lines) |
| | Write lines to a text file, each ending with a line feed.
|
| std::expected< void, Error > | Tools::Common::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::Common::writeFile (const std::filesystem::path &path, std::string_view text) |
| | Replace a file with the given text, written as is.
|