+
+namespace details {
+template <typename MappingIntegerType>
+::std::string format_mapping_range(typename lttng::sessiond::trace::typed_enumeration_type<
+ MappingIntegerType>::mapping::range_t range)
+{
+ if (range.begin == range.end) {
+ return ::fmt::format("[{}]", range.begin);
+ } else {
+ return ::fmt::format("[{}, {}]", range.begin, range.end);
+ }
+}
+} /* namespace details */
+
+template <>
+struct formatter<typename lttng::sessiond::trace::signed_enumeration_type::mapping::range_t>
+ : formatter<std::string> {
+ template <typename FormatCtx>
+ typename FormatCtx::iterator
+ format(typename lttng::sessiond::trace::signed_enumeration_type::mapping::range_t range,
+ FormatCtx& ctx)
+ {
+ return format_to(ctx.out(),
+ details::format_mapping_range<
+ lttng::sessiond::trace::signed_enumeration_type::
+ mapping::range_t::range_integer_t>(
+ range));
+ }
+};
+
+template <>
+struct formatter<typename lttng::sessiond::trace::unsigned_enumeration_type::mapping::range_t>
+ : formatter<std::string> {
+ template <typename FormatCtx>
+ typename FormatCtx::iterator
+ format(typename lttng::sessiond::trace::unsigned_enumeration_type::mapping::range_t range,
+ FormatCtx& ctx)
+ {
+ return format_to(ctx.out(),
+ details::format_mapping_range<
+ lttng::sessiond::trace::unsigned_enumeration_type::
+ mapping::range_t::range_integer_t>(
+ range));
+ }
+};
+