Function TRAP::FileSystem::ReadTextFile#

Function Documentation#

TRAP::Optional<std::string> TRAP::FileSystem::ReadTextFile(const std::filesystem::path &path)#

Read the given text file.

Note

CRLF line endings are automatically converted to LF (i.e. ‘

’).

Note

This will read the whole file into memory, only use this for small files.

Parameters:

path – File path.

Returns:

File content as std::string on success, empty std::optional otherwise.