#include "leveldb/dumpfile.h"
#include <cstdio>
#include "db/dbformat.h"
#include "db/filename.h"
#include "db/log_reader.h"
#include "db/version_edit.h"
#include "db/write_batch_internal.h"
#include "leveldb/env.h"
#include "leveldb/iterator.h"
#include "leveldb/options.h"
#include "leveldb/status.h"
#include "leveldb/table.h"
#include "leveldb/write_batch.h"
#include "util/logging.h"
namespace leveldb {
namespace {
bool GuessType(const std::string& fname, FileType* type) { … }
class CorruptionReporter : public log::Reader::Reporter { … };
Status PrintLogContents(Env* env, const std::string& fname,
void (*func)(uint64_t, Slice, WritableFile*),
WritableFile* dst) { … }
class WriteBatchItemPrinter : public WriteBatch::Handler { … };
static void WriteBatchPrinter(uint64_t pos, Slice record, WritableFile* dst) { … }
Status DumpLog(Env* env, const std::string& fname, WritableFile* dst) { … }
static void VersionEditPrinter(uint64_t pos, Slice record, WritableFile* dst) { … }
Status DumpDescriptor(Env* env, const std::string& fname, WritableFile* dst) { … }
Status DumpTable(Env* env, const std::string& fname, WritableFile* dst) { … }
}
Status DumpFile(Env* env, const std::string& fname, WritableFile* dst) { … }
}