sink.text.details: print bit array field classes and fields
[babeltrace.git] / src / plugins / text / details / write.c
index fa150b6abe6bfb54b438686d4aaf30bf6d1c1345..6f3d69d796b2d096fa019775324638f0d938d6e2 100644 (file)
@@ -780,6 +780,9 @@ void write_field_class(struct details_write_ctx *ctx, const bt_field_class *fc)
        case BT_FIELD_CLASS_TYPE_BOOL:
                type = "Boolean";
                break;
+       case BT_FIELD_CLASS_TYPE_BIT_ARRAY:
+               type = "Bit array";
+               break;
        case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
                type = "Unsigned integer";
                break;
@@ -1520,6 +1523,12 @@ void write_field(struct details_write_ctx *ctx, const bt_field *field,
                write_sp(ctx);
                write_bool_prop_value(ctx, bt_field_bool_get_value(field));
                break;
+       case BT_FIELD_CLASS_TYPE_BIT_ARRAY:
+               format_uint(buf, bt_field_bit_array_get_value_as_integer(field),
+                       16);
+               write_sp(ctx);
+               write_uint_str_prop_value(ctx, buf);
+               break;
        case BT_FIELD_CLASS_TYPE_UNSIGNED_INTEGER:
        case BT_FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION:
        case BT_FIELD_CLASS_TYPE_SIGNED_INTEGER:
@@ -1598,7 +1607,8 @@ void write_field(struct details_write_ctx *ctx, const bt_field *field,
 
                        decr_indent(ctx);
                } else {
-                       g_string_append(ctx->str, " Empty");
+                       write_sp(ctx);
+                       write_none_prop_value(ctx, "Empty");
                }
 
                break;
@@ -1609,7 +1619,8 @@ void write_field(struct details_write_ctx *ctx, const bt_field *field,
                uint64_t length = bt_field_array_get_length(field);
 
                if (length == 0) {
-                       g_string_append(ctx->str, " Empty");
+                       write_sp(ctx);
+                       write_none_prop_value(ctx, "Empty");
                } else {
                        g_string_append(ctx->str, " Length ");
                        write_uint_prop_value(ctx, length);
This page took 0.027123 seconds and 4 git commands to generate.