BasicStringFileReader Class
Basic implementation of a string file reader. More...
Declaration
Base class
| class | StringFileReader |
|
Abstract base class for reading file contents into a string. More... | |
Public Member Functions Index
| std::string | getContents (const std::string &filename) const override |
|
Reads the entire contents of the file and returns them as a string. More... | |
| bool | readInto (const std::string &filename, std::string &contents) const noexcept override |
|
Attempts to read the entire contents of the file into the provided string. More... | |
Description
Basic implementation of a string file reader.
Definition at line 22 of file BasicStringFileReader.ixx.
Public Member Functions
getContents()
| inline nodiscard virtual |
Reads the entire contents of the file and returns them as a string.
- Parameters
-
filename The path to the file to read.
- Returns
The contents of the file as a std::string. If reading fails, an empty string is returned.
- Exceptions
-
std::runtime_error if the file operation fails.
Definition at line 29 of file BasicStringFileReader.ixx.
Reference helios::util::io::StringFileReader::logger_.
readInto()
| inline nodiscard noexcept virtual |
Attempts to read the entire contents of the file into the provided string.
- Parameters
-
filename The path to the file to read.
contents Output parameter receiving the file contents on success.
- Returns
true if reading succeeded and `contents` was populated, otherwise false.
Definition at line 49 of file BasicStringFileReader.ixx.
Reference helios::util::io::StringFileReader::logger_.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.