aboutsummaryrefslogtreecommitdiff
path: root/src/flatfile.cpp
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.cpp
parentd6d8a78f26f52fdfe43293686135e2fc6919926c (diff)
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.cpp')
-rw-r--r--src/flatfile.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/flatfile.cpp b/src/flatfile.cpp
index b1ea257da1..d2e11825d5 100644
--- a/src/flatfile.cpp
+++ b/src/flatfile.cpp
@@ -20,17 +20,17 @@ FlatFileSeq::FlatFileSeq(fs::path dir, const char* prefix, size_t chunk_size) :
}
}
-std::string CDiskBlockPos::ToString() const
+std::string FlatFilePos::ToString() const
{
- return strprintf("CDiskBlockPos(nFile=%i, nPos=%i)", nFile, nPos);
+ return strprintf("FlatFilePos(nFile=%i, nPos=%i)", nFile, nPos);
}
-fs::path FlatFileSeq::FileName(const CDiskBlockPos& pos) const
+fs::path FlatFileSeq::FileName(const FlatFilePos& pos) const
{
return m_dir / strprintf("%s%05u.dat", m_prefix, pos.nFile);
}
-FILE* FlatFileSeq::Open(const CDiskBlockPos& pos, bool fReadOnly)
+FILE* FlatFileSeq::Open(const FlatFilePos& pos, bool fReadOnly)
{
if (pos.IsNull())
return nullptr;
@@ -53,7 +53,7 @@ FILE* FlatFileSeq::Open(const CDiskBlockPos& pos, bool fReadOnly)
return file;
}
-size_t FlatFileSeq::Allocate(const CDiskBlockPos& pos, size_t add_size, bool& out_of_space)
+size_t FlatFileSeq::Allocate(const FlatFilePos& pos, size_t add_size, bool& out_of_space)
{
out_of_space = false;
@@ -79,7 +79,7 @@ size_t FlatFileSeq::Allocate(const CDiskBlockPos& pos, size_t add_size, bool& ou
return 0;
}
-bool FlatFileSeq::Flush(const CDiskBlockPos& pos, bool finalize)
+bool FlatFileSeq::Flush(const FlatFilePos& pos, bool finalize)
{
FILE* file = Open(FlatFilePos(pos.nFile, 0)); // Avoid fseek to nPos
if (!file) {