summaryrefslogtreecommitdiff
path: root/db/dumpfile.cc
diff options
context:
space:
mode:
authorChris Mumford <cmumford@google.com>2019-05-03 09:31:18 -0700
committerChris Mumford <cmumford@google.com>2019-05-03 09:48:57 -0700
commit9bd23c767601a2420478eec158927882b879bada (patch)
tree1b40c3712c8d882bab5d339a572e56527c145b56 /db/dumpfile.cc
parentc784d63b931d07895833fb80185b10d44ad63cce (diff)
downloadleveldb-9bd23c767601a2420478eec158927882b879bada.tar.gz
Correct class/structure declaration order.
1. Correct the class/struct declaration order to be IAW the Google C++ style guide[1]. 2. For non-copyable classes, switched from non-implemented private methods to explicitly deleted[2] methods. 3. Minor const and member initialization fixes. [1] https://google.github.io/styleguide/cppguide.html#Declaration_Order [2] http://eel.is/c++draft/dcl.fct.def.delete PiperOrigin-RevId: 246521844
Diffstat (limited to 'db/dumpfile.cc')
-rw-r--r--db/dumpfile.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/db/dumpfile.cc b/db/dumpfile.cc
index 1dbff5e..9d22d58 100644
--- a/db/dumpfile.cc
+++ b/db/dumpfile.cc
@@ -38,7 +38,6 @@ bool GuessType(const std::string& fname, FileType* type) {
// Notified when log reader encounters corruption.
class CorruptionReporter : public log::Reader::Reporter {
public:
- WritableFile* dst_;
virtual void Corruption(size_t bytes, const Status& status) {
std::string r = "corruption: ";
AppendNumberTo(&r, bytes);
@@ -47,6 +46,8 @@ class CorruptionReporter : public log::Reader::Reporter {
r.push_back('\n');
dst_->Append(r);
}
+
+ WritableFile* dst_;
};
// Print contents of a log file. (*func)() is called on every record.
@@ -73,7 +74,6 @@ Status PrintLogContents(Env* env, const std::string& fname,
// Called on every item found in a WriteBatch.
class WriteBatchItemPrinter : public WriteBatch::Handler {
public:
- WritableFile* dst_;
virtual void Put(const Slice& key, const Slice& value) {
std::string r = " put '";
AppendEscapedStringTo(&r, key);
@@ -88,6 +88,8 @@ class WriteBatchItemPrinter : public WriteBatch::Handler {
r += "'\n";
dst_->Append(r);
}
+
+ WritableFile* dst_;
};
// Called on every log record (each one of which is a WriteBatch)