rgw: add ability to easily display ListParams

During debugging it can be useful to see all the contents of
rgw::sal::Bucket::ListParams. This allows the structure to be dumped
to an output stream in human-readable format.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
This commit is contained in:
J. Eric Ivancich 2021-11-11 11:10:17 -05:00
parent 2a10bf52a9
commit 037ce8c4dd

View File

@ -553,6 +553,20 @@ class Bucket {
bool list_versions{false};
bool allow_unordered{false};
int shard_id{RGW_NO_SHARD};
friend std::ostream& operator<<(std::ostream& out, const ListParams& p) {
out << "rgw::sal::Bucket::ListParams{ prefix=\"" << p.prefix <<
"\", delim=\"" << p.delim <<
"\", marker=\"" << p.marker <<
"\", end_marker=\"" << p.end_marker <<
"\", ns=\"" << p.ns <<
"\", enforce_ns=" << p.enforce_ns <<
", list_versions=" << p.list_versions <<
", allow_unordered=" << p.allow_unordered <<
", shard_id=" << p.shard_id <<
" }";
return out;
}
};
/**
* @brief Results from a bucket list operation