Bitcoin ABC 0.30.5
P2P Digital Currency
|
Go to the source code of this file.
Functions | |
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. More... | |
bool | WriteBinaryFile (const fs::path &filename, const std::string &data) |
Write contents of std::string to a file. More... | |
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.
Returns a pair <status, string>. If an error occurred, status will be false, otherwise status will be true and the data will be returned in string.
maxsize | Puts a maximum size limit on the file that is read. If the file is larger than this, truncated data (with len > maxsize) will be returned. |
Definition at line 14 of file readwritefile.cpp.
bool WriteBinaryFile | ( | const fs::path & | filename, |
const std::string & | data | ||
) |
Write contents of std::string to a file.
Definition at line 36 of file readwritefile.cpp.