DBus-1-TQt 1.0
Loading...
Searching...
No Matches
TQT_DBusDataList Class Reference

#include <tqdbusdatalist.h>

+ Collaboration diagram for TQT_DBusDataList:

Classes

class  Private
 

Public Member Functions

 TQT_DBusDataList ()
 
 TQT_DBusDataList (TQT_DBusData::Type simpleItemType)
 
 TQT_DBusDataList (const TQT_DBusData &containerItemType)
 
 TQT_DBusDataList (const TQT_DBusDataList &other)
 
 TQT_DBusDataList (const TQValueList< TQT_DBusData > &other)
 
 TQT_DBusDataList (const TQValueList< bool > &other)
 
 TQT_DBusDataList (const TQValueList< TQ_UINT8 > &other)
 
 TQT_DBusDataList (const TQValueList< TQ_INT16 > &other)
 
 TQT_DBusDataList (const TQValueList< TQ_UINT16 > &other)
 
 TQT_DBusDataList (const TQValueList< TQ_INT32 > &other)
 
 TQT_DBusDataList (const TQValueList< TQ_UINT32 > &other)
 
 TQT_DBusDataList (const TQValueList< TQ_INT64 > &other)
 
 TQT_DBusDataList (const TQValueList< TQ_UINT64 > &other)
 
 TQT_DBusDataList (const TQValueList< double > &other)
 
 TQT_DBusDataList (const TQValueList< TQT_DBusVariant > &other)
 
 TQT_DBusDataList (const TQStringList &other)
 
 TQT_DBusDataList (const TQValueList< TQT_DBusObjectPath > &other)
 
 TQT_DBusDataList (const TQValueList< TQT_DBusUnixFd > &other)
 
 ~TQT_DBusDataList ()
 
TQT_DBusDataListoperator= (const TQT_DBusDataList &other)
 
TQT_DBusDataListoperator= (const TQValueList< TQT_DBusData > &other)
 
TQT_DBusDataListoperator= (const TQStringList &other)
 
TQT_DBusData::Type type () const
 
bool hasContainerItemType () const
 
TQT_DBusData containerItemType () const
 
bool isValid () const
 
bool isEmpty () const
 
uint count () const
 
bool operator== (const TQT_DBusDataList &other) const
 
bool operator!= (const TQT_DBusDataList &other) const
 
void clear ()
 
TQT_DBusDataListoperator<< (const TQT_DBusData &data)
 
TQValueList< TQT_DBusDatatoTQValueList () const
 
TQStringList toTQStringList (bool *ok=0) const
 
TQValueList< bool > toBoolList (bool *ok=0) const
 
TQValueList< TQ_UINT8 > toByteList (bool *ok=0) const
 
TQValueList< TQ_INT16 > toInt16List (bool *ok=0) const
 
TQValueList< TQ_UINT16 > toUInt16List (bool *ok=0) const
 
TQValueList< TQ_INT32 > toInt32List (bool *ok=0) const
 
TQValueList< TQ_UINT32 > toUInt32List (bool *ok=0) const
 
TQValueList< TQ_INT64 > toInt64List (bool *ok=0) const
 
TQValueList< TQ_UINT64 > toUInt64List (bool *ok=0) const
 
TQValueList< double > toDoubleList (bool *ok=0) const
 
TQValueList< TQString > toStringList (bool *ok=0) const
 
TQValueList< TQT_DBusObjectPathtoObjectPathList (bool *ok=0) const
 
TQValueList< TQT_DBusVarianttoVariantList (bool *ok=0) const
 
TQValueList< TQT_DBusUnixFdtoUnixFdList (bool *ok=0) const
 

Private Attributes

Privated
 

Detailed Description

Class to transport lists of D-Bus data types.

Note
while the D-Bus data type is actually called array this bindings use the term list since the behavior and characteristics of the implementation is more list like.

There are basically two ways to create TQT_DBusDataList objects:

  • non-empty from content
  • empty by specifying the desired element type

Example for creating a filled list from content

list << 2 << 3 << 5 << 7;
TQT_DBusDataList dbusList(intList);
// or even shorter, using implicit conversion
Class for accurately representing D-Bus data types.
Definition tqdbusdata.h:59
static TQT_DBusData fromList(const TQT_DBusDataList &list)
Creates a data object for the given list.
Class to transport lists of D-Bus data types.

Example for creating an empty list

// empty list for a simple type
// empty list for a list of string lists
TQT_DBusDataList outerList(elementType);
TQT_DBusDataList()
Creates an empty and invalid list.
See also
TQT_DBusDataMap

Definition at line 71 of file tqdbusdatalist.h.

Constructor & Destructor Documentation

◆ TQT_DBusDataList() [1/18]

TQT_DBusDataList::TQT_DBusDataList ( )

Creates an empty and invalid list.

See also
TQT_DBusData::Invalid

Definition at line 42 of file tqdbusdatalist.cpp.

42 : d(new Private())
43{
44}

◆ TQT_DBusDataList() [2/18]

TQT_DBusDataList::TQT_DBusDataList ( TQT_DBusData::Type  simpleItemType)
explicit

Creates an empty list with the given simple type for elements.

The given type has be one of the non-container types, i.e. any other than TQT_DBusData::Map, TQT_DBusData::List or TQT_DBusData::Struct

For creating a list with elements which are containers themselves, use TQT_DBusDataList(const TQT_DBusData&);

Parameters
simpleItemTypethe type of the elements in the new list

Definition at line 46 of file tqdbusdatalist.cpp.

46 : d(new Private())
47{
48 d->type = simpleItemType;
49}

References d, and TQT_DBusDataList::Private::type.

◆ TQT_DBusDataList() [3/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQT_DBusData containerItemType)
explicit

Creates an empty list with the given container type for elements.

For creating a list with simple elements you can also use TQT_DBusDataList(TQT_DBusData::Type);

Parameters
containerItemTypethe type of the elements in the new list
See also
hasContainerItemType()

Definition at line 51 of file tqdbusdatalist.cpp.

51 : d(new Private())
52{
54
55 switch(d->type)
56 {
57 case TQT_DBusData::List: // fall through
58 case TQT_DBusData::Struct: // fall through
61 break;
62
63 default: // not a container
64 break;
65 }
66}
Type type() const
Returns the Type of the data object.
TQT_DBusData containerItemType() const
Returns a container prototype for the list's element type.

References TQT_DBusDataList::Private::containerItem, containerItemType(), d, TQT_DBusData::List, TQT_DBusData::Map, TQT_DBusData::Struct, TQT_DBusData::type(), and TQT_DBusDataList::Private::type.

+ Here is the call graph for this function:

◆ TQT_DBusDataList() [4/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQT_DBusDataList other)

Creates a list from the given other list.

This behaves basically like copying a TQValueList through its copy constructor, i.e. no value are actually copied at this time.

Parameters
otherthe other list object to copy from

Definition at line 68 of file tqdbusdatalist.cpp.

68 : d(new Private())
69{
70 d->type = other.d->type;
71 d->list = other.d->list;
73}
TQValueList< TQT_DBusData > list

References TQT_DBusDataList::Private::containerItem, d, TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

◆ TQT_DBusDataList() [5/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQValueList< TQT_DBusData > &  other)

Creates a list from the given TQValueList of TQT_DBusData objects.

If the other list is empty, this will behave like TQT_DBusDataList(), i.e. create an empty and invalid list object.

Type information for the list object, i.e. element type and, if applicable, container item type, will be derived from the other list's elements.

Warning
if the elements of the other list do not all have the same type, the list object will also be empty and invalid
Parameters
otherthe TQValueList of TQT_DBusData objects to copy from
See also
toTQValueList()

Definition at line 75 of file tqdbusdatalist.cpp.

75 : d(new Private())
76{
77 if (other.isEmpty()) return;
78
81
82 d->type = (*it).type();
83
84 TQCString elementSignature;
86 {
87 d->containerItem = other[0]; // would be nice to get an empty one
88 elementSignature = d->containerItem.buildDBusSignature();
89 }
90
91 for (++it; it != endIt; ++it)
92 {
93 if (d->type != (*it).type())
94 {
97
98 return;
99 }
100 else if (hasContainerItemType())
101 {
102 if ((*it).buildDBusSignature() != elementSignature)
103 {
106
107 return;
108 }
109 }
110 }
111
112 d->list = other;
113}
TQCString buildDBusSignature() const
Creates the data objects D-Bus signature.
bool hasContainerItemType() const
Checks whether the element type is a data container itself.

References TQT_DBusData::buildDBusSignature(), TQT_DBusDataList::Private::containerItem, d, hasContainerItemType(), TQT_DBusData::Invalid, TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

+ Here is the call graph for this function:

◆ TQT_DBusDataList() [6/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQValueList< bool > &  other)

Creates a list from the given TQValueList of boolean values.

Type information for the list object will be set to TQT_DBusData::Bool also when the other list is empty, i.e. this allows to create an empty but valid list object, comparable to using TQT_DBusDataList(TQT_DBusData::Type) with TQT_DBusData::Bool

Parameters
otherthe TQValueList of boolean values to copy from
See also
toBoolList()

Definition at line 115 of file tqdbusdatalist.cpp.

115 : d(new Private())
116{
118
119 if (other.isEmpty()) return;
120
121 TQValueList<bool>::const_iterator it = other.begin();
122 TQValueList<bool>::const_iterator endIt = other.end();
123 for (; it != endIt; ++it)
124 {
126 }
127}
static TQT_DBusData fromBool(bool value)
Creates a data object for the given boolean value.

References TQT_DBusData::Bool, d, TQT_DBusData::fromBool(), TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

+ Here is the call graph for this function:

◆ TQT_DBusDataList() [7/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQValueList< TQ_UINT8 > &  other)

Creates a list from the given TQValueList of byte (unsigned char) values.

Type information for the list object will be set to TQT_DBusData::Byte also when the other list is empty, i.e. this allows to create an empty but valid list object, comparable to using TQT_DBusDataList(TQT_DBusData::Type) with TQT_DBusData::Byte

Parameters
otherthe TQValueList of byte (unsigned char) values to copy from
See also
toByteList()

Definition at line 129 of file tqdbusdatalist.cpp.

129 : d(new Private())
130{
132
133 if (other.isEmpty()) return;
134
135 TQValueList<TQ_UINT8>::const_iterator it = other.begin();
136 TQValueList<TQ_UINT8>::const_iterator endIt = other.end();
137 for (; it != endIt; ++it)
138 {
140 }
141}
static TQT_DBusData fromByte(TQ_UINT8 value)
Creates a data object for the given byte (unsigned char) value.

References TQT_DBusData::Byte, d, TQT_DBusData::fromByte(), TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

+ Here is the call graph for this function:

◆ TQT_DBusDataList() [8/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQValueList< TQ_INT16 > &  other)

Creates a list from the given TQValueList of signed 16-bit integer values.

Type information for the list object will be set to TQT_DBusData::Int16 also when the other list is empty, i.e. this allows to create an empty but valid list object, comparable to using TQT_DBusDataList(TQT_DBusData::Type) with TQT_DBusData::Int16

Parameters
otherthe TQValueList of signed 16-bit integer values to copy from
See also
toInt16List()

Definition at line 143 of file tqdbusdatalist.cpp.

143 : d(new Private())
144{
146
147 if (other.isEmpty()) return;
148
149 TQValueList<TQ_INT16>::const_iterator it = other.begin();
150 TQValueList<TQ_INT16>::const_iterator endIt = other.end();
151 for (; it != endIt; ++it)
152 {
154 }
155}
static TQT_DBusData fromInt16(TQ_INT16 value)
Creates a data object for the given signed 16-bit integer value.

References d, TQT_DBusData::fromInt16(), TQT_DBusData::Int16, TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

+ Here is the call graph for this function:

◆ TQT_DBusDataList() [9/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQValueList< TQ_UINT16 > &  other)

Creates a list from the given TQValueList of unsigned 16-bit integer values.

Type information for the list object will be set to TQT_DBusData::UInt16 also when the other list is empty, i.e. this allows to create an empty but valid list object, comparable to using TQT_DBusDataList(TQT_DBusData::Type) with TQT_DBusData::UInt16

Parameters
otherthe TQValueList of unsigned 16-bit integer values to copy from
See also
toUInt16List()

Definition at line 157 of file tqdbusdatalist.cpp.

157 : d(new Private())
158{
160
161 if (other.isEmpty()) return;
162
164 TQValueList<TQ_UINT16>::const_iterator endIt = other.end();
165 for (; it != endIt; ++it)
166 {
168 }
169}
static TQT_DBusData fromUInt16(TQ_UINT16 value)
Creates a data object for the given unsigned 16-bit integer value.

References d, TQT_DBusData::fromUInt16(), TQT_DBusDataList::Private::list, TQT_DBusDataList::Private::type, and TQT_DBusData::UInt16.

+ Here is the call graph for this function:

◆ TQT_DBusDataList() [10/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQValueList< TQ_INT32 > &  other)

Creates a list from the given TQValueList of signed 32-bit integer values.

Type information for the list object will be set to TQT_DBusData::Int32 also when the other list is empty, i.e. this allows to create an empty but valid list object, comparable to using TQT_DBusDataList(TQT_DBusData::Type) with TQT_DBusData::Int32

Parameters
otherthe TQValueList of signed 32-bit integer values to copy from
See also
toInt32List()

Definition at line 171 of file tqdbusdatalist.cpp.

171 : d(new Private())
172{
174
175 if (other.isEmpty()) return;
176
177 TQValueList<TQ_INT32>::const_iterator it = other.begin();
178 TQValueList<TQ_INT32>::const_iterator endIt = other.end();
179 for (; it != endIt; ++it)
180 {
182 }
183}
static TQT_DBusData fromInt32(TQ_INT32 value)
Creates a data object for the given signed 32-bit integer value.

References d, TQT_DBusData::fromInt32(), TQT_DBusData::Int32, TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

+ Here is the call graph for this function:

◆ TQT_DBusDataList() [11/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQValueList< TQ_UINT32 > &  other)

Creates a list from the given TQValueList of unsigned 32-bit integer values.

Type information for the list object will be set to TQT_DBusData::UInt16 also when the other list is empty, i.e. this allows to create an empty but valid list object, comparable to using TQT_DBusDataList(TQT_DBusData::Type) with TQT_DBusData::UInt32

Parameters
otherthe TQValueList of unsigned 32-bit integer values to copy from
See also
toUInt32List()

Definition at line 185 of file tqdbusdatalist.cpp.

185 : d(new Private())
186{
188
189 if (other.isEmpty()) return;
190
192 TQValueList<TQ_UINT32>::const_iterator endIt = other.end();
193 for (; it != endIt; ++it)
194 {
196 }
197}
static TQT_DBusData fromUInt32(TQ_UINT32 value)
Creates a data object for the given unsigned 32-bit integer value.

References d, TQT_DBusData::fromUInt32(), TQT_DBusDataList::Private::list, TQT_DBusDataList::Private::type, and TQT_DBusData::UInt32.

+ Here is the call graph for this function:

◆ TQT_DBusDataList() [12/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQValueList< TQ_INT64 > &  other)

Creates a list from the given TQValueList of signed 64-bit integer values.

Type information for the list object will be set to TQT_DBusData::Int64 also when the other list is empty, i.e. this allows to create an empty but valid list object, comparable to using TQT_DBusDataList(TQT_DBusData::Type) with TQT_DBusData::Int64

Parameters
otherthe TQValueList of signed 64-bit integer values to copy from
See also
toInt64List()

Definition at line 199 of file tqdbusdatalist.cpp.

199 : d(new Private())
200{
202
203 if (other.isEmpty()) return;
204
205 TQValueList<TQ_INT64>::const_iterator it = other.begin();
206 TQValueList<TQ_INT64>::const_iterator endIt = other.end();
207 for (; it != endIt; ++it)
208 {
210 }
211}
static TQT_DBusData fromInt64(TQ_INT64 value)
Creates a data object for the given signed 64-bit integer value.

References d, TQT_DBusData::fromInt64(), TQT_DBusData::Int64, TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

+ Here is the call graph for this function:

◆ TQT_DBusDataList() [13/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQValueList< TQ_UINT64 > &  other)

Creates a list from the given TQValueList of unsigned 64-bit integer values.

Type information for the list object will be set to TQT_DBusData::UInt64 also when the other list is empty, i.e. this allows to create an empty but valid list object, comparable to using TQT_DBusDataList(TQT_DBusData::Type) with TQT_DBusData::UInt64

Parameters
otherthe TQValueList of unsigned 64-bit integer values to copy from
See also
toUInt64List()

Definition at line 213 of file tqdbusdatalist.cpp.

213 : d(new Private())
214{
216
217 if (other.isEmpty()) return;
218
220 TQValueList<TQ_UINT64>::const_iterator endIt = other.end();
221 for (; it != endIt; ++it)
222 {
224 }
225}
static TQT_DBusData fromUInt64(TQ_UINT64 value)
Creates a data object for the given unsigned 64-bit integer value.

References d, TQT_DBusData::fromUInt64(), TQT_DBusDataList::Private::list, TQT_DBusDataList::Private::type, and TQT_DBusData::UInt64.

+ Here is the call graph for this function:

◆ TQT_DBusDataList() [14/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQValueList< double > &  other)

Creates a list from the given TQValueList of double values.

Type information for the list object will be set to TQT_DBusData::Double also when the other list is empty, i.e. this allows to create an empty but valid list object, comparable to using TQT_DBusDataList(TQT_DBusData::Type) with TQT_DBusData::Double

Parameters
otherthe TQValueList of double values to copy from
See also
toDoubleList()

Definition at line 227 of file tqdbusdatalist.cpp.

227 : d(new Private())
228{
230
231 if (other.isEmpty()) return;
232
233 TQValueList<double>::const_iterator it = other.begin();
234 TQValueList<double>::const_iterator endIt = other.end();
235 for (; it != endIt; ++it)
236 {
238 }
239}
static TQT_DBusData fromDouble(double value)
Creates a data object for the given double value.

References d, TQT_DBusData::Double, TQT_DBusData::fromDouble(), TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

+ Here is the call graph for this function:

◆ TQT_DBusDataList() [15/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQValueList< TQT_DBusVariant > &  other)

Creates a list from the given TQValueList of TQT_DBusVariant values.

Type information for the list object will be set to TQT_DBusData::Variant also when the other list is empty, i.e. this allows to create an empty but valid list object, comparable to using TQT_DBusDataList(TQT_DBusData::Type) with TQT_DBusData::Variant

Parameters
otherthe TQValueList of variant values to copy from
See also
toVariantList()

Definition at line 241 of file tqdbusdatalist.cpp.

242 : d(new Private())
243{
245
246 if (other.isEmpty()) return;
247
250 for (; it != endIt; ++it)
251 {
253 }
254}
static TQT_DBusData fromVariant(const TQT_DBusVariant &value)
Creates a data object for the given variant value.

References d, TQT_DBusData::fromVariant(), TQT_DBusDataList::Private::list, TQT_DBusDataList::Private::type, and TQT_DBusData::Variant.

+ Here is the call graph for this function:

◆ TQT_DBusDataList() [16/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQStringList &  other)

Creates a list from the given TQStringList's values.

Type information for the list object will be set to TQT_DBusData::String also when the other list is empty, i.e. this allows to create an empty but valid list object, comparable to using TQT_DBusDataList(TQT_DBusData::Type) with TQT_DBusData::String

Parameters
otherthe TQStringList to copy from
See also
toTQStringList()

Definition at line 256 of file tqdbusdatalist.cpp.

256 : d(new Private())
257{
259
260 if (other.isEmpty()) return;
261
262 TQStringList::const_iterator it = other.begin();
263 TQStringList::const_iterator endIt = other.end();
264 for (; it != endIt; ++it)
265 {
267 }
268}
static TQT_DBusData fromString(const TQString &value)
Creates a data object for the given string value.

References d, TQT_DBusData::fromString(), TQT_DBusDataList::Private::list, TQT_DBusData::String, and TQT_DBusDataList::Private::type.

+ Here is the call graph for this function:

◆ TQT_DBusDataList() [17/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQValueList< TQT_DBusObjectPath > &  other)

Creates a list from the given TQValueList of object path values.

Type information for the list object will be set to TQT_DBusData::ObjectPath also when the other list is empty, i.e. this allows to create an empty but valid list object, comparable to using TQT_DBusDataList(TQT_DBusData::Type) with TQT_DBusData::ObjectPath

Parameters
otherthe TQValueList of object path values to copy from
See also
toObjectPathList()

Definition at line 270 of file tqdbusdatalist.cpp.

271 : d(new Private())
272{
274
275 if (other.isEmpty()) return;
276
279 for (; it != endIt; ++it)
280 {
282 }
283}
static TQT_DBusData fromObjectPath(const TQT_DBusObjectPath &value)
Creates a data object for the given object path value.

References d, TQT_DBusData::fromObjectPath(), TQT_DBusDataList::Private::list, TQT_DBusData::ObjectPath, and TQT_DBusDataList::Private::type.

+ Here is the call graph for this function:

◆ TQT_DBusDataList() [18/18]

TQT_DBusDataList::TQT_DBusDataList ( const TQValueList< TQT_DBusUnixFd > &  other)

Creates a list from the given TQValueList of unix file handle values.

Type information for the list object will be set to TQT_DBusData::UnixFd also when the other list is empty, i.e. this allows to create an empty but valid list object, comparable to using TQT_DBusDataList(TQT_DBusData::Type) with TQT_DBusData::UnixFd

Parameters
otherthe TQValueList of unix file handle values to copy from
See also
toUnixFdList()

Definition at line 285 of file tqdbusdatalist.cpp.

286 : d(new Private())
287{
289
290 if (other.isEmpty()) return;
291
294 for (; it != endIt; ++it)
295 {
297 }
298}
static TQT_DBusData fromUnixFd(const TQT_DBusUnixFd &value)
Creates a data object for the given unix file handle value.

References d, TQT_DBusData::fromUnixFd(), TQT_DBusDataList::Private::list, TQT_DBusDataList::Private::type, and TQT_DBusData::UnixFd.

+ Here is the call graph for this function:

◆ ~TQT_DBusDataList()

TQT_DBusDataList::~TQT_DBusDataList ( )

Destroys the list object.

Definition at line 300 of file tqdbusdatalist.cpp.

301{
302 delete d;
303}

References d.

Member Function Documentation

◆ clear()

void TQT_DBusDataList::clear ( )

Clears the list.

Type and, if applicable, container element type will stay untouched.

Definition at line 449 of file tqdbusdatalist.cpp.

450{
451 d->list.clear();
452}

References d, and TQT_DBusDataList::Private::list.

◆ containerItemType()

TQT_DBusData TQT_DBusDataList::containerItemType ( ) const

Returns a container prototype for the list's element type.

Lists which have containers as their elements, i.e. hasContainerItemType() returns true this will actually specify the details for the use container, i.e. the returned data object can be queried for type and possible further subtypes.

Returns
a data object detailing the element type or an invalid data object if the list does not have a container as its element type
See also
TQT_DBusDataList(const TQT_DBusData&);
type()
TQT_DBusData::Invalid

Definition at line 390 of file tqdbusdatalist.cpp.

391{
392 return d->containerItem;
393}

References TQT_DBusDataList::Private::containerItem, and d.

+ Here is the caller graph for this function:

◆ count()

uint TQT_DBusDataList::count ( ) const

Returns the number of elements of this list object.

Returns
the number of elements
See also
isEmpty()

Definition at line 400 of file tqdbusdatalist.cpp.

401{
402 return d->list.count();
403}

References d, and TQT_DBusDataList::Private::list.

◆ hasContainerItemType()

bool TQT_DBusDataList::hasContainerItemType ( ) const

Checks whether the element type is a data container itself.

If the elements of the list are containers as well, this will return true In this case containerItemType() will return a prototype for such a container.

Returns
true if the element type is either TQT_DBusData::Map, TQT_DBusData::List or TQT_DBusData::Struct, otherwise false
See also
TQT_DBusDataList(const TQT_DBusData&)

Definition at line 384 of file tqdbusdatalist.cpp.

385{
388}

References d, TQT_DBusData::List, TQT_DBusData::Map, TQT_DBusData::Struct, and TQT_DBusDataList::Private::type.

+ Here is the caller graph for this function:

◆ isEmpty()

bool TQT_DBusDataList::isEmpty ( ) const

Checks whether this list object has any elements.

Returns
true if there are no elements in this list, otherwise false
See also
count()

Definition at line 395 of file tqdbusdatalist.cpp.

396{
397 return d->list.isEmpty();
398}

References d, and TQT_DBusDataList::Private::list.

◆ isValid()

bool TQT_DBusDataList::isValid ( ) const
inline

Checks whether this list object has a valid element type.

This is equal to checking type() for not being TQT_DBusData::Invalid

Returns
true if the list object is valid, otherwise false

Definition at line 414 of file tqdbusdatalist.h.

414{ return type() != TQT_DBusData::Invalid; }
TQT_DBusData::Type type() const
Returns the element type of the list object.

References TQT_DBusData::Invalid.

◆ operator!=()

bool TQT_DBusDataList::operator!= ( const TQT_DBusDataList other) const

Checks whether the given other list is different from this one.

Two lists are considered different when they have the different type (or different container item type if the have one) or the element lists are equal are different.

Parameters
otherthe other list object to compare with
Returns
true if the lists are different, otherwise false
See also
TQT_DBusData::operator!=()

Definition at line 427 of file tqdbusdatalist.cpp.

428{
429 if (&other == this) return false;
430 if (d == other.d) return false;
431
432 bool containerEqual = true;
434 {
435 if (other.hasContainerItemType())
436 {
437 containerEqual = d->containerItem.buildDBusSignature() ==
439 }
440 else
441 containerEqual = false;
442 }
443 else if (other.hasContainerItemType())
444 containerEqual = false;
445
446 return d->type != other.d->type || !containerEqual || d->list != other.d->list;
447}

References TQT_DBusData::buildDBusSignature(), TQT_DBusDataList::Private::containerItem, d, hasContainerItemType(), TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

+ Here is the call graph for this function:

◆ operator<<()

TQT_DBusDataList & TQT_DBusDataList::operator<< ( const TQT_DBusData data)

Appends a given value to the list.

Basically works like the respective TQValueList operator, but checks if type of the new value matches the type of the list. Lists that are invalid will accept any new type and will then be typed accordingly.

If data is invalid itself, it will not be appended at any time.

Note
the more common use case is to work with a TQValueList and then use the respective constructor to create the TQT_DBusDataList object
Parameters
datathe data item to append to the list
Returns
a reference to this list object

Definition at line 454 of file tqdbusdatalist.cpp.

455{
456 if (data.type() == TQT_DBusData::Invalid) return *this;
457
459 {
460 d->type = data.type();
461
462 // check if we are now have container items
463 if (hasContainerItemType()) d->containerItem = data;
464
465 d->list << data;
466 }
467 else if (d->type != data.type())
468 {
469 tqWarning("TQT_DBusDataList: trying to add data of type %s to list of type %s",
471 }
472 else if (hasContainerItemType())
473 {
474 TQCString ourSignature = d->containerItem.buildDBusSignature();
475 TQCString dataSignature = data.buildDBusSignature();
476
477 if (ourSignature != dataSignature)
478 {
479 tqWarning("TQT_DBusDataList: trying to add data with signature %s "
480 "to list with item signature %s",
481 dataSignature.data(), ourSignature.data());
482 }
483 else
484 d->list << data;
485 }
486 else
487 d->list << data;
488
489 return *this;
490}
const char * typeName() const
Returns the string representation of the object's Type.
Definition tqdbusdata.h:385

References TQT_DBusData::buildDBusSignature(), TQT_DBusDataList::Private::containerItem, d, hasContainerItemType(), TQT_DBusData::Invalid, TQT_DBusDataList::Private::list, TQT_DBusData::type(), TQT_DBusDataList::Private::type, and TQT_DBusData::typeName().

+ Here is the call graph for this function:

◆ operator=() [1/3]

TQT_DBusDataList & TQT_DBusDataList::operator= ( const TQStringList &  other)

Copies from the given other list.

Convenience overload as TQStringList is a very common data type in TQt and D-Bus methods also use "arrays of strings" quite often.

The list object's type will be set to TQT_DBusData::String. If the object previously had a container as its element type, this will be reset, i.e. hasContainerItemType() will return false

Parameters
otherthe stringlist to copy from
Returns
a reference to this list object

Definition at line 363 of file tqdbusdatalist.cpp.

364{
365 d->list.clear();
368
369 TQStringList::const_iterator it = other.begin();
370 TQStringList::const_iterator endIt = other.end();
371 for (; it != endIt; ++it)
372 {
374 }
375
376 return *this;
377}

References TQT_DBusDataList::Private::containerItem, d, TQT_DBusData::fromString(), TQT_DBusDataList::Private::list, TQT_DBusData::String, and TQT_DBusDataList::Private::type.

+ Here is the call graph for this function:

◆ operator=() [2/3]

TQT_DBusDataList & TQT_DBusDataList::operator= ( const TQT_DBusDataList other)

Copies from the given other list.

This behaves basically like copying a TQValueList through its assignment operator, i.e. no value are actually copied at this time.

Parameters
otherthe other list object to copy from
Returns
a reference to this list object

Definition at line 305 of file tqdbusdatalist.cpp.

306{
307 if (&other == this) return *this;
308
309 d->type = other.d->type;
310 d->list = other.d->list;
311 d->containerItem = other.d->containerItem;
312
313 return *this;
314}

References TQT_DBusDataList::Private::containerItem, d, TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

◆ operator=() [3/3]

TQT_DBusDataList & TQT_DBusDataList::operator= ( const TQValueList< TQT_DBusData > &  other)

Copies from the given other list.

This behaves basically like copying a TQValueList through its assignment operator, i.e. no value are actually copied at this time.

Warning
the elements of the given other list have to be of the same type. If they aren't this list's content will cleared and the type will be set to TQT_DBusData::Invalid
Parameters
otherthe other list object to copy from
Returns
a reference to this list object

Definition at line 316 of file tqdbusdatalist.cpp.

317{
318 d->list.clear();
321
322 if (other.isEmpty()) return *this;
323
326
327 d->type = (*it).type();
328
329 TQCString elementSignature;
331 {
332 d->containerItem = other[0]; // would be nice to get an empty one
333
334 elementSignature = d->containerItem.buildDBusSignature();
335 }
336
337 for (++it; it != endIt; ++it)
338 {
339 if (d->type != (*it).type())
340 {
343
344 return *this;
345 }
346 else if (hasContainerItemType())
347 {
348 if ((*it).buildDBusSignature() != elementSignature)
349 {
352
353 return *this;
354 }
355 }
356 }
357
358 d->list = other;
359
360 return *this;
361}

References TQT_DBusData::buildDBusSignature(), TQT_DBusDataList::Private::containerItem, d, hasContainerItemType(), TQT_DBusData::Invalid, TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

+ Here is the call graph for this function:

◆ operator==()

bool TQT_DBusDataList::operator== ( const TQT_DBusDataList other) const

Checks whether the given other list is equal to this one.

Two lists are considered equal when they have the same type (and same container item type if the have one) and the element lists are equal as well.

Parameters
otherthe other list object to compare with
Returns
true if the lists are equal, otherwise false
See also
TQT_DBusData::operator==()

Definition at line 405 of file tqdbusdatalist.cpp.

406{
407 if (&other == this) return true;
408 if (d == other.d) return true;
409
410 bool containerEqual = true;
412 {
413 if (other.hasContainerItemType())
414 {
415 containerEqual = d->containerItem.buildDBusSignature() ==
417 }
418 else
419 containerEqual = false;
420 }
421 else if (other.hasContainerItemType())
422 containerEqual = false;
423
424 return d->type == other.d->type && containerEqual && d->list == other.d->list;
425}

References TQT_DBusData::buildDBusSignature(), TQT_DBusDataList::Private::containerItem, d, hasContainerItemType(), TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

+ Here is the call graph for this function:

◆ toBoolList()

TQValueList< bool > TQT_DBusDataList::toBoolList ( bool *  ok = 0) const

Tries to get the list object's elements as a TQValueList of bool.

This is a convenience overload for the case when the list is of type TQT_DBusData::Bool.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type TQT_DBusData::Bool)
Returns
a TQValueList of bool containing the list object's boolean elements or an empty list when converting fails
See also
TQT_DBusData::toBool()

Definition at line 519 of file tqdbusdatalist.cpp.

520{
521 if (d->type != TQT_DBusData::Bool)
522 {
523 if (ok != 0) *ok = false;
524 return TQValueList<bool>();
525 }
526
527 TQValueList<bool> result;
528
531 for (; it != endIt; ++it)
532 {
533 result << (*it).toBool();
534 }
535
536 if (ok != 0) *ok = true;
537
538 return result;
539}

References TQT_DBusData::Bool, d, TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

◆ toByteList()

TQValueList< TQ_UINT8 > TQT_DBusDataList::toByteList ( bool *  ok = 0) const

Tries to get the list object's elements as a TQValueList of TQ_UINT8.

This is a convenience overload for the case when the list is of type TQT_DBusData::Byte.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type TQT_DBusData::Byte)
Returns
a TQValueList of TQ_UINT8 containing the list object's byte elements or an empty list when converting fails
See also
TQT_DBusData::toByte()

Definition at line 541 of file tqdbusdatalist.cpp.

542{
543 if (d->type != TQT_DBusData::Byte)
544 {
545 if (ok != 0) *ok = false;
546 return TQValueList<TQ_UINT8>();
547 }
548
550
553 for (; it != endIt; ++it)
554 {
555 result << (*it).toByte();
556 }
557
558 if (ok != 0) *ok = true;
559
560 return result;
561}

References TQT_DBusData::Byte, d, TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

◆ toDoubleList()

TQValueList< double > TQT_DBusDataList::toDoubleList ( bool *  ok = 0) const

Tries to get the list object's elements as a TQValueList of double.

This is a convenience overload for the case when the list is of type TQT_DBusData::Double.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type TQT_DBusData::Double)
Returns
a TQValueList of double containing the list object's double elements or an empty list when converting fails
See also
TQT_DBusData::toDouble()

Definition at line 695 of file tqdbusdatalist.cpp.

696{
698 {
699 if (ok != 0) *ok = false;
700 return TQValueList<double>();
701 }
702
703 TQValueList<double> result;
704
707 for (; it != endIt; ++it)
708 {
709 result << (*it).toDouble();
710 }
711
712 if (ok != 0) *ok = true;
713
714 return result;
715}

References d, TQT_DBusData::Double, TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

◆ toInt16List()

TQValueList< TQ_INT16 > TQT_DBusDataList::toInt16List ( bool *  ok = 0) const

Tries to get the list object's elements as a TQValueList of TQ_INT16.

This is a convenience overload for the case when the list is of type TQT_DBusData::Int16.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type TQT_DBusData::Int16)
Returns
a TQValueList of TQ_INT16 containing the list object's signed 16-bit integer elements or an empty list when converting fails
See also
TQT_DBusData::toInt16()

Definition at line 563 of file tqdbusdatalist.cpp.

564{
565 if (d->type != TQT_DBusData::Int16)
566 {
567 if (ok != 0) *ok = false;
568 return TQValueList<TQ_INT16>();
569 }
570
572
575 for (; it != endIt; ++it)
576 {
577 result << (*it).toInt16();
578 }
579
580 if (ok != 0) *ok = true;
581
582 return result;
583}

References d, TQT_DBusData::Int16, TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

◆ toInt32List()

TQValueList< TQ_INT32 > TQT_DBusDataList::toInt32List ( bool *  ok = 0) const

Tries to get the list object's elements as a TQValueList of TQ_INT32.

This is a convenience overload for the case when the list is of type TQT_DBusData::Int32.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type TQT_DBusData::Int32)
Returns
a TQValueList of TQ_INT32 containing the list object's signed 32-bit integer elements or an empty list when converting fails
See also
TQT_DBusData::toInt32()

Definition at line 607 of file tqdbusdatalist.cpp.

608{
609 if (d->type != TQT_DBusData::Int32)
610 {
611 if (ok != 0) *ok = false;
612 return TQValueList<TQ_INT32>();
613 }
614
616
619 for (; it != endIt; ++it)
620 {
621 result << (*it).toInt32();
622 }
623
624 if (ok != 0) *ok = true;
625
626 return result;
627}

References d, TQT_DBusData::Int32, TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

◆ toInt64List()

TQValueList< TQ_INT64 > TQT_DBusDataList::toInt64List ( bool *  ok = 0) const

Tries to get the list object's elements as a TQValueList of TQ_INT64.

This is a convenience overload for the case when the list is of type TQT_DBusData::Int64.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type TQT_DBusData::Int64)
Returns
a TQValueList of TQ_INT64 containing the list object's signed 64-bit integer elements or an empty list when converting fails
See also
TQT_DBusData::toInt64()

Definition at line 651 of file tqdbusdatalist.cpp.

652{
653 if (d->type != TQT_DBusData::Int64)
654 {
655 if (ok != 0) *ok = false;
656 return TQValueList<TQ_INT64>();
657 }
658
660
663 for (; it != endIt; ++it)
664 {
665 result << (*it).toInt64();
666 }
667
668 if (ok != 0) *ok = true;
669
670 return result;
671}

References d, TQT_DBusData::Int64, TQT_DBusDataList::Private::list, and TQT_DBusDataList::Private::type.

◆ toObjectPathList()

TQValueList< TQT_DBusObjectPath > TQT_DBusDataList::toObjectPathList ( bool *  ok = 0) const

Tries to get the list object's elements as a TQValueList of object paths.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type TQT_DBusData::ObjectPath)
Returns
a TQValueList of object paths containing the list object's object path elements or an empty list when converting fails
See also
TQT_DBusData::toObjectPath()

Definition at line 722 of file tqdbusdatalist.cpp.

723{
725 {
726 if (ok != 0) *ok = false;
728 }
729
731
734 for (; it != endIt; ++it)
735 {
736 result << (*it).toObjectPath();
737 }
738
739 if (ok != 0) *ok = true;
740
741 return result;
742}

References d, TQT_DBusDataList::Private::list, TQT_DBusData::ObjectPath, and TQT_DBusDataList::Private::type.

◆ toStringList()

TQValueList< TQString > TQT_DBusDataList::toStringList ( bool *  ok = 0) const

Tries to get the list object's elements as a TQValueList of TQString.

This is a convenience overload for the case when the list is of type TQT_DBusData::String, see also toTQStringList().

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type TQT_DBusData::String)
Returns
a TQValueList of TQString containing the list object's string elements or an empty list when converting fails
See also
TQT_DBusData::toString()

Definition at line 717 of file tqdbusdatalist.cpp.

718{
719 return toTQStringList(ok);
720}
TQStringList toTQStringList(bool *ok=0) const
Tries to get the list object's elements as a TQStringList.

References toTQStringList().

+ Here is the call graph for this function:

◆ toTQStringList()

TQStringList TQT_DBusDataList::toTQStringList ( bool *  ok = 0) const

Tries to get the list object's elements as a TQStringList.

This is a convenience overload for the case when the list is of type TQT_DBusData::String.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type TQT_DBusData::String)
Returns
a TQStringList containing the list object's string elements or an empty list when converting fails
See also
toStringList()
TQT_DBusData::toString()

Definition at line 497 of file tqdbusdatalist.cpp.

498{
500 {
501 if (ok != 0) *ok = false;
502 return TQStringList();
503 }
504
505 TQStringList result;
506
509 for (; it != endIt; ++it)
510 {
511 result << (*it).toString();
512 }
513
514 if (ok != 0) *ok = true;
515
516 return result;
517}

References d, TQT_DBusDataList::Private::list, TQT_DBusData::String, and TQT_DBusDataList::Private::type.

+ Here is the caller graph for this function:

◆ toTQValueList()

TQValueList< TQT_DBusData > TQT_DBusDataList::toTQValueList ( ) const

Converts the list object into a TQValueList with TQT_DBusData elements.

Returns
the values of the list object as a TQValueList

Definition at line 492 of file tqdbusdatalist.cpp.

493{
494 return d->list;
495}

References d, and TQT_DBusDataList::Private::list.

+ Here is the caller graph for this function:

◆ toUInt16List()

TQValueList< TQ_UINT16 > TQT_DBusDataList::toUInt16List ( bool *  ok = 0) const

Tries to get the list object's elements as a TQValueList of TQ_UINT16.

This is a convenience overload for the case when the list is of type TQT_DBusData::UInt16.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type TQT_DBusData::UInt16)
Returns
a TQValueList of TQ_UINT16 containing the list object's unsigned 16-bit integer elements or an empty list when converting fails
See also
TQT_DBusData::toUInt16()

Definition at line 585 of file tqdbusdatalist.cpp.

586{
588 {
589 if (ok != 0) *ok = false;
590 return TQValueList<TQ_UINT16>();
591 }
592
594
597 for (; it != endIt; ++it)
598 {
599 result << (*it).toUInt16();
600 }
601
602 if (ok != 0) *ok = true;
603
604 return result;
605}

References d, TQT_DBusDataList::Private::list, TQT_DBusDataList::Private::type, and TQT_DBusData::UInt16.

◆ toUInt32List()

TQValueList< TQ_UINT32 > TQT_DBusDataList::toUInt32List ( bool *  ok = 0) const

Tries to get the list object's elements as a TQValueList of TQ_UINT32.

This is a convenience overload for the case when the list is of type TQT_DBusData::UInt32.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type TQT_DBusData::UInt32)
Returns
a TQValueList of TQ_UINT32 containing the list object's unsigned 32-bit integer elements or an empty list when converting fails
See also
TQT_DBusData::toUInt32()

Definition at line 629 of file tqdbusdatalist.cpp.

630{
632 {
633 if (ok != 0) *ok = false;
634 return TQValueList<TQ_UINT32>();
635 }
636
638
641 for (; it != endIt; ++it)
642 {
643 result << (*it).toUInt32();
644 }
645
646 if (ok != 0) *ok = true;
647
648 return result;
649}

References d, TQT_DBusDataList::Private::list, TQT_DBusDataList::Private::type, and TQT_DBusData::UInt32.

◆ toUInt64List()

TQValueList< TQ_UINT64 > TQT_DBusDataList::toUInt64List ( bool *  ok = 0) const

Tries to get the list object's elements as a TQValueList of TQ_UINT64.

This is a convenience overload for the case when the list is of type TQT_DBusData::UInt64.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type TQT_DBusData::UInt64)
Returns
a TQValueList of TQ_UINT64 containing the list object's unsigned 64-bit integer elements or an empty list when converting fails
See also
TQT_DBusData::toUInt64()

Definition at line 673 of file tqdbusdatalist.cpp.

674{
676 {
677 if (ok != 0) *ok = false;
678 return TQValueList<TQ_UINT64>();
679 }
680
682
685 for (; it != endIt; ++it)
686 {
687 result << (*it).toUInt64();
688 }
689
690 if (ok != 0) *ok = true;
691
692 return result;
693}

References d, TQT_DBusDataList::Private::list, TQT_DBusDataList::Private::type, and TQT_DBusData::UInt64.

◆ toUnixFdList()

TQValueList< TQT_DBusUnixFd > TQT_DBusDataList::toUnixFdList ( bool *  ok = 0) const

Tries to get the list object's elements as a TQValueList of TQT_DBusUnixFd.

This is a convenience overload for the case when the list is of type TQT_DBusData::UnixFd.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type TQT_DBusData::UnixFd)
Returns
a TQValueList of TQT_DBusUnixFd containing the list object's TQT_DBusUnixFd elements or an empty list when converting fails
See also
TQT_DBusData::toUnixFd()

Definition at line 744 of file tqdbusdatalist.cpp.

745{
747 {
748 if (ok != 0) *ok = false;
750 }
751
753
756 for (; it != endIt; ++it)
757 {
758 result << (*it).toUnixFd();
759 }
760
761 if (ok != 0) *ok = true;
762
763 return result;
764}

References d, TQT_DBusDataList::Private::list, TQT_DBusDataList::Private::type, and TQT_DBusData::UnixFd.

◆ toVariantList()

TQValueList< TQT_DBusVariant > TQT_DBusDataList::toVariantList ( bool *  ok = 0) const

Tries to get the list object's elements as a TQValueList of TQT_DBusVariant.

This is a convenience overload for the case when the list is of type TQT_DBusData::Variant.

Parameters
okoptional pointer to a bool variable to store the success information in, i.e. will be set to true on success and to false if the conversion failed (not of type TQT_DBusData::Variant)
Returns
a TQValueList of TQT_DBusVariant containing the list object's TQT_DBusVariant elements or an empty list when converting fails
See also
TQT_DBusData::toVariant()

Definition at line 766 of file tqdbusdatalist.cpp.

767{
769 {
770 if (ok != 0) *ok = false;
772 }
773
775
778 for (; it != endIt; ++it)
779 {
780 result << (*it).toVariant();
781 }
782
783 if (ok != 0) *ok = true;
784
785 return result;
786}

References d, TQT_DBusDataList::Private::list, TQT_DBusDataList::Private::type, and TQT_DBusData::Variant.

◆ type()

TQT_DBusData::Type TQT_DBusDataList::type ( ) const

Returns the element type of the list object.

Returns
one of the values of the TQT_DBusData::Type enum
See also
hasContainerItemType()
containerItemType()

Definition at line 379 of file tqdbusdatalist.cpp.

380{
381 return d->type;
382}

References d, and TQT_DBusDataList::Private::type.

+ Here is the caller graph for this function:

Member Data Documentation

◆ d

Private* TQT_DBusDataList::d
private

Definition at line 755 of file tqdbusdatalist.h.


The documentation for this class was generated from the following files: