Hush Full Node software. We were censored from Github, this is where all development happens now.
https://hush.is
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.1 KiB
29 lines
1.1 KiB
// Copyright (c) 2015-2020 The Bitcoin Core developers
|
|
// Copyright (c) 2016-2022 The Hush developers
|
|
// Distributed under the GPLv3 software license, see the accompanying
|
|
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
|
|
|
#ifndef BITCOIN_UTIL_READWRITEFILE_H
|
|
#define BITCOIN_UTIL_READWRITEFILE_H
|
|
|
|
#include <fs.h>
|
|
|
|
#include <limits>
|
|
#include <string>
|
|
#include <utility>
|
|
|
|
/** 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.
|
|
*
|
|
* @param 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.
|
|
*/
|
|
std::pair<bool,std::string> ReadBinaryFile(const fs::path &filename, size_t maxsize=std::numeric_limits<size_t>::max());
|
|
|
|
/** Write contents of std::string to a file.
|
|
* @return true on success.
|
|
*/
|
|
bool WriteBinaryFile(const fs::path &filename, const std::string &data);
|
|
|
|
#endif /* BITCOIN_UTIL_READWRITEFILE_H */
|
|
|