diff options
Diffstat (limited to 'src/osd/object_state_fmt.h')
-rw-r--r-- | src/osd/object_state_fmt.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/osd/object_state_fmt.h b/src/osd/object_state_fmt.h new file mode 100644 index 000000000..6b6350b94 --- /dev/null +++ b/src/osd/object_state_fmt.h @@ -0,0 +1,23 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +#pragma once +/** + * \file fmtlib formatters for some types.h classes + */ + +#include "osd/object_state.h" +#include "osd/osd_types_fmt.h" +#if FMT_VERSION >= 90000 +#include <fmt/ostream.h> +#endif + +template <> +struct fmt::formatter<ObjectState> { + constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } + + template <typename FormatContext> + auto format(const ObjectState& os, FormatContext& ctx) const + { + return fmt::format_to(ctx.out(), "exists {} oi {}", os.exists, os.oi); + } +}; |