### ----------------------------------------------------
### -- Gnome::Glib
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Glib/Variant.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 4
 strings

  method dup-bytestring-array ( UInt $length -->  CArray[Str]  )

=item UInt $length; (out) (optional): the length of the result, or C<Any>

=end pod

method dup-bytestring-array ( UInt $length -->  CArray[Str]  ) {

  g_variant_dup_bytestring_array(
    self._get-native-object-no-reffing, $length
  );
}

sub g_variant_dup_bytestring_array ( N-GObject $value, gsize $length --> gchar-pptr )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:dup-objv:
=begin pod
=head2 dup-objv

Gets the contents of an array of object paths B<N-GObject>.  This call makes a deep copy; the return result should be released with C<g_strfreev()>.  If I<length> is non-C<Any> then the number of elements in the result is stored there.  In any case, the resulting array will be C<Any>-terminated.  For an empty array, I<length> will be set to 0 and a pointer to a C<Any> pointer will be returned.

Returns: (array length=length zero-terminated=1) (transfer full): an array of strings

  method dup-objv ( UInt $length -->  CArray[Str]  )

=item UInt $length; (out) (optional): the length of the result, or C<Any>

=end pod

method dup-objv ( UInt $length -->  CArray[Str]  ) {

  g_variant_dup_objv(
    self._get-native-object-no-reffing, $length
  );
}

sub g_variant_dup_objv ( N-GObject $value, gsize $length --> gchar-pptr )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:dup-string:
=begin pod
=head2 dup-string

Similar to C<g_variant_get_string()> except that instead of returning a constant string, the string is duplicated.  The string will always be UTF-8 encoded.  The return value must be freed using C<g_free()>.

Returns: (transfer full): a newly allocated string, UTF-8 encoded

  method dup-string ( UInt $length -->  Str  )

=item UInt $length; (out): a pointer to a B<gsize>, to store the length

=end pod

method dup-string ( UInt $length -->  Str  ) {

  g_variant_dup_string(
    self._get-native-object-no-reffing, $length
  );
}

sub g_variant_dup_string ( N-GObject $value, gsize $length --> gchar-ptr )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:dup-strv:
=begin pod
=head2 dup-strv

Gets the contents of an array of strings B<N-GObject>.  This call makes a deep copy; the return result should be released with C<g_strfreev()>.  If I<length> is non-C<Any> then the number of elements in the result is stored there.  In any case, the resulting array will be C<Any>-terminated.  For an empty array, I<length> will be set to 0 and a pointer to a C<Any> pointer will be returned.

Returns: (array length=length zero-terminated=1) (transfer full): an array of strings

  method dup-strv ( UInt $length -->  CArray[Str]  )

=item UInt $length; (out) (optional): the length of the result, or C<Any>

=end pod

method dup-strv ( UInt $length -->  CArray[Str]  ) {

  g_variant_dup_strv(
    self._get-native-object-no-reffing, $length
  );
}

sub g_variant_dup_strv ( N-GObject $value, gsize $length --> gchar-pptr )
  is native(&glib-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
#TM:0:equal:
=begin pod
=head2 equal

Checks if I<one> and I<two> have the same type and value.  The types of I<one> and I<two> are B<gconstpointer> only to allow use of this function with B<GHashTable>.  They must each be a B<N-GObject>.

Returns: C<1> if I<one> and I<two> are equal

  method equal ( Pointer $one, Pointer $two --> Int )

=item Pointer $one; (type GVariant): a B<N-GObject> instance
=item Pointer $two; (type GVariant): a B<N-GObject> instance

=end pod

method equal ( Pointer $one, Pointer $two --> Int ) {

  g_variant_equal(
    self._get-native-object-no-reffing, $one, $two
  );
}

sub g_variant_equal ( gpointer $one, gpointer $two --> gboolean )
  is native(&glib-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
#TM:0:get:
=begin pod
=head2 get

Deconstructs a B<N-GObject> instance.  Think of this function as an analogue to C<scanf()>.  The arguments that are expected by this function are entirely determined by I<format_string>.  I<format_string> also restricts the permissible types of I<value>.  It is an error to give a value with an incompatible type.  See the section on GVariant format strings. Please note that the syntax of the format string is very likely to be extended in the future.  I<format_string> determines the C types that are used for unpacking the values and also determines if the values are copied or borrowed

  method get (  Str  $format_string )

=item  Str  $format_string; a B<N-GObject> format string @...: arguments, as per I<format_string>

=end pod

method get (  Str  $format_string ) {

  g_variant_get(
    self._get-native-object-no-reffing, $format_string
  );
}

sub g_variant_get ( N-GObject $value, gchar-ptr $format_string, Any $any = Any  )
  is native(&glib-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:get-boolean:
=begin pod
=head2 get-boolean

Returns the boolean value of I<value>.  It is an error to call this function with a I<value> of any type other than C<G_VARIANT_TYPE_BOOLEAN>.

Returns: C<True> or C<False>

  method get-boolean ( --> Bool )


=end pod

method get-boolean ( --> Bool ) {

  g_variant_get_boolean(
    self._get-native-object-no-reffing,
  ).Bool;
}

sub g_variant_get_boolean ( N-GObject $value --> gboolean )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-byte:
=begin pod
=head2 get-byte

Returns the byte value of I<value>.  It is an error to call this function with a I<value> of any type other than C<G_VARIANT_TYPE_BYTE>.

Returns: a B<guint8>

  method get-byte ( --> UInt )


=end pod

method get-byte ( --> UInt ) {

  g_variant_get_byte(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_byte ( N-GObject $value --> guint8 )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-bytestring:
=begin pod
=head2 get-bytestring

Returns the string value of a B<N-GObject> instance with an array-of-bytes type.  The string has no particular encoding.

  method get-bytestring ( -->  Str  )

=end pod

method get-bytestring ( -->  Str  ) {

  g_variant_get_bytestring(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_bytestring ( N-GObject $value --> gchar-ptr )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-bytestring-array:
=begin pod
=head2 get-bytestring-array

Gets the contents of an array of array of bytes B<N-GObject>.

  method get-bytestring-array ( -->  Array[Str]  )

=end pod

method get-bytestring-array ( -->  Array[Str]  ) {

  my CArray[Str] $ai8 = g_variant_get_bytestring_array(
    self._get-native-object-no-reffing, my gsize $length
  );

  my Array[Str] $a .= new;
  for ^$length -> $i {
    $a[$i] = $ai8[$i];
  }

  $a
}

sub g_variant_get_bytestring_array (
  N-GObject $value, gsize $length is rw --> gchar-pptr
) is native(&glib-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
# TM:0:get-child:
=begin pod
=head2 get-child

Reads a child item out of a container B<N-GObject> instance and deconstructs it according to I<format_string>.  This call is essentially a combination of C<g_variant_get_child_value()> and C<g_variant_get()>.  I<format_string> determines the C types that are used for unpacking the values and also determines if the values are copied or borrowed, see the section on [GVariant format strings][gvariant-format-strings-pointers].

  method get-child ( UInt $index_,  Str  $format_string )

=item UInt $index_; the index of the child to deconstruct
=item  Str  $format_string; a B<N-GObject> format string @...: arguments, as per I<format_string>

=end pod

method get-child ( UInt $index_,  Str  $format_string ) {

  g_variant_get_child(
    self._get-native-object-no-reffing, $index_, $format_string
  );
}

sub g_variant_get_child ( N-GObject $value, gsize $index_, gchar-ptr $format_string, Any $any = Any  )
  is native(&glib-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:get-child-value:
=begin pod
=head2 get-child-value



  method get-child-value ( UInt $index_ --> N-GObject )

=item UInt $index_;

=end pod

method get-child-value ( UInt $index_ --> N-GObject ) {

  g_variant_get_child_value(
    self._get-native-object-no-reffing, $index_
  );
}

sub g_variant_get_child_value ( N-GObject $value, gsize $index_ --> N-GObject )
  is native(&glib-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
# TM:0:get-data:
=begin pod
=head2 get-data



  method get-data ( --> Pointer )


=end pod

method get-data ( --> Pointer ) {

  g_variant_get_data(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_data ( N-GObject $value --> gpointer )
  is native(&glib-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
#TM:0:get-data-as-bytes:
=begin pod
=head2 get-data-as-bytes


  method get-data-as-bytes ( --> N-GBytes )


=end pod

method get-data-as-bytes ( --> N-GBytes ) {

  g_variant_get_data_as_bytes(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_data_as_bytes ( N-GObject $value --> N-GBytes )
  is native(&glib-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:get-double:
=begin pod
=head2 get-double

Returns the double precision floating point value of I<value>.  It is an error to call this function with a I<value> of any type other than C<G_VARIANT_TYPE_DOUBLE>.

Returns: a B<gdouble>

  method get-double ( --> Num )


=end pod

method get-double ( --> Num ) {

  g_variant_get_double(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_double ( N-GObject $value --> gdouble )
  is native(&glib-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
# TM:0:get-fixed-array:
=begin pod
=head2 get-fixed-array

Provides access to the serialised data for an array of fixed-sized items.  I<value> must be an array with fixed-sized elements.  Numeric types are fixed-size, as are tuples containing only other fixed-sized types.  I<element_size> must be the size of a single element in the array, as given by the section on [serialized data memory][gvariant-serialised-data-memory].  In particular, arrays of these fixed-sized types can be interpreted as an array of the given C type, with I<element_size> set to the size the appropriate type: - C<G_VARIANT_TYPE_INT16> (etc.): B<gint16> (etc.) - C<G_VARIANT_TYPE_BOOLEAN>: B<guchar> (not B<gboolean>!) - C<G_VARIANT_TYPE_BYTE>: B<guint8> - C<G_VARIANT_TYPE_HANDLE>: B<guint32> - C<G_VARIANT_TYPE_DOUBLE>: B<gdouble>  For example, if calling this function for an array of 32-bit integers, you might say `sizeof(gint32)`. This value isn't used except for the purpose of a double-check that the form of the serialised data matches the caller's expectation.  I<n_elements>, which must be non-C<Any>, is set equal to the number of items in the array.

Returns: (array length=n_elements) (transfer none): a pointer to the fixed array

  method get-fixed-array ( UInt $n_elements, UInt $element_size --> Pointer )

=item UInt $n_elements; (out): a pointer to the location to store the number of items
=item UInt $element_size; the size of each element

=end pod

method get-fixed-array ( UInt $n_elements, UInt $element_size --> Pointer ) {

  g_variant_get_fixed_array(
    self._get-native-object-no-reffing, $n_elements, $element_size
  );
}

sub g_variant_get_fixed_array ( N-GObject $value, gsize $n_elements, gsize $element_size --> gpointer )
  is native(&glib-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
# TM:0:get-handle:
=begin pod
=head2 get-handle

Returns the 32-bit signed integer value of I<value>.  It is an error to call this function with a I<value> of any type other than C<G_VARIANT_TYPE_HANDLE>.  By convention, handles are indexes into an array of file descriptors that are sent alongside a D-Bus message.  If you're not interacting with D-Bus, you probably don't need them.

Returns: a B<gint32>

  method get-handle ( --> Int )


=end pod

method get-handle ( --> Int ) {

  g_variant_get_handle(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_handle ( N-GObject $value --> gint32 )
  is native(&glib-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:get-int16:
=begin pod
=head2 get-int16

Returns the 16-bit signed integer value of I<value>.  It is an error to call this function with a I<value> of any type other than C<G_VARIANT_TYPE_INT16>.

Returns: a B<gint16>

  method get-int16 ( --> Int )


=end pod

method get-int16 ( --> Int ) {

  g_variant_get_int16(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_int16 ( N-GObject $value --> gint16 )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-int32:
=begin pod
=head2 get-int32

Returns the 32-bit signed integer value of I<value>.  It is an error to call this function with a I<value> of any type other than C<G_VARIANT_TYPE_INT32>.

Returns: a B<gint32>

  method get-int32 ( --> Int )


=end pod

method get-int32 ( --> Int ) {

  g_variant_get_int32(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_int32 ( N-GObject $value --> gint32 )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-int64:
=begin pod
=head2 get-int64

Returns the 64-bit signed integer value of I<value>.  It is an error to call this function with a I<value> of any type other than C<G_VARIANT_TYPE_INT64>.

Returns: a B<gint64>

  method get-int64 ( --> Int )


=end pod

method get-int64 ( --> Int ) {

  g_variant_get_int64(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_int64 ( N-GObject $value --> gint64 )
  is native(&glib-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:get-maybe:
=begin pod
=head2 get-maybe

Given a maybe-typed B<N-GObject> instance, extract its value.  If the value is Nothing, then this function returns C<Any>.

Returns: (nullable) (transfer full): the contents of I<value>, or C<Any>

  method get-maybe ( --> N-GObject )


=end pod

method get-maybe ( --> N-GObject ) {

  g_variant_get_maybe(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_maybe ( N-GObject $value --> N-GObject )
  is native(&glib-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
# TM:0:get-normal-form:
=begin pod
=head2 get-normal-form

Gets a B<N-GObject> instance that has the same value as I<value> and is trusted to be in normal form.  If I<value> is already trusted to be in normal form then a new reference to I<value> is returned.  If I<value> is not already trusted, then it is scanned to check if it is in normal form.  If it is found to be in normal form then it is marked as trusted and a new reference to it is returned.  If I<value> is found not to be in normal form then a new trusted B<N-GObject> is created with the same value as I<value>.  It makes sense to call this function if you've received B<N-GObject> data from untrusted sources and you want to ensure your serialised output is definitely in normal form.  If I<value> is already in normal form, a new reference will be returned (which will be floating if I<value> is floating). If it is not in normal form, the newly created B<N-GObject> will be returned with a single non-floating reference. Typically, C<g_variant_take_ref()> should be called on the return value from this function to guarantee ownership of a single non-floating reference to it.

Returns: (transfer full): a trusted B<N-GObject>

  method get-normal-form ( --> N-GObject )


=end pod

method get-normal-form ( --> N-GObject ) {

  g_variant_get_normal_form(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_normal_form ( N-GObject $value --> N-GObject )
  is native(&glib-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
# TM:0:get-objv:
=begin pod
=head2 get-objv

Gets the contents of an array of object paths B<N-GObject>.  This call makes a shallow copy; the return result should be released with C<g_free()>, but the individual strings must not be modified.  If I<length> is non-C<Any> then the number of elements in the result is stored there.  In any case, the resulting array will be C<Any>-terminated.  For an empty array, I<length> will be set to 0 and a pointer to a C<Any> pointer will be returned.

Returns: (array length=length zero-terminated=1) (transfer container): an array of constant strings

  method get-objv ( UInt $length -->  CArray[Str]  )

=item UInt $length; (out) (optional): the length of the result, or C<Any>

=end pod

method get-objv ( UInt $length -->  CArray[Str]  ) {

  g_variant_get_objv(
    self._get-native-object-no-reffing, $length
  );
}

sub g_variant_get_objv ( N-GObject $value, gsize $length --> gchar-pptr )
  is native(&glib-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
# TM:0:get-size:
=begin pod
=head2 get-size



  method get-size ( --> UInt )


=end pod

method get-size ( --> UInt ) {

  g_variant_get_size(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_size ( N-GObject $value --> gsize )
  is native(&glib-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:get-string:
=begin pod
=head2 get-string

Returns the string value of a B<N-GObject> instance with a string type.

  method get-string ( -->  Str  )

=end pod

method get-string ( -->  Str  ) {

  my Str $s = g_variant_get_string(
    self._get-native-object-no-reffing, my gsize $length
  );

  $s
}

sub g_variant_get_string (
  N-GObject $value, gsize $length is rw --> gchar-ptr
) is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-strv:
=begin pod
=head2 get-strv

Gets the contents of an array of strings B<N-GObject>. This call makes a shallow copy.

  method get-strv ( --> Array[Str]  )

=end pod

method get-strv ( --> Array[Str]  ) {

  my CArray[Str] $astr = g_variant_get_strv(
    self._get-native-object-no-reffing, my gsize $length
  );

  my Array[Str] $a .= new;
  for ^$length -> $i {
    $a[$i] = $astr[$i];
  }

  $a
}

sub g_variant_get_strv ( N-GObject $value, gsize $length is rw --> gchar-pptr )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-type:
=begin pod
=head2 get-type

Determines the type of I<value>.  The return value is valid for the lifetime of I<value> and must not be freed.

Returns: a B<GVariantType>

  method get-type ( --> Gnome::Glib::Variant )


=end pod

method get-type ( --> Gnome::Glib::VariantType ) {

  Gnome::Glib::VariantType.new(
    :native-object(g_variant_get_type(self._get-native-object-no-reffing))
  );
}

sub g_variant_get_type ( N-GObject $value --> N-GObject )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-type-string:
=begin pod
=head2 get-type-string

Returns the type string of I<value>.  Unlike the result of calling C<g_variant_type_peek_string()>, this string is nul-terminated.  This string belongs to B<N-GObject> and must not be freed.

Returns: the type string for the type of I<value>

  method get-type-string ( -->  Str  )


=end pod

method get-type-string ( -->  Str  ) {

  g_variant_get_type_string(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_type_string ( N-GObject $value --> gchar-ptr )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-uint16:
=begin pod
=head2 get-uint16

Returns the 16-bit unsigned integer value of I<value>.  It is an error to call this function with a I<value> of any type other than C<G_VARIANT_TYPE_UINT16>.

Returns: a B<guint16>

  method get-uint16 ( --> UInt )


=end pod

method get-uint16 ( --> UInt ) {

  g_variant_get_uint16(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_uint16 ( N-GObject $value --> guint16 )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-uint32:
=begin pod
=head2 get-uint32

Returns the 32-bit unsigned integer value of I<value>.  It is an error to call this function with a I<value> of any type other than C<G_VARIANT_TYPE_UINT32>.

Returns: a B<guint32>

  method get-uint32 ( --> UInt )


=end pod

method get-uint32 ( --> UInt ) {

  g_variant_get_uint32(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_uint32 ( N-GObject $value --> guint32 )
  is native(&glib-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:get-uint64:
=begin pod
=head2 get-uint64

Returns the 64-bit unsigned integer value of I<value>.  It is an error to call this function with a I<value> of any type other than C<G_VARIANT_TYPE_UINT64>.

Returns: a B<guint64>

  method get-uint64 ( --> UInt )


=end pod

method get-uint64 ( --> UInt ) {

  g_variant_get_uint64(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_get_uint64 ( N-GObject $value --> guint64 )
  is native(&glib-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
# TM:0:get-va:
=begin pod
=head2 get-va

This function is intended to be used by libraries based on B<N-GObject> that want to provide C<g_variant_get()>-like functionality to their users.  The API is more general than C<g_variant_get()> to allow a wider range of possible uses.  I<format_string> must still point to a valid format string, but it only need to be nul-terminated if I<endptr> is C<Any>.  If I<endptr> is non-C<Any> then it is updated to point to the first character past the end of the format string.  I<app> is a pointer to a B<va_list>.  The arguments, according to I<format_string>, are collected from this B<va_list> and the list is left pointing to the argument following the last.  These two generalisations allow mixing of multiple calls to C<g_variant_new_va()> and C<g_variant_get_va()> within a single actual varargs call by the user.  I<format_string> determines the C types that are used for unpacking the values and also determines if the values are copied or borrowed, see the section on [GVariant format strings][gvariant-format-strings-pointers].

  method get-va (  Str  $format_string,  CArray[Str]  $endptr, va_list $app )

=item  Str  $format_string; a string that is prefixed with a format string
=item  CArray[Str]  $endptr; (nullable) (default NULL): location to store the end pointer, or C<Any>
=item va_list $app; a pointer to a B<va_list>

=end pod

method get-va (  Str  $format_string,  CArray[Str]  $endptr, va_list $app ) {

  g_variant_get_va(
    self._get-native-object-no-reffing, $format_string, $endptr, $app
  );
}

sub g_variant_get_va ( N-GObject $value, gchar-ptr $format_string, gchar-pptr $endptr, va_list $app  )
  is native(&glib-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:get-variant:
=begin pod
=head2 get-variant

Unboxes I<value>. The result is the B<Gnome::Glib::Variant> that was contained in I<value>.

Returns: the item contained in the variant

  method get-variant ( --> Gnome::Glib::Variant )


=end pod

method get-variant ( --> Gnome::Glib::Variant ) {

  Gnome::Glib::Variant.new(
    :native-object(g_variant_get_variant(self._get-native-object-no-reffing))
  );
}

sub g_variant_get_variant ( N-GObject $value --> N-GObject )
  is native(&glib-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
# TM:0:hash:
=begin pod
=head2 hash

Generates a hash value for a B<N-GObject> instance.  The output of this function is guaranteed to be the same for a given value only per-process.  It may change between different processor architectures or even different versions of GLib.  Do not use this function as a basis for building protocols or file formats.  The type of I<value> is B<gconstpointer> only to allow use of this function with B<GHashTable>.  I<value> must be a B<N-GObject>.

Returns: a hash value corresponding to I<value>

  method hash ( Pointer $value --> UInt )

=item Pointer $value; (type GVariant): a basic B<N-GObject> value as a B<gconstpointer>

=end pod

method hash ( Pointer $value --> UInt ) {

  g_variant_hash(
    self._get-native-object-no-reffing, $value
  );
}

sub g_variant_hash ( gpointer $value --> guint )
  is native(&glib-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:is-container:
=begin pod
=head2 is-container

Checks if I<value> is a container.

Returns: C<1> if I<value> is a container

  method is-container ( --> Int )


=end pod

method is-container ( --> Int ) {

  g_variant_is_container(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_is_container ( N-GObject $value --> gboolean )
  is native(&glib-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
# TM:0:is-floating:
=begin pod
=head2 is-floating



  method is-floating ( --> Int )


=end pod

method is-floating ( --> Int ) {

  g_variant_is_floating(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_is_floating ( N-GObject $value --> gboolean )
  is native(&glib-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
# TM:0:is-normal-form:
=begin pod
=head2 is-normal-form



  method is-normal-form ( --> Int )


=end pod

method is-normal-form ( --> Int ) {

  g_variant_is_normal_form(
    self._get-native-object-no-reffing,
  );
}

sub g_variant_is_normal_form ( N-GObject $value --> gboolean )
  is native(&glib-lib)
  { * }
}}
#`{{
#-------------------------------------------------------------------------------
# TM:0:is-object-path:
=begin pod
=head2 is-object-path

Determines if a given string is a valid D-Bus object path.  You should ensure that a string is a valid D-Bus object path before passing it to C<g_variant_new_object_path()>.  A valid object path starts with `/` followed by zero or more sequences of characters separated by `/` characters.  Each sequence must contain only the characters `[A-Z][a-z][0-9]_`.  No sequence (including the one following the final `/` character) may be empty.

Returns: C<1> if I<string> is a D-Bus object path

  method is-object-path (  Str  $string --> Int )

=item  Str  $string; a normal C nul-terminated string

=end pod

method is-object-path (  Str  $string --> Int ) {

  g_variant_is_object_path(
    self._get-native-object-no-reffing, $string
  );
}

sub g_variant_is_object_path ( gchar-ptr $string --> gboolean )
  is native(&glib-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:is-of-type:
=begin pod
=head2 is-of-type

Checks if a value has a type matching the provided type.

Returns: C<True> if the type of I<value> matches I<type>

  method is-of-type ( N-GObject $type --> Bool )

=item N-GObject $type; a B<GVariantType>

=end pod

method is-of-type ( $type --> Bool ) {
  my $no = $type;
  $no .= _get-native-object-no-reffing unless $no ~~ N-GObject;

  g_variant_is_of_type(
    self._get-native-object-no-reffing, $no
  ).Bool;
}

sub g_variant_is_of_type ( N-GObject $value, N-GObject $type --> gboolean )
  is native(&glib-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
# TM:0:is-signature:
=begin pod
=head2 is-signature

Determines if a given string is a valid D-Bus type signature.  You should ensure that a string is a valid D-Bus type signature before passing it to C<g_variant_new_signature()>.  D-Bus type signatures consist of zero or more definite B<GVariantType> strings in sequence.

Returns: C<1> if I<string> is a D-Bus type signature

  method is-signature (  Str  $string --> Int )

=item  Str  $string; a normal C nul-terminated string

=end pod

method is-signature (  Str  $string --> Int ) {

  g_variant_is_signature(
    self._get-native-object-no-reffing, $string
  );
}

sub g_variant_is_signature ( gchar-ptr $string --> gboolean )
  is native(&glib-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
#TM:0:lookup:
=begin pod
=head2 lookup

Looks up a value in a dictionary B<N-GObject>.  This function is a wrapper around C<g_variant_lookup_value()> and C<g_variant_get()>.  In the case that C<Any> would have been returned, this function returns C<0>.  Otherwise, it unpacks the returned value and returns C<1>.  I<format_string> determines the C types that are used for unpacking the values and also determines if the values are copied or borrowed, see the section on [GVariant format strings][gvariant-format-strings-pointers].  This function is currently implemented with a linear scan.  If you plan to do many lookups then B<N-GObjectDict> may be more efficient.

Returns: C<1> if a value was unpacked

  method lookup (  Str  $key,  Str  $format_string --> Int )

=item  Str  $key; the key to lookup in the dictionary
=item  Str  $format_string; a GVariant format string @...: the arguments to unpack the value into

=end pod

method lookup (  Str  $key,  Str  $format_string --> Int ) {

  g_variant_lookup(
    self._get-native-object-no-reffing, $key, $format_string
  );
}

sub g_variant_lookup ( N-GObject $dictionary, gchar-ptr $key, gchar-ptr $format_string, Any $any = Any --> gboolean )
  is native(&glib-lib)
  { * }
}}

#`{{

#-------------------------------------------------------------------------------
# TM:0:lookup-value:
=begin pod
=head2 lookup-value

Looks up a value in a dictionary B<N-GObject>. This function works with dictionaries of the type a{s*} (and equally well with type a{o*}, but we only further discuss the string case for sake of clarity). In the event that I<dictionary> has the type a{sv}, the I<expected_type> string specifies what type of value is expected to be inside of the variant. If the value inside the variant has a different type then undefined is returned. In the event that I<dictionary> has a value type other than v then I<expected_type> must directly match the value type and it is used to unpack the value directly or an error occurs.  In either case, if I<key> is not found in I<dictionary>, C<Any> is returned.  If the key is found and the value has the correct type, it is returned.  If I<expected_type> was specified then any non-C<Any> return value will have this type.  This function is currently implemented with a linear scan.  If you plan to do many lookups then B<N-GObjectDict> may be more efficient.

Returns: (transfer full): the value of the dictionary key, or C<Any>

  method lookup-value (  Str  $key, N-GObject $expected_type --> N-GObject )

=item  Str  $key; the key to lookup in the dictionary
=item N-GObject $expected_type; (nullable): a B<GVariantType>, or C<Any>

=end pod

