aboutsummaryrefslogtreecommitdiff
path: root/src/flatfile.h
diff options
context:
space:
mode:
authorJim Posen <jim.posen@gmail.com>2019-01-06 11:46:30 -0800
committerJim Posen <jim.posen@gmail.com>2019-02-22 17:38:45 -0800
commit65a489e93d181d3c0f7a9cf79f7c11ff8cf2b0f0 (patch)
treedd513c7251d8524e7efd58ded79895ae38652531 /src/flatfile.h
parentd6d8a78f26f52fdfe43293686135e2fc6919926c (diff)
downloadbitcoin-65a489e93d181d3c0f7a9cf79f7c11ff8cf2b0f0.tar.xz
scripted-diff: Rename CBlockDiskPos to FlatFilePos.
-BEGIN VERIFY SCRIPT- sed -i 's/CDiskBlockPos/FlatFilePos/g' $(git ls-files 'src/*.h' 'src/*.cpp') -END VERIFY SCRIPT-
Diffstat (limited to 'src/flatfile.h')
-rw-r--r--src/flatfile.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/flatfile.h b/src/flatfile.h
index d599b8cc42..6051970490 100644
--- a/src/flatfile.h
+++ b/src/flatfile.h
@@ -11,7 +11,7 @@
#include <fs.h>
#include <serialize.h>
-struct CDiskBlockPos
+struct FlatFilePos
{
int nFile;
unsigned int nPos;
@@ -24,20 +24,20 @@ struct CDiskBlockPos
READWRITE(VARINT(nPos));
}
- CDiskBlockPos() {
+ FlatFilePos() {
SetNull();
}
- CDiskBlockPos(int nFileIn, unsigned int nPosIn) {
+ FlatFilePos(int nFileIn, unsigned int nPosIn) {
nFile = nFileIn;
nPos = nPosIn;
}
- friend bool operator==(const CDiskBlockPos &a, const CDiskBlockPos &b) {
+ friend bool operator==(const FlatFilePos &a, const FlatFilePos &b) {
return (a.nFile == b.nFile && a.nPos == b.nPos);
}
- friend bool operator!=(const CDiskBlockPos &a, const CDiskBlockPos &b) {
+ friend bool operator!=(const FlatFilePos &a, const FlatFilePos &b) {
return !(a == b);
}
@@ -69,10 +69,10 @@ public:
FlatFileSeq(fs::path dir, const char* prefix, size_t chunk_size);
/** Get the name of the file at the given position. */
- fs::path FileName(const CDiskBlockPos& pos) const;
+ fs::path FileName(const FlatFilePos& pos) const;
/** Open a handle to the file at the given position. */
- FILE* Open(const CDiskBlockPos& pos, bool fReadOnly = false);
+ FILE* Open(const FlatFilePos& pos, bool fReadOnly = false);
/**
* Allocate additional space in a file after the given starting position. The amount allocated
@@ -83,7 +83,7 @@ public:
* @param[out] out_of_space Whether the allocation failed due to insufficient disk space.
* @return The number of bytes successfully allocated.
*/
- size_t Allocate(const CDiskBlockPos& pos, size_t add_size, bool& out_of_space);
+ size_t Allocate(const FlatFilePos& pos, size_t add_size, bool& out_of_space);
/**
* Commit a file to disk, and optionally truncate off extra pre-allocated bytes if final.
@@ -92,7 +92,7 @@ public:
* @param[in] finalize True if no more data will be written to this file.
* @return true on success, false on failure.
*/
- bool Flush(const CDiskBlockPos& pos, bool finalize = false);
+ bool Flush(const FlatFilePos& pos, bool finalize = false);
};
#endif // BITCOIN_FLATFILE_H