aboutsummaryrefslogtreecommitdiff
path: root/src/flatfile.h
diff options
context:
space:
mode:
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