### ----------------------------------------------------
### -- Gnome::Glib
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Glib/Variant.rakumod
### ----------------------------------------------------
### -- Chunk 4 of 4
, use this with C<g_variant_new_maybe()>.  This function consumes I<string>.  C<g_free()> will be called on I<string> when it is no longer required.  You must not modify or access I<string> in any other way after passing it to this function.  It is even possible that I<string> is immediately freed.

Returns: (transfer none): a floating reference to a new string B<N-GObject> instance

  method _g_variant_new_take_string (  Str  $string --> N-GObject )

=item  Str  $string; a normal UTF-8 nul-terminated string

=end pod
}}

sub _g_variant_new_take_string ( gchar-ptr $string --> N-GObject )
  is native(&glib-lib)
  is symbol('g_variant_new_take_string')
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:_g_variant_new_tuple:
#`{{
=begin pod
=head2 _g_variant_new_tuple

Creates a new tuple B<N-GObject> out of the items in I<children>.  The type is determined from the types of I<children>.  No entry in the I<children> array may be C<Any>.  If I<n_children> is 0 then the unit tuple is constructed.  If the I<children> are floating references (see C<g_variant_ref_sink()>), the new instance takes ownership of them as if via C<g_variant_ref_sink()>.

Returns: (transfer none): a floating reference to a new B<N-GObject> tuple

  method _g_variant_new_tuple (  $GVariant * const *children, UInt $n_children --> N-GObject )

=item  $GVariant * const *children; (array length=n_children): the items to make the tuple out of
=item UInt $n_children; the length of I<children>

=end pod
}}

sub _g_variant_new_tuple ( CArray[N-GObject] $children, gsize $n_children --> N-GObject )
  is native(&glib-lib)
  is symbol('g_variant_new_tuple')
  { * }

#-------------------------------------------------------------------------------
#TM:1:_g_variant_new_uint16:
#`{{
=begin pod
=head2 _g_variant_new_uint16

Creates a new uint16 B<N-GObject> instance.

Returns: (transfer none): a floating reference to a new uint16 B<N-GObject> instance

  method _g_variant_new_uint16 ( UInt $value --> N-GObject )

=item UInt $value; a B<guint16> value

=end pod
}}

sub _g_variant_new_uint16 ( guint16 $value --> N-GObject )
  is native(&glib-lib)
  is symbol('g_variant_new_uint16')
  { * }

#-------------------------------------------------------------------------------
#TM:1:_g_variant_new_uint32:
#`{{
=begin pod
=head2 _g_variant_new_uint32

Creates a new uint32 B<N-GObject> instance.

Returns: (transfer none): a floating reference to a new uint32 B<N-GObject> instance

  method _g_variant_new_uint32 ( UInt $value --> N-GObject )

=item UInt $value; a B<guint32> value

=end pod
}}

sub _g_variant_new_uint32 ( guint32 $value --> N-GObject )
  is native(&glib-lib)
  is symbol('g_variant_new_uint32')
  { * }

#-------------------------------------------------------------------------------
#TM:1:_g_variant_new_uint64:
#`{{
=begin pod
=head2 _g_variant_new_uint64

Creates a new uint64 B<N-GObject> instance.

Returns: (transfer none): a floating reference to a new uint64 B<N-GObject> instance

  method _g_variant_new_uint64 ( UInt $value --> N-GObject )

=item UInt $value; a B<guint64> value

=end pod
}}

sub _g_variant_new_uint64 ( guint64 $value --> N-GObject )
  is native(&glib-lib)
  is symbol('g_variant_new_uint64')
  { * }

#`{{
#-------------------------------------------------------------------------------
# TM:1:_g_variant_new_va:
#`{{
=begin pod
=head2 _g_variant_new_va

This function is intended to be used by libraries based on B<N-GObject> that want to provide C<g_variant_new()>-like functionality to their users.  The API is more general than C<g_variant_new()> to allow a wider range of possible uses.  I<format_string> must still point to a valid format string, but it only needs 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.  Note that the arguments in I<app> must be of the correct width for their types specified in I<format_string> when collected into the B<va_list>. See the [GVariant varargs documentation][gvariant-varargs].  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.  The return value will be floating if it was a newly created GVariant instance (for example, if the format string was "(ii)").  In the case that the format_string was '*', '?', 'r', or a format starting with '@' then the collected B<N-GObject> pointer will be returned unmodified, without adding any additional references.  In order to behave correctly in all cases it is necessary for the calling function to C<g_variant_ref_sink()> the return result before returning control to the user that originally provided the pointer. At this point, the caller will have their own full reference to the result.  This can also be done by adding the result to a container, or by passing it to another C<g_variant_new()> call.

Returns: a new, usually floating, B<N-GObject>

  method _g_variant_new_va (  Str  $format_string,  CArray[Str]  $endptr, va_list $app --> N-GObject )

=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
}}

sub _g_variant_new_va ( gchar-ptr $format_string, gchar-pptr $endptr, va_list $app --> N-GObject )
  is native(&glib-lib)
  is symbol('g_variant_new_va')
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:_g_variant_new_variant:
#`{{
=begin pod
=head2 _g_variant_new_variant

Boxes I<value>.  The result is a B<N-GObject> instance representing a variant containing the original value.  If I<child> is a floating reference (see C<g_variant_ref_sink()>), the new instance takes ownership of I<child>.

Returns: (transfer none): a floating reference to a new variant B<N-GObject> instance

  method _g_variant_new_variant ( --> N-GObject )


=end pod
}}

sub _g_variant_new_variant ( N-GObject $value --> N-GObject )
  is native(&glib-lib)
  is symbol('g_variant_new_variant')
  { * }


