mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
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-
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user