Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
FileUtils.h File Reference
#include <cstddef>
#include <filesystem>
#include <string>
#include <variant>
Include dependency graph for FileUtils.h:

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Typedefs

using donner::FileReadResult = std::variant<std::string, FileReadError>
 Contents or failure from a bounded file read.

Enumerations

enum class  donner::FileReadError {
  OpenFailed ,
  TooLarge ,
  ReadFailed
}
 Failure returned by ReadFileBounded.

Functions

FileReadResult donner::ReadFileBounded (const std::filesystem::path &path, size_t maximumSize)
 Open and read a regular file without allocating more than maximumSize bytes.
const char * donner::FileReadErrorMessage (FileReadError error)
 Human-readable description for error.