aboutsummaryrefslogtreecommitdiff
path: root/src/streams.h
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-09-12 12:23:49 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-09-12 12:55:29 +0200
commitfa19c914f7fe7be127c0fb330b41ff7c091f40aa (patch)
treef399ed252fb304ee48556cef85e860deb4ca1ffb /src/streams.h
parentfa2f2413b87f5fc1e5c92bf510beebdcd0091714 (diff)
downloadbitcoin-fa19c914f7fe7be127c0fb330b41ff7c091f40aa.tar.xz
scripted-diff: Rename CBufferedFile to BufferedFile
While touching all constructors in the previous commit, the class name can be adjusted to comply with the style guide. -BEGIN VERIFY SCRIPT- sed -i 's/CBufferedFile/BufferedFile/g' $( git grep -l CBufferedFile ) -END VERIFY SCRIPT-
Diffstat (limited to 'src/streams.h')
-rw-r--r--src/streams.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/streams.h b/src/streams.h
index eec9c0956b..f9a817c9b6 100644
--- a/src/streams.h
+++ b/src/streams.h
@@ -577,7 +577,7 @@ public:
* Will automatically close the file when it goes out of scope if not null.
* If you need to close the file early, use file.fclose() instead of fclose(file).
*/
-class CBufferedFile
+class BufferedFile
{
private:
const int nVersion;
@@ -600,7 +600,7 @@ private:
return false;
size_t nBytes = fread((void*)&vchBuf[pos], 1, readNow, src);
if (nBytes == 0) {
- throw std::ios_base::failure(feof(src) ? "CBufferedFile::Fill: end of file" : "CBufferedFile::Fill: fread failed");
+ throw std::ios_base::failure(feof(src) ? "BufferedFile::Fill: end of file" : "BufferedFile::Fill: fread failed");
}
nSrcPos += nBytes;
return true;
@@ -629,7 +629,7 @@ private:
}
public:
- CBufferedFile(FILE* fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nVersionIn)
+ BufferedFile(FILE* fileIn, uint64_t nBufSize, uint64_t nRewindIn, int nVersionIn)
: nVersion{nVersionIn}, nReadLimit{std::numeric_limits<uint64_t>::max()}, nRewind{nRewindIn}, vchBuf(nBufSize, std::byte{0})
{
if (nRewindIn >= nBufSize)
@@ -637,14 +637,14 @@ public:
src = fileIn;
}
- ~CBufferedFile()
+ ~BufferedFile()
{
fclose();
}
// Disallow copies
- CBufferedFile(const CBufferedFile&) = delete;
- CBufferedFile& operator=(const CBufferedFile&) = delete;
+ BufferedFile(const BufferedFile&) = delete;
+ BufferedFile& operator=(const BufferedFile&) = delete;
int GetVersion() const { return nVersion; }
@@ -711,7 +711,7 @@ public:
}
template<typename T>
- CBufferedFile& operator>>(T&& obj) {
+ BufferedFile& operator>>(T&& obj) {
::Unserialize(*this, obj);
return (*this);
}