Class (GI Struct)

Gst-1.0GstIdStrSince 1.26

A Gst.IdStr is string type optimized for short strings and used for structure names, structure field names and in other places.

Strings up to 16 bytes (including NUL terminator) are stored inline, other strings are stored on the heap.

GstIdStr s = GST_ID_STR_INIT;

gst_id_str_set (&s, "Hello, World!");
g_print ("%s\n", gst_id_str_as_str (&s));

gst_id_str_clear (&s);

1.26

Index

Constructors

Properties

$gtype: GType<IdStr>

Methods

  • Returns the length of s, exluding the NUL-terminator. This is equivalent to calling strcmp() but potentially faster.

    Returns number

  • Initializes a (usually stack-allocated) id string s. The newly-initialized id string will contain an empty string by default as value.

    Returns void

  • Compares s1 and s2 for equality.

    Parameters

    • s2: string

      A string

    Returns boolean

    true if s1 and s2 are equal.

  • Compares s1 and s2 with length len for equality. s2 does not have to be NUL-terminated and len should not include the NUL-terminator.

    This is generally faster than gst_id_str_is_equal_to_str() if the length is already known.

    Parameters

    • s2: string

      A string

    • len: number

      Length of s2.

    Returns boolean

    true if s1 and s2 are equal.

  • Sets s to the string value.

    Parameters

    • value: string

      A NUL-terminated string

    Returns void

  • Sets s to the string value. value needs to be valid for the remaining lifetime of the process, e.g. has to be a static string.

    Parameters

    • value: string

      A NUL-terminated string

    Returns void

  • Sets s to the string value of length len. value needs to be valid for the remaining lifetime of the process, e.g. has to be a static string.

    value must be NUL-terminated and len should not include the NUL-terminator.

    Parameters

    • value: string

      A string

    • len: number

      Length of the string

    Returns void

  • Sets s to the string value of length len. value does not have to be NUL-terminated and len should not include the NUL-terminator.

    Parameters

    • value: string

      A string

    • len: number

      Length of the string

    Returns void