omni::extras::readFile
Defined in omni/extras/FileSystemHelpers.h
-
inline std::pair<bool, std::string> omni::extras::readFile(const char *path)
Reads file content into a string.
Warning
This function reads data in a binary fashion and stores it in a
std::string
. As such, the string may contain non-printable characters or evenNUL
characters. No conversion of Windows line endings is performed.- Parameters
path – The path to read
- Returns
a
std::pair
, where thefirst
member indicates success iftrue
and thesecond
member is the contents; iffirst
isfalse
thensecond
will always be empty. If the file is valid but empty,first
will betrue
butsecond
will be empty.