13std::pair<bool, std::string>
15 size_t maxsize = std::numeric_limits<size_t>::max()) {
18 return std::make_pair(
false,
"");
28 return std::make_pair(
false,
"");
33 return std::make_pair(
true,
retval);
41 if (
fwrite(data.data(), 1, data.size(),
f) != data.size()) {
45 return fclose(
f) == 0;
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
FILE * fopen(const fs::path &p, const char *mode)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
bool WriteBinaryFile(const fs::path &filename, const std::string &data)
Write contents of std::string to a file.
std::pair< bool, std::string > ReadBinaryFile(const fs::path &filename, size_t maxsize=std::numeric_limits< size_t >::max())
Read full contents of a file and return them in a std::string.