// vim: ts=8 sw=2 smarttab
#pragma once
/**
- * \file fmtlib formatters for some types.h classes
+ * \file fmtlib formatters for some osd_types.h classes
*/
#include "common/hobject.h"
+#include "include/types_fmt.h"
#include "osd/osd_types.h"
#include <fmt/chrono.h>
#include <fmt/ranges.h>
#include <fmt/ostream.h>
#endif
+namespace fmt {
template <>
-struct fmt::formatter<osd_reqid_t> {
+struct formatter<osd_reqid_t> {
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
};
template <>
-struct fmt::formatter<pg_shard_t> {
+struct formatter<pg_shard_t> {
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
if (shrd.shard == shard_id_t::NO_SHARD) {
return fmt::format_to(ctx.out(), "{}", shrd.get_osd());
}
- return fmt::format_to(ctx.out(), "{}({})", shrd.get_osd(), shrd.shard);
+ return fmt::format_to(ctx.out(), "{}({:d})", shrd.get_osd(), shrd.shard);
}
};
template <>
-struct fmt::formatter<eversion_t> {
+struct formatter<eversion_t> {
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
};
template <>
-struct fmt::formatter<chunk_info_t> {
+struct formatter<chunk_info_t> {
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
};
template <>
-struct fmt::formatter<object_manifest_t> {
+struct formatter<object_manifest_t> {
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
};
template <>
-struct fmt::formatter<object_info_t> {
+struct formatter<object_info_t> {
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
};
template <>
-struct fmt::formatter<pg_t> {
+struct formatter<pg_t> {
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
template <>
-struct fmt::formatter<spg_t> {
+struct formatter<spg_t> {
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
};
template <>
-struct fmt::formatter<pg_history_t> {
+struct formatter<pg_history_t> {
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
};
template <>
-struct fmt::formatter<pg_info_t> {
+struct formatter<pg_info_t> {
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
// snaps and snap-sets
template <>
-struct fmt::formatter<SnapSet> {
+struct formatter<SnapSet> {
template <typename ParseContext>
constexpr auto parse(ParseContext& ctx)
{
};
template <>
-struct fmt::formatter<ScrubMap::object> {
+struct formatter<ScrubMap::object> {
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
///\todo: consider passing the 'D" flag to control snapset dump
};
template <>
-struct fmt::formatter<ScrubMap> {
+struct formatter<ScrubMap> {
template <typename ParseContext>
constexpr auto parse(ParseContext& ctx)
{
};
template <>
-struct fmt::formatter<object_stat_sum_t> {
+struct formatter<object_stat_sum_t> {
constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); }
template <typename FormatContext>
#undef FORMAT
}
};
+} // namespace fmt
+
inline std::ostream &operator<<(std::ostream &lhs, const object_stat_sum_t &sum) {
return lhs << fmt::format("{}", sum);
}