Skip to content

Rose::FileSystem::readFile

Load an entire file into an STL container.

Synopsis

Declared in <src/Rose/FileSystem.h>

template<class Container>
Container
readFile(
    std::filesystem::path const& fileName,
    std::ios_base::openmode openMode = std::ios_base::in |
                                                      std::ios_base::binary);

Exceptions

Name Thrown on
std::ios_base::failure if opening or reading the file fails.

Return Value

Container filled with file contents.

Parameters

Name Description
fileName File path to read.
openMode Stream open mode.

Created with MrDocs