cpp-common/bt2c: add `format_as` function for `bt2::MessageType`
[babeltrace.git] / src / cpp-common / bt2c / fmt.hpp
diff --git a/src/cpp-common/bt2c/fmt.hpp b/src/cpp-common/bt2c/fmt.hpp
new file mode 100644 (file)
index 0000000..8db4b1b
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2024 EfficiOS, inc.
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#include "common/common.h"
+#include "cpp-common/bt2/message.hpp"
+#include "cpp-common/vendor/fmt/format.h" /* IWYU pragma: keep */
+
+namespace bt2 {
+
+inline const char *format_as(const MessageType type)
+{
+    return bt_common_message_type_string(static_cast<bt_message_type>(type));
+}
+
+} /* namespace bt2 */
This page took 0.023573 seconds and 4 git commands to generate.