mrdocs::files::writeFileText

Write a string to a file, creating or truncating it.

Synopsis

Declared in <mrdocs/Support/Filesystem/Path.hpp>

Expected<void>
writeFileText(
    std::string_view pathName,
    std::string_view text);

Description

The path is UTF-8 on every platform, and the bytes of text are written unchanged.

Return Value

Nothing on success, or an error naming the path if the file could not be opened or written.

Parameters

NameDescription
pathNameThe absolute or relative path to the file.
textThe contents to write.