cpp-common: add bt2_common::messageTypeStr()
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 3 Aug 2022 15:56:15 +0000 (11:56 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Mon, 11 Sep 2023 15:24:02 +0000 (11:24 -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>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10838
Tested-by: jenkins <jenkins@lttng.org>
CI-Build: Philippe Proulx <eeppeliteloop@gmail.com>

src/cpp-common/Makefile.am
src/cpp-common/lib-str.hpp [new file with mode: 0644]

index e6d9602abdf0fa356f92a9fa7f1482f718fb4cea..b222ec70730d3c631f0717d4c08b5000eea76987 100644 (file)
@@ -8,6 +8,7 @@ EXTRA_DIST = bt2 \
        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.024448 seconds and 4 git commands to generate.