cpp-common/bt2: add `CommonStringField::length` method
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 12 Feb 2024 19:30:07 +0000 (14:30 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 19 Feb 2024 18:10:15 +0000 (13:10 -0500)
Add this method, which wraps `bt_field_string_get_length`.

Change-Id: Ie662e1fe84c56e6f3d48cadcd5f3c4d153ea108d
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11786
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
src/cpp-common/bt2/field.hpp

index 0efd7e74659caf0b821e08a2f2b16b62dda1e8b1..e051a806e4ab2ca1104bcbf42e2d24e93db78e2b 100644 (file)
@@ -1008,6 +1008,11 @@ public:
     {
         return bt_field_string_get_value(this->libObjPtr());
     }
+
+    std::uint64_t length() const noexcept
+    {
+        return bt_field_string_get_length(this->libObjPtr());
+    }
 };
 
 using StringField = CommonStringField<bt_field>;
This page took 0.02813 seconds and 4 git commands to generate.