cpp-common: add bt2_common::messageTypeStr()
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 3 Aug 2022 15:56:15 +0000 (11:56 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 23 Aug 2022 16:06:16 +0000 (12:06 -0400)
Change-Id: I6967d232922c7b5ad6b35cc100becb9ff8a6b968
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8651
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/cpp-common/Makefile.am
src/cpp-common/lib-str.hpp [new file with mode: 0644]

index 5fb823f16c3316e5bdec510fc42740262e69dbfe..d24d5315ee155c9b8e97de260fbbec737b314c52 100644 (file)
@@ -10,6 +10,7 @@ libcppcommon_la_SOURCES = \
        cfg-logging.hpp \
        exc.hpp \
        log-cfg.hpp \
+       lib-str.hpp \
        nlohmann/json.hpp \
        optional.hpp \
        string_view.hpp \
diff --git a/src/cpp-common/lib-str.hpp b/src/cpp-common/lib-str.hpp
new file mode 100644 (file)
index 0000000..fbd5401
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Copyright (c) 2022 EfficiOS, Inc.
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#ifndef BABELTRACE_CPP_COMMON_LIB_STR_HPP
+#define BABELTRACE_CPP_COMMON_LIB_STR_HPP
+
+#include "bt2/message.hpp"
+
+namespace bt2_common {
+
+static inline const char *messageTypeStr(const bt2::MessageType type)
+{
+    return bt_common_message_type_string(static_cast<bt_message_type>(type));
+}
+
+} /* namespace bt2_common */
+
+#endif /* BABELTRACE_CPP_COMMON_LIB_STR_HPP */
This page took 0.029989 seconds and 5 git commands to generate.