mdbx++: refine operator<<(ostream, pair).

Change-Id: I0f42c17a241cf4e2ed6ae8f18e84a13ba5500a3b
This commit is contained in:
Leonid Yuriev 2020-10-31 18:22:05 +03:00
parent 4e198915f2
commit e3f32ec6b4

View File

@ -1282,9 +1282,13 @@ __cold ::std::ostream &operator<<(::std::ostream &out, const slice &it) {
out << "EMPTY->" << it.data();
else {
const slice root(it.head(std::min(it.length(), size_t(64))));
out << it.length() << "->"
<< (root.is_printable() ? root.string() : root.base58_encode())
<< ((root == it) ? "" : "...");
out << it.length() << ".";
if (root.is_printable())
(out << "\"").write(root.char_ptr(), root.length()) << "\"";
else
out << root.base58_encode();
if (root.length() < it.length())
out << "...";
}
return out << "}";
}