#include <GVariantTupleReader.h>
Helper class to read values from a tuple represented by GLib's GVariant*
.
See GVariant Format Strings for type strings explanation.
◆ ~GVariantTupleReader()
alexaClientSDK::bluetoothImplementations::blueZ::GVariantTupleReader::~GVariantTupleReader |
( |
| ) |
|
◆ GVariantTupleReader() [1/3]
alexaClientSDK::bluetoothImplementations::blueZ::GVariantTupleReader::GVariantTupleReader |
( |
GVariant * |
originalVariant | ) |
|
|
explicit |
Constructor to initialize the reader with raw GVariant*
value
- Parameters
-
originalVariant | GVariant* value |
◆ GVariantTupleReader() [2/3]
alexaClientSDK::bluetoothImplementations::blueZ::GVariantTupleReader::GVariantTupleReader |
( |
ManagedGVariant & |
originalVariant | ) |
|
|
explicit |
Constructor to initialize the reader with the reference to ManagedGVariant
- Parameters
-
◆ GVariantTupleReader() [3/3]
alexaClientSDK::bluetoothImplementations::blueZ::GVariantTupleReader::GVariantTupleReader |
( |
const GVariantTupleReader & |
other | ) |
|
◆ forEach()
bool alexaClientSDK::bluetoothImplementations::blueZ::GVariantTupleReader::forEach |
( |
std::function< bool(GVariant *value)> |
iteratorFunction | ) |
const |
Helper function to traverse all the elements in a tuple
- Parameters
-
iteratorFunction | Accepts GVariant* and returns true if iteration should be continued and false if no more iterations required. |
- Returns
- true if traversal was stopped because one of the callback invocations returned true. If none of the callback invocations returned false - method returns false.
◆ getBoolean()
gboolean alexaClientSDK::bluetoothImplementations::blueZ::GVariantTupleReader::getBoolean |
( |
gsize |
index | ) |
const |
Get the boolean value by index
- Parameters
-
index | Zero based index of the value in tuple |
- Returns
- A
gboolean
value. The default value is false.
◆ getCString()
char* alexaClientSDK::bluetoothImplementations::blueZ::GVariantTupleReader::getCString |
( |
gsize |
index | ) |
const |
Get string value by index (not the difference with object path type value)
- Parameters
-
index | Zero based index of the value in tuple |
- Returns
- A pointer to a C-style string with the value. Method returns nullptr if there is no such value. The returned value points to an internal
GVariant
buffer and must not be freed. The pointer is valid while GVariant
is valid.
◆ getInt32()
gint32 alexaClientSDK::bluetoothImplementations::blueZ::GVariantTupleReader::getInt32 |
( |
gsize |
index | ) |
const |
Get the int32 value by index
- Parameters
-
index | Zero based index of the value in tuple |
- Returns
- A
gint32
value. The default value is 0.
◆ getObjectPath()
char* alexaClientSDK::bluetoothImplementations::blueZ::GVariantTupleReader::getObjectPath |
( |
gsize |
index | ) |
const |
Get the object path value by index (not the difference with string type value)
- Parameters
-
index | Zero based index of the value in tuple |
- Returns
- A pointer to a C-style string with the value. Method returns nullptr if there is no such value. The returned value points to an internal
GVariant
buffer and must not be freed.
◆ getVariant()
ManagedGVariant alexaClientSDK::bluetoothImplementations::blueZ::GVariantTupleReader::getVariant |
( |
gsize |
index | ) |
const |
◆ size()
gsize alexaClientSDK::bluetoothImplementations::blueZ::GVariantTupleReader::size |
( |
| ) |
const |
Returns a number of elements in a tuple.
- Returns
- Number of elements in a tuple.
The documentation for this class was generated from the following file:
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0