0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-28 16:34:13 +01:00

ircd::db: Reflect with string_view.

This commit is contained in:
Jason Volk 2017-09-16 11:51:52 -07:00
parent 276a902a62
commit 7d61dc4441
2 changed files with 9 additions and 8 deletions

View file

@ -98,6 +98,8 @@ namespace ircd::db
std::vector<std::string> available();
void log_rdb_perf_context(const bool &all = true);
string_view reflect(const pos &);
}
enum class ircd::db::pos

View file

@ -46,7 +46,6 @@ namespace ircd::db
throw_on_error(const rocksdb::Status & = rocksdb::Status::OK());
};
const char *reflect(const pos &);
const std::string &reflect(const rocksdb::Tickers &);
const std::string &reflect(const rocksdb::Histograms &);
rocksdb::Slice slice(const string_view &);
@ -3203,19 +3202,19 @@ ircd::db::reflect(const rocksdb::Histograms &type)
return it != end(names)? it->second : empty;
}
const char *
ircd::string_view
ircd::db::reflect(const pos &pos)
{
switch(pos)
{
case pos::NEXT: return "NEXT";
case pos::PREV: return "PREV";
case pos::FRONT: return "FRONT";
case pos::BACK: return "BACK";
case pos::END: return "END";
case pos::NEXT: return "NEXT"s;
case pos::PREV: return "PREV"s;
case pos::FRONT: return "FRONT"s;
case pos::BACK: return "BACK"s;
case pos::END: return "END"s;
}
return "?????";
return "?????"s;
}
bool