glibmm 2.66.8
Glib::VariantIter Class Reference

VariantIter - An opaque data structure used to iterate through VariantBase containers such as arrays. More...

#include <glibmm/variantiter.h>

Public Member Functions

 VariantIter ()
 Constructs an invalid object.
 
 VariantIter (GVariantIter * castitem, bool make_a_copy=false)
 
 VariantIter (const VariantIter & src)
 
VariantIteroperator= (const VariantIter & src)
 
 VariantIter (VariantIter && other) noexcept
 
VariantIteroperator= (VariantIter && other) noexcept
 
 ~VariantIter () noexcept
 
void swap (VariantIter & other) noexcept
 
GVariantIter * gobj ()
 
const GVariantIter * gobj () const
 
GVariantIter * gobj_copy () const
 Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
 
 VariantIter (const VariantBase & variant)
 
gsize init (const VariantContainerBase & value)
 Initialises (without allocating) a VariantIter.
 
gsize get_n_children () const
 Queries the number of child items in the container that we are iterating over.
 
bool next_value (VariantBase & value)
 

Protected Attributes

GVariantIter * gobject_
 

Related Symbols

(Note that these are not member symbols.)

void swap (VariantIter & lhs, VariantIter & rhs) noexcept
 
Glib::VariantIter wrap (GVariantIter * object, bool take_copy=false)
 A Glib::wrap() method for this object.
 

Detailed Description

VariantIter - An opaque data structure used to iterate through VariantBase containers such as arrays.

Since glibmm 2.28

Constructor & Destructor Documentation

◆ VariantIter() [1/5]

Glib::VariantIter::VariantIter ( )

Constructs an invalid object.

E.g. for output arguments to methods. There is not much you can do with the object before it has been assigned a valid value.

◆ VariantIter() [2/5]

Glib::VariantIter::VariantIter ( GVariantIter * castitem,
bool make_a_copy = false )
explicit

◆ VariantIter() [3/5]

Glib::VariantIter::VariantIter ( const VariantIter & src)

◆ VariantIter() [4/5]

Glib::VariantIter::VariantIter ( VariantIter && other)
noexcept

◆ ~VariantIter()

Glib::VariantIter::~VariantIter ( )
noexcept

◆ VariantIter() [5/5]

Glib::VariantIter::VariantIter ( const VariantBase & variant)
explicit

Member Function Documentation

◆ get_n_children()

gsize Glib::VariantIter::get_n_children ( ) const

Queries the number of child items in the container that we are iterating over.

This is the total number of items – not the number of items remaining.

This function might be useful for preallocation of arrays.

Since glibmm 2.24
Returns
The number of children in the container.

◆ gobj() [1/2]

GVariantIter * Glib::VariantIter::gobj ( )
inline

◆ gobj() [2/2]

const GVariantIter * Glib::VariantIter::gobj ( ) const
inline

◆ gobj_copy()

GVariantIter * Glib::VariantIter::gobj_copy ( ) const

Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.

◆ init()

gsize Glib::VariantIter::init ( const VariantContainerBase & value)

Initialises (without allocating) a VariantIter.

iter may be completely uninitialised prior to this call; its old value is ignored.

The iterator remains valid for as long as value exists, and need not be freed in any way.

Since glibmm 2.24
Parameters
valueA container Variant.
Returns
The number of items in value.

◆ next_value()

bool Glib::VariantIter::next_value ( VariantBase & value)

◆ operator=() [1/2]

VariantIter & Glib::VariantIter::operator= ( const VariantIter & src)

◆ operator=() [2/2]

VariantIter & Glib::VariantIter::operator= ( VariantIter && other)
noexcept

◆ swap()

void Glib::VariantIter::swap ( VariantIter & other)
noexcept

Friends And Related Symbol Documentation

◆ swap()

void swap ( VariantIter & lhs,
VariantIter & rhs )
related
Parameters
lhsThe left-hand side
rhsThe right-hand side

◆ wrap()

Glib::VariantIter wrap ( GVariantIter * object,
bool take_copy = false )
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.

Member Data Documentation

◆ gobject_

GVariantIter* Glib::VariantIter::gobject_
protected