8 #ifndef DBUSCXX_VARIANT_ITERATOR_H
9 #define DBUSCXX_VARIANT_ITERATOR_H
37 std::shared_ptr<Demarshaling> demarshal );
49 v =
static_cast<T
>( *this );
63 operator std::string();
67 operator std::vector<T>() {
72 std::vector<T> retval;
80 retval.push_back( val );
86 template <
typename Key,
typename Data>
87 operator std::map<Key, Data>() {
92 std::map<Key, Data> dict;
102 subSubiter >> val_key;
103 subSubiter >> val_data;
104 dict[ val_key ] = val_data;
114 template <
typename ...T>
115 operator std::tuple<T...>() {
116 std::tuple<T...> tup;
119 std::apply( [subiter](
auto&& ...arg )
mutable {
120 ( subiter >> ... >> arg );
A SignatureIterator allows you to iterate over a given DBus signature, and to extract useful informat...
Definition: signatureiterator.h:33
Represents a DBus signature.
Definition: signature.h:74
A Variant is a type-safe union for DBus operations.
Definition: variant.h:42
Definition: variantiterator.h:24
uint16_t get_uint16()
Definition: variantiterator.cpp:459
VariantIterator recurse()
Definition: variantiterator.cpp:144
bool is_container() const
True if the iterator points to a container.
Definition: variantiterator.cpp:165
VariantIterator & operator++()
Definition: variantiterator.cpp:120
bool is_valid() const
True if this is a valid iterator.
Definition: variantiterator.cpp:74
bool get_bool()
Definition: variantiterator.cpp:435
bool is_dict() const
True if the iterator points to a dictionary.
Definition: variantiterator.cpp:174
uint64_t get_uint64()
Definition: variantiterator.cpp:491
bool has_next() const
True if there are any more fields left to iterate over.
Definition: variantiterator.cpp:91
int64_t get_int64()
Definition: variantiterator.cpp:483
double get_double()
Definition: variantiterator.cpp:499
VariantIterator & operator>>(Variant &v)
Definition: variantiterator.cpp:530
std::string get_string()
Definition: variantiterator.cpp:507
bool is_array() const
True if the iterator points to an array.
Definition: variantiterator.cpp:170
std::shared_ptr< priv_data > m_priv
Definition: variantiterator.h:187
uint32_t get_uint32()
Definition: variantiterator.cpp:475
bool next()
Moves the iterator to the next field and invalidates it if it moves beyond the last field.
Definition: variantiterator.cpp:97
Signature get_signature()
Definition: variantiterator.cpp:526
DataType arg_type() const
Returns the argument type that the iterator points to.
Definition: variantiterator.cpp:132
bool is_fixed() const
True if the element type is a fixed type.
Definition: variantiterator.cpp:160
Variant get_variant()
Definition: variantiterator.cpp:519
uint8_t get_uint8()
Definition: variantiterator.cpp:443
void invalidate()
Definition: variantiterator.cpp:70
VariantIterator()
Definition: variantiterator.cpp:38
DataType element_type() const
Returns the element type of the array that the iterator points to.
Definition: variantiterator.cpp:136
int32_t get_int32()
Definition: variantiterator.cpp:467
int16_t get_int16()
Definition: variantiterator.cpp:451
VariantIterator & operator>>(T &v)
Definition: variantiterator.h:48
Global DBus namespace, where everything happens.
Definition: callmessage.cpp:18
DataType
Definition: enums.h:52