TQT_DBusDataList Class Reference

Class to transport lists of D-Bus data types. More...

#include <tqdbusdatalist.h>

Collaboration diagram for TQT_DBusDataList:
[legend]

List of all members.

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:

Example for creating a filled list from content

 TQValueList<TQ_INT16> intList;
 list << 2 << 3 << 5 << 7;

 TQT_DBusDataList dbusList(intList);
 TQT_DBusData data = TQT_DBusData::fromList(dbusList);

 // or even shorter, using implicit conversion
 TQT_DBusData other = TQT_DBusData::fromList(intList);

Example for creating an empty list

 // empty list for a simple type
 TQT_DBusDataList list(TQT_DBusData::Double);

 // empty list for a list of string lists
 TQT_DBusData elementType = TQT_DBusData::fromList(TQT_DBusDataList(TQT_DBusData::String));
 TQT_DBusDataList outerList(elementType);
See also:
TQT_DBusDataMap

Definition at line 71 of file tqdbusdatalist.h.


Constructor & Destructor Documentation

TQT_DBusDataList::TQT_DBusDataList (  ) 

Creates an empty and invalid list.

See also:
TQT_DBusData::Invalid

Definition at line 42 of file tqdbusdatalist.cpp.

00042                                    : d(new Private())
00043 {
00044 }

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:
simpleItemType the type of the elements in the new list

Definition at line 46 of file tqdbusdatalist.cpp.

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

00046                                                                   : d(new Private())
00047 {
00048     d->type = simpleItemType;
00049 }

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:
containerItemType the type of the elements in the new list
See also:
hasContainerItemType()

Definition at line 51 of file tqdbusdatalist.cpp.

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

00051                                                                         : d(new Private())
00052 {
00053     d->type = containerItemType.type();
00054 
00055     switch(d->type)
00056     {
00057         case TQT_DBusData::List:   // fall through
00058         case TQT_DBusData::Struct: // fall through
00059         case TQT_DBusData::Map:
00060             d->containerItem = containerItemType;
00061             break;
00062 
00063         default:   // not a container
00064             break;
00065     }
00066 }

Here is the call graph for this function:

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:
other the other list object to copy from

Definition at line 68 of file tqdbusdatalist.cpp.

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

00068                                                                 : d(new Private())
00069 {
00070     d->type = other.d->type;
00071     d->list = other.d->list;
00072     d->containerItem = other.d->containerItem;
00073 }

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:
other the TQValueList of TQT_DBusData objects to copy from
See also:
toTQValueList()

Definition at line 75 of file tqdbusdatalist.cpp.

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

00075                                                                          : d(new Private())
00076 {
00077     if (other.isEmpty()) return;
00078 
00079     TQValueList<TQT_DBusData>::const_iterator it    = other.begin();
00080     TQValueList<TQT_DBusData>::const_iterator endIt = other.end();
00081 
00082     d->type = (*it).type();
00083 
00084     TQCString elementSignature;
00085     if (hasContainerItemType())
00086     {
00087         d->containerItem = other[0]; // would be nice to get an empty one
00088         elementSignature = d->containerItem.buildDBusSignature();
00089     }
00090 
00091     for (++it; it != endIt; ++it)
00092     {
00093         if (d->type != (*it).type())
00094         {
00095             d->type = TQT_DBusData::Invalid;
00096             d->containerItem = TQT_DBusData();
00097 
00098             return;
00099         }
00100         else if (hasContainerItemType())
00101         {
00102             if ((*it).buildDBusSignature() != elementSignature)
00103             {
00104                 d->type = TQT_DBusData::Invalid;
00105                 d->containerItem = TQT_DBusData();
00106 
00107                 return;
00108             }
00109         }
00110     }
00111 
00112     d->list = other;
00113 }

Here is the call graph for this function:

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:
other the TQValueList of boolean values to copy from
See also:
toBoolList()

Definition at line 115 of file tqdbusdatalist.cpp.

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

00115                                                                  : d(new Private())
00116 {
00117     d->type = TQT_DBusData::Bool;
00118 
00119     if (other.isEmpty()) return;
00120 
00121     TQValueList<bool>::const_iterator it    = other.begin();
00122     TQValueList<bool>::const_iterator endIt = other.end();
00123     for (; it != endIt; ++it)
00124     {
00125         d->list << TQT_DBusData::fromBool(*it);
00126     }
00127 }

Here is the call graph for this function:

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:
other the TQValueList of byte (unsigned char) values to copy from
See also:
toByteList()

Definition at line 129 of file tqdbusdatalist.cpp.

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

00129                                                                      : d(new Private())
00130 {
00131     d->type = TQT_DBusData::Byte;
00132 
00133     if (other.isEmpty()) return;
00134 
00135     TQValueList<TQ_UINT8>::const_iterator it    = other.begin();
00136     TQValueList<TQ_UINT8>::const_iterator endIt = other.end();
00137     for (; it != endIt; ++it)
00138     {
00139         d->list << TQT_DBusData::fromByte(*it);
00140     }
00141 }

Here is the call graph for this function:

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:
other the TQValueList of signed 16-bit integer values to copy from
See also:
toInt16List()

Definition at line 143 of file tqdbusdatalist.cpp.

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

00143                                                                      : d(new Private())
00144 {
00145     d->type = TQT_DBusData::Int16;
00146 
00147     if (other.isEmpty()) return;
00148 
00149     TQValueList<TQ_INT16>::const_iterator it    = other.begin();
00150     TQValueList<TQ_INT16>::const_iterator endIt = other.end();
00151     for (; it != endIt; ++it)
00152     {
00153         d->list << TQT_DBusData::fromInt16(*it);
00154     }
00155 }

Here is the call graph for this function:

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:
other the TQValueList of unsigned 16-bit integer values to copy from
See also:
toUInt16List()

Definition at line 157 of file tqdbusdatalist.cpp.

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

00157                                                                       : d(new Private())
00158 {
00159     d->type = TQT_DBusData::UInt16;
00160 
00161     if (other.isEmpty()) return;
00162 
00163     TQValueList<TQ_UINT16>::const_iterator it    = other.begin();
00164     TQValueList<TQ_UINT16>::const_iterator endIt = other.end();
00165     for (; it != endIt; ++it)
00166     {
00167         d->list << TQT_DBusData::fromUInt16(*it);
00168     }
00169 }

Here is the call graph for this function:

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:
other the TQValueList of signed 32-bit integer values to copy from
See also:
toInt32List()

Definition at line 171 of file tqdbusdatalist.cpp.

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

00171                                                                      : d(new Private())
00172 {
00173     d->type = TQT_DBusData::Int32;
00174 
00175     if (other.isEmpty()) return;
00176 
00177     TQValueList<TQ_INT32>::const_iterator it    = other.begin();
00178     TQValueList<TQ_INT32>::const_iterator endIt = other.end();
00179     for (; it != endIt; ++it)
00180     {
00181         d->list << TQT_DBusData::fromInt32(*it);
00182     }
00183 }

Here is the call graph for this function:

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:
other the TQValueList of unsigned 32-bit integer values to copy from
See also:
toUInt32List()

Definition at line 185 of file tqdbusdatalist.cpp.

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

00185                                                                       : d(new Private())
00186 {
00187     d->type = TQT_DBusData::UInt32;
00188 
00189     if (other.isEmpty()) return;
00190 
00191     TQValueList<TQ_UINT32>::const_iterator it    = other.begin();
00192     TQValueList<TQ_UINT32>::const_iterator endIt = other.end();
00193     for (; it != endIt; ++it)
00194     {
00195         d->list << TQT_DBusData::fromUInt32(*it);
00196     }
00197 }

Here is the call graph for this function:

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:
other the TQValueList of signed 64-bit integer values to copy from
See also:
toInt64List()

Definition at line 199 of file tqdbusdatalist.cpp.

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

00199                                                                      : d(new Private())
00200 {
00201     d->type = TQT_DBusData::Int64;
00202 
00203     if (other.isEmpty()) return;
00204 
00205     TQValueList<TQ_INT64>::const_iterator it    = other.begin();
00206     TQValueList<TQ_INT64>::const_iterator endIt = other.end();
00207     for (; it != endIt; ++it)
00208     {
00209         d->list << TQT_DBusData::fromInt64(*it);
00210     }
00211 }

Here is the call graph for this function:

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:
other the TQValueList of unsigned 64-bit integer values to copy from
See also:
toUInt64List()

Definition at line 213 of file tqdbusdatalist.cpp.

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

00213                                                                       : d(new Private())
00214 {
00215     d->type = TQT_DBusData::UInt64;
00216 
00217     if (other.isEmpty()) return;
00218 
00219     TQValueList<TQ_UINT64>::const_iterator it    = other.begin();
00220     TQValueList<TQ_UINT64>::const_iterator endIt = other.end();
00221     for (; it != endIt; ++it)
00222     {
00223         d->list << TQT_DBusData::fromUInt64(*it);
00224     }
00225 }

Here is the call graph for this function:

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:
other the TQValueList of double values to copy from
See also:
toDoubleList()

Definition at line 227 of file tqdbusdatalist.cpp.

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

00227                                                                    : d(new Private())
00228 {
00229     d->type = TQT_DBusData::Double;
00230 
00231     if (other.isEmpty()) return;
00232 
00233     TQValueList<double>::const_iterator it    = other.begin();
00234     TQValueList<double>::const_iterator endIt = other.end();
00235     for (; it != endIt; ++it)
00236     {
00237         d->list << TQT_DBusData::fromDouble(*it);
00238     }
00239 }

Here is the call graph for this function:

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:
other the TQValueList of variant values to copy from
See also:
toVariantList()

Definition at line 241 of file tqdbusdatalist.cpp.

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

00242     : d(new Private())
00243 {
00244     d->type = TQT_DBusData::Variant;
00245 
00246     if (other.isEmpty()) return;
00247 
00248     TQValueList<TQT_DBusVariant>::const_iterator it    = other.begin();
00249     TQValueList<TQT_DBusVariant>::const_iterator endIt = other.end();
00250     for (; it != endIt; ++it)
00251     {
00252         d->list << TQT_DBusData::fromVariant(*it);
00253     }
00254 }

Here is the call graph for this function:

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:
other the TQStringList to copy from
See also:
toTQStringList()

Definition at line 256 of file tqdbusdatalist.cpp.

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

00256                                                             : d(new Private())
00257 {
00258     d->type = TQT_DBusData::String;
00259 
00260     if (other.isEmpty()) return;
00261 
00262     TQStringList::const_iterator it    = other.begin();
00263     TQStringList::const_iterator endIt = other.end();
00264     for (; it != endIt; ++it)
00265     {
00266         d->list << TQT_DBusData::fromString(*it);
00267     }
00268 }

Here is the call graph for this function:

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:
other the TQValueList of object path values to copy from
See also:
toObjectPathList()

Definition at line 270 of file tqdbusdatalist.cpp.

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

00271     : d(new Private())
00272 {
00273     d->type = TQT_DBusData::ObjectPath;
00274 
00275     if (other.isEmpty()) return;
00276 
00277     TQValueList<TQT_DBusObjectPath>::const_iterator it    = other.begin();
00278     TQValueList<TQT_DBusObjectPath>::const_iterator endIt = other.end();
00279     for (; it != endIt; ++it)
00280     {
00281         d->list << TQT_DBusData::fromObjectPath(*it);
00282     }
00283 }

Here is the call graph for this function:

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:
other the TQValueList of unix file handle values to copy from
See also:
toUnixFdList()

Definition at line 285 of file tqdbusdatalist.cpp.

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

00286     : d(new Private())
00287 {
00288     d->type = TQT_DBusData::UnixFd;
00289 
00290     if (other.isEmpty()) return;
00291 
00292     TQValueList<TQT_DBusUnixFd>::const_iterator it    = other.begin();
00293     TQValueList<TQT_DBusUnixFd>::const_iterator endIt = other.end();
00294     for (; it != endIt; ++it)
00295     {
00296         d->list << TQT_DBusData::fromUnixFd(*it);
00297     }
00298 }

Here is the call graph for this function:

TQT_DBusDataList::~TQT_DBusDataList (  ) 

Destroys the list object.

Definition at line 300 of file tqdbusdatalist.cpp.

References d.

00301 {
00302     delete d;
00303 }


Member Function Documentation

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.

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

00450 {
00451     d->list.clear();
00452 }

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.

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

00391 {
00392     return d->containerItem;
00393 }

Here is the caller graph for this function:

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.

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

00401 {
00402     return d->list.count();
00403 }

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.

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

00385 {
00386     return d->type == TQT_DBusData::List || d->type == TQT_DBusData::Map
00387                                       || d->type == TQT_DBusData::Struct;
00388 }

Here is the caller graph for this function:

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.

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

00396 {
00397     return d->list.isEmpty();
00398 }

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.

References TQT_DBusData::Invalid.

00414 { return type() != TQT_DBusData::Invalid; }

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:
other the 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.

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

00428 {
00429     if (&other == this) return false;
00430     if (d == other.d) return false;
00431 
00432     bool containerEqual = true;
00433     if (hasContainerItemType())
00434     {
00435         if (other.hasContainerItemType())
00436         {
00437             containerEqual = d->containerItem.buildDBusSignature() ==
00438                              other.d->containerItem.buildDBusSignature();
00439         }
00440         else
00441             containerEqual = false;
00442     }
00443     else if (other.hasContainerItemType())
00444         containerEqual = false;
00445 
00446     return d->type != other.d->type || !containerEqual || d->list != other.d->list;
00447 }

Here is the call graph for this function:

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:
data the data item to append to the list
Returns:
a reference to this list object

Definition at line 454 of file tqdbusdatalist.cpp.

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

00455 {
00456     if (data.type() == TQT_DBusData::Invalid) return *this;
00457 
00458     if (d->type == TQT_DBusData::Invalid)
00459     {
00460         d->type = data.type();
00461 
00462         // check if we are now have container items
00463         if (hasContainerItemType()) d->containerItem = data;
00464 
00465         d->list << data;
00466     }
00467     else if (d->type != data.type())
00468     {
00469         tqWarning("TQT_DBusDataList: trying to add data of type %s to list of type %s",
00470                  data.typeName(), TQT_DBusData::typeName(d->type));
00471     }
00472     else if (hasContainerItemType())
00473     {
00474         TQCString ourSignature  = d->containerItem.buildDBusSignature();
00475         TQCString dataSignature = data.buildDBusSignature();
00476 
00477         if (ourSignature != dataSignature)
00478         {
00479             tqWarning("TQT_DBusDataList: trying to add data with signature %s "
00480                      "to list with item signature %s",
00481                      dataSignature.data(), ourSignature.data());
00482         }
00483         else
00484             d->list << data;
00485     }
00486     else
00487         d->list << data;
00488 
00489     return *this;
00490 }

Here is the call graph for this function:

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:
other the stringlist to copy from
Returns:
a reference to this list object

Definition at line 363 of file tqdbusdatalist.cpp.

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

00364 {
00365     d->list.clear();
00366     d->type = TQT_DBusData::String;
00367     d->containerItem = TQT_DBusData();
00368 
00369     TQStringList::const_iterator it    = other.begin();
00370     TQStringList::const_iterator endIt = other.end();
00371     for (; it != endIt; ++it)
00372     {
00373         d->list << TQT_DBusData::fromString(*it);
00374     }
00375 
00376     return *this;
00377 }

Here is the call graph for this function:

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:
other the other list object to copy from
Returns:
a reference to this list object

Definition at line 316 of file tqdbusdatalist.cpp.

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

00317 {
00318     d->list.clear();
00319     d->type = TQT_DBusData::Invalid;
00320     d->containerItem = TQT_DBusData();
00321 
00322     if (other.isEmpty()) return *this;
00323 
00324     TQValueList<TQT_DBusData>::const_iterator it    = other.begin();
00325     TQValueList<TQT_DBusData>::const_iterator endIt = other.end();
00326 
00327     d->type = (*it).type();
00328 
00329     TQCString elementSignature;
00330     if (hasContainerItemType())
00331     {
00332         d->containerItem = other[0]; // would be nice to get an empty one
00333 
00334         elementSignature = d->containerItem.buildDBusSignature();
00335     }
00336 
00337     for (++it; it != endIt; ++it)
00338     {
00339         if (d->type != (*it).type())
00340         {
00341             d->type = TQT_DBusData::Invalid;
00342             d->containerItem = TQT_DBusData();
00343 
00344             return *this;
00345         }
00346         else if (hasContainerItemType())
00347         {
00348             if ((*it).buildDBusSignature() != elementSignature)
00349             {
00350                 d->type = TQT_DBusData::Invalid;
00351                 d->containerItem = TQT_DBusData();
00352 
00353                 return *this;
00354             }
00355         }
00356     }
00357 
00358     d->list = other;
00359 
00360     return *this;
00361 }

Here is the call graph for this function:

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:
other the other list object to copy from
Returns:
a reference to this list object

Definition at line 305 of file tqdbusdatalist.cpp.

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

00306 {
00307     if (&other == this) return *this;
00308 
00309     d->type = other.d->type;
00310     d->list = other.d->list;
00311     d->containerItem = other.d->containerItem;
00312 
00313     return *this;
00314 }

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:
other the 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.

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

00406 {
00407     if (&other == this) return true;
00408     if (d == other.d) return true;
00409 
00410     bool containerEqual = true;
00411     if (hasContainerItemType())
00412     {
00413         if (other.hasContainerItemType())
00414         {
00415             containerEqual = d->containerItem.buildDBusSignature() ==
00416                              other.d->containerItem.buildDBusSignature();
00417         }
00418         else
00419             containerEqual = false;
00420     }
00421     else if (other.hasContainerItemType())
00422         containerEqual = false;
00423 
00424     return d->type == other.d->type && containerEqual && d->list == other.d->list;
00425 }

Here is the call graph for this function:

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:
ok optional 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.

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

00520 {
00521     if (d->type != TQT_DBusData::Bool)
00522     {
00523         if (ok != 0) *ok = false;
00524         return TQValueList<bool>();
00525     }
00526 
00527     TQValueList<bool> result;
00528 
00529     TQValueList<TQT_DBusData>::const_iterator it    = d->list.begin();
00530     TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
00531     for (; it != endIt; ++it)
00532     {
00533         result << (*it).toBool();
00534     }
00535 
00536     if (ok != 0) *ok = true;
00537 
00538     return result;
00539 }

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:
ok optional 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.

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

00542 {
00543     if (d->type != TQT_DBusData::Byte)
00544     {
00545         if (ok != 0) *ok = false;
00546         return TQValueList<TQ_UINT8>();
00547     }
00548 
00549     TQValueList<TQ_UINT8> result;
00550 
00551     TQValueList<TQT_DBusData>::const_iterator it    = d->list.begin();
00552     TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
00553     for (; it != endIt; ++it)
00554     {
00555         result << (*it).toByte();
00556     }
00557 
00558     if (ok != 0) *ok = true;
00559 
00560     return result;
00561 }

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:
ok optional 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.

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

00696 {
00697     if (d->type != TQT_DBusData::Double)
00698     {
00699         if (ok != 0) *ok = false;
00700         return TQValueList<double>();
00701     }
00702 
00703     TQValueList<double> result;
00704 
00705     TQValueList<TQT_DBusData>::const_iterator it    = d->list.begin();
00706     TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
00707     for (; it != endIt; ++it)
00708     {
00709         result << (*it).toDouble();
00710     }
00711 
00712     if (ok != 0) *ok = true;
00713 
00714     return result;
00715 }

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:
ok optional 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.

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

00564 {
00565     if (d->type != TQT_DBusData::Int16)
00566     {
00567         if (ok != 0) *ok = false;
00568         return TQValueList<TQ_INT16>();
00569     }
00570 
00571     TQValueList<TQ_INT16> result;
00572 
00573     TQValueList<TQT_DBusData>::const_iterator it    = d->list.begin();
00574     TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
00575     for (; it != endIt; ++it)
00576     {
00577         result << (*it).toInt16();
00578     }
00579 
00580     if (ok != 0) *ok = true;
00581 
00582     return result;
00583 }

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:
ok optional 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.

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

00608 {
00609     if (d->type != TQT_DBusData::Int32)
00610     {
00611         if (ok != 0) *ok = false;
00612         return TQValueList<TQ_INT32>();
00613     }
00614 
00615     TQValueList<TQ_INT32> result;
00616 
00617     TQValueList<TQT_DBusData>::const_iterator it    = d->list.begin();
00618     TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
00619     for (; it != endIt; ++it)
00620     {
00621         result << (*it).toInt32();
00622     }
00623 
00624     if (ok != 0) *ok = true;
00625 
00626     return result;
00627 }

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:
ok optional 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.

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

00652 {
00653     if (d->type != TQT_DBusData::Int64)
00654     {
00655         if (ok != 0) *ok = false;
00656         return TQValueList<TQ_INT64>();
00657     }
00658 
00659     TQValueList<TQ_INT64> result;
00660 
00661     TQValueList<TQT_DBusData>::const_iterator it    = d->list.begin();
00662     TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
00663     for (; it != endIt; ++it)
00664     {
00665         result << (*it).toInt64();
00666     }
00667 
00668     if (ok != 0) *ok = true;
00669 
00670     return result;
00671 }

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:
ok optional 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.

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

00723 {
00724     if (d->type != TQT_DBusData::ObjectPath)
00725     {
00726         if (ok != 0) *ok = false;
00727         return TQValueList<TQT_DBusObjectPath>();
00728     }
00729 
00730     TQValueList<TQT_DBusObjectPath> result;
00731 
00732     TQValueList<TQT_DBusData>::const_iterator it    = d->list.begin();
00733     TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
00734     for (; it != endIt; ++it)
00735     {
00736         result << (*it).toObjectPath();
00737     }
00738 
00739     if (ok != 0) *ok = true;
00740 
00741     return result;
00742 }

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:
ok optional 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.

References toTQStringList().

00718 {
00719     return toTQStringList(ok);
00720 }

Here is the call graph for this function:

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:
ok optional 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.

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

00498 {
00499     if (d->type != TQT_DBusData::String)
00500     {
00501         if (ok != 0) *ok = false;
00502         return TQStringList();
00503     }
00504 
00505     TQStringList result;
00506 
00507     TQValueList<TQT_DBusData>::const_iterator it    = d->list.begin();
00508     TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
00509     for (; it != endIt; ++it)
00510     {
00511         result << (*it).toString();
00512     }
00513 
00514     if (ok != 0) *ok = true;
00515 
00516     return result;
00517 }

Here is the caller graph for this function:

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.

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

00493 {
00494     return d->list;
00495 }

Here is the caller graph for this function:

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:
ok optional 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.

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

00586 {
00587     if (d->type != TQT_DBusData::UInt16)
00588     {
00589         if (ok != 0) *ok = false;
00590         return TQValueList<TQ_UINT16>();
00591     }
00592 
00593     TQValueList<TQ_UINT16> result;
00594 
00595     TQValueList<TQT_DBusData>::const_iterator it    = d->list.begin();
00596     TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
00597     for (; it != endIt; ++it)
00598     {
00599         result << (*it).toUInt16();
00600     }
00601 
00602     if (ok != 0) *ok = true;
00603 
00604     return result;
00605 }

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:
ok optional 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.

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

00630 {
00631     if (d->type != TQT_DBusData::UInt32)
00632     {
00633         if (ok != 0) *ok = false;
00634         return TQValueList<TQ_UINT32>();
00635     }
00636 
00637     TQValueList<TQ_UINT32> result;
00638 
00639     TQValueList<TQT_DBusData>::const_iterator it    = d->list.begin();
00640     TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
00641     for (; it != endIt; ++it)
00642     {
00643         result << (*it).toUInt32();
00644     }
00645 
00646     if (ok != 0) *ok = true;
00647 
00648     return result;
00649 }

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:
ok optional 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.

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

00674 {
00675     if (d->type != TQT_DBusData::UInt64)
00676     {
00677         if (ok != 0) *ok = false;
00678         return TQValueList<TQ_UINT64>();
00679     }
00680 
00681     TQValueList<TQ_UINT64> result;
00682 
00683     TQValueList<TQT_DBusData>::const_iterator it    = d->list.begin();
00684     TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
00685     for (; it != endIt; ++it)
00686     {
00687         result << (*it).toUInt64();
00688     }
00689 
00690     if (ok != 0) *ok = true;
00691 
00692     return result;
00693 }

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:
ok optional 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.

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

00745 {
00746     if (d->type != TQT_DBusData::UnixFd)
00747     {
00748         if (ok != 0) *ok = false;
00749         return TQValueList<TQT_DBusUnixFd>();
00750     }
00751 
00752     TQValueList<TQT_DBusUnixFd> result;
00753 
00754     TQValueList<TQT_DBusData>::const_iterator it    = d->list.begin();
00755     TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
00756     for (; it != endIt; ++it)
00757     {
00758         result << (*it).toUnixFd();
00759     }
00760 
00761     if (ok != 0) *ok = true;
00762 
00763     return result;
00764 }

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:
ok optional 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.

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

00767 {
00768     if (d->type != TQT_DBusData::Variant)
00769     {
00770         if (ok != 0) *ok = false;
00771         return TQValueList<TQT_DBusVariant>();
00772     }
00773 
00774     TQValueList<TQT_DBusVariant> result;
00775 
00776     TQValueList<TQT_DBusData>::const_iterator it    = d->list.begin();
00777     TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
00778     for (; it != endIt; ++it)
00779     {
00780         result << (*it).toVariant();
00781     }
00782 
00783     if (ok != 0) *ok = true;
00784 
00785     return result;
00786 }

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.

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

00380 {
00381     return d->type;
00382 }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 754 of file tqdbusdatalist.h.


The documentation for this class was generated from the following files:
Generated on Fri Apr 26 16:30:21 2019 for DBus-1-TQt by  doxygen 1.6.3