Lines Matching refs:fname
23 bool GuessType(const std::string& fname, FileType* type) {
24 size_t pos = fname.rfind('/');
27 basename = fname;
29 basename = std::string(fname.data() + pos + 1, fname.size() - pos - 1);
46 bool PrintLogContents(Env* env, const std::string& fname,
49 Status s = env->NewSequentialFile(fname, &file);
104 bool DumpLog(Env* env, const std::string& fname) {
105 return PrintLogContents(env, fname, WriteBatchPrinter);
120 bool DumpDescriptor(Env* env, const std::string& fname) {
121 return PrintLogContents(env, fname, VersionEditPrinter);
124 bool DumpTable(Env* env, const std::string& fname) {
128 Status s = env->GetFileSize(fname, &file_size);
130 s = env->NewRandomAccessFile(fname, &file);
184 bool DumpFile(Env* env, const std::string& fname) {
186 if (!GuessType(fname, &ftype)) {
187 fprintf(stderr, "%s: unknown file type\n", fname.c_str());
191 case kLogFile: return DumpLog(env, fname);
192 case kDescriptorFile: return DumpDescriptor(env, fname);
193 case kTableFile: return DumpTable(env, fname);
196 fprintf(stderr, "%s: not a dump-able file type\n", fname.c_str());