DBus-1-TQt  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

TQValueList<TQ_INT16> intList;
list << 2 << 3 << 5 << 7;
TQT_DBusDataList dbusList(intList);
// or even shorter, using implicit conversion

Example for creating an empty list

// empty list for a simple type
// empty list for a list of string lists
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.

: d(new Private())
{
}
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.

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

: d(new Private())
{
d->type = simpleItemType;
}
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.

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

: d(new Private())
{
d->type = containerItemType.type();
switch(d->type)
{
case TQT_DBusData::List: // fall through
case TQT_DBusData::Struct: // fall through
break;
default: // not a container
break;
}
}

+ 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
otherthe 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.

: d(new Private())
{
d->type = other.d->type;
d->list = other.d->list;
}
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.

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

: d(new Private())
{
if (other.isEmpty()) return;
TQValueList<TQT_DBusData>::const_iterator it = other.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = other.end();
d->type = (*it).type();
TQCString elementSignature;
{
d->containerItem = other[0]; // would be nice to get an empty one
elementSignature = d->containerItem.buildDBusSignature();
}
for (++it; it != endIt; ++it)
{
if (d->type != (*it).type())
{
return;
}
{
if ((*it).buildDBusSignature() != elementSignature)
{
return;
}
}
}
d->list = other;
}

+ 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
otherthe 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.

: d(new Private())
{
if (other.isEmpty()) return;
TQValueList<bool>::const_iterator it = other.begin();
TQValueList<bool>::const_iterator endIt = other.end();
for (; it != endIt; ++it)
{
}
}

+ 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
otherthe 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.

: d(new Private())
{
if (other.isEmpty()) return;
TQValueList<TQ_UINT8>::const_iterator it = other.begin();
TQValueList<TQ_UINT8>::const_iterator endIt = other.end();
for (; it != endIt; ++it)
{
}
}

+ 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
otherthe 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.

: d(new Private())
{
if (other.isEmpty()) return;
TQValueList<TQ_INT16>::const_iterator it = other.begin();
TQValueList<TQ_INT16>::const_iterator endIt = other.end();
for (; it != endIt; ++it)
{
}
}

+ 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
otherthe 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.

: d(new Private())
{
if (other.isEmpty()) return;
TQValueList<TQ_UINT16>::const_iterator it = other.begin();
TQValueList<TQ_UINT16>::const_iterator endIt = other.end();
for (; it != endIt; ++it)
{
}
}

+ 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
otherthe 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.

: d(new Private())
{
if (other.isEmpty()) return;
TQValueList<TQ_INT32>::const_iterator it = other.begin();
TQValueList<TQ_INT32>::const_iterator endIt = other.end();
for (; it != endIt; ++it)
{
}
}

+ 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
otherthe 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.

: d(new Private())
{
if (other.isEmpty()) return;
TQValueList<TQ_UINT32>::const_iterator it = other.begin();
TQValueList<TQ_UINT32>::const_iterator endIt = other.end();
for (; it != endIt; ++it)
{
}
}

+ 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
otherthe 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.

: d(new Private())
{
if (other.isEmpty()) return;
TQValueList<TQ_INT64>::const_iterator it = other.begin();
TQValueList<TQ_INT64>::const_iterator endIt = other.end();
for (; it != endIt; ++it)
{
}
}

+ 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
otherthe 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.

: d(new Private())
{
if (other.isEmpty()) return;
TQValueList<TQ_UINT64>::const_iterator it = other.begin();
TQValueList<TQ_UINT64>::const_iterator endIt = other.end();
for (; it != endIt; ++it)
{
}
}

+ 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
otherthe 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.

: d(new Private())
{
if (other.isEmpty()) return;
TQValueList<double>::const_iterator it = other.begin();
TQValueList<double>::const_iterator endIt = other.end();
for (; it != endIt; ++it)
{
}
}

+ 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
otherthe 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.

: d(new Private())
{
if (other.isEmpty()) return;
TQValueList<TQT_DBusVariant>::const_iterator it = other.begin();
TQValueList<TQT_DBusVariant>::const_iterator endIt = other.end();
for (; it != endIt; ++it)
{
}
}

+ 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
otherthe 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.

: d(new Private())
{
if (other.isEmpty()) return;
TQStringList::const_iterator it = other.begin();
TQStringList::const_iterator endIt = other.end();
for (; it != endIt; ++it)
{
}
}

+ 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
otherthe 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.

: d(new Private())
{
if (other.isEmpty()) return;
TQValueList<TQT_DBusObjectPath>::const_iterator it = other.begin();
TQValueList<TQT_DBusObjectPath>::const_iterator endIt = other.end();
for (; it != endIt; ++it)
{
}
}

+ 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
otherthe 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.

: d(new Private())
{
if (other.isEmpty()) return;
TQValueList<TQT_DBusUnixFd>::const_iterator it = other.begin();
TQValueList<TQT_DBusUnixFd>::const_iterator endIt = other.end();
for (; it != endIt; ++it)
{
}
}

+ 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.

{
delete d;
}

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.

{
d->list.clear();
}
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.

{
return d->containerItem;
}

+ 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.

{
return d->list.count();
}
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.

+ 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.

{
return d->list.isEmpty();
}
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.

{ 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
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.

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

{
if (&other == this) return false;
if (d == other.d) return false;
bool containerEqual = true;
{
if (other.hasContainerItemType())
{
containerEqual = d->containerItem.buildDBusSignature() ==
}
else
containerEqual = false;
}
else if (other.hasContainerItemType())
containerEqual = false;
return d->type != other.d->type || !containerEqual || d->list != other.d->list;
}

+ 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
datathe 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().

{
if (data.type() == TQT_DBusData::Invalid) return *this;
{
d->type = data.type();
// check if we are now have container items
d->list << data;
}
else if (d->type != data.type())
{
tqWarning("TQT_DBusDataList: trying to add data of type %s to list of type %s",
}
{
TQCString ourSignature = d->containerItem.buildDBusSignature();
TQCString dataSignature = data.buildDBusSignature();
if (ourSignature != dataSignature)
{
tqWarning("TQT_DBusDataList: trying to add data with signature %s "
"to list with item signature %s",
dataSignature.data(), ourSignature.data());
}
else
d->list << data;
}
else
d->list << data;
return *this;
}

+ 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
otherthe 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.

{
if (&other == this) return *this;
d->type = other.d->type;
d->list = other.d->list;
return *this;
}
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.

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

{
d->list.clear();
if (other.isEmpty()) return *this;
TQValueList<TQT_DBusData>::const_iterator it = other.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = other.end();
d->type = (*it).type();
TQCString elementSignature;
{
d->containerItem = other[0]; // would be nice to get an empty one
elementSignature = d->containerItem.buildDBusSignature();
}
for (++it; it != endIt; ++it)
{
if (d->type != (*it).type())
{
return *this;
}
{
if ((*it).buildDBusSignature() != elementSignature)
{
return *this;
}
}
}
d->list = other;
return *this;
}

+ 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
otherthe 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.

{
d->list.clear();
TQStringList::const_iterator it = other.begin();
TQStringList::const_iterator endIt = other.end();
for (; it != endIt; ++it)
{
}
return *this;
}

+ Here is the call graph for this function:

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.

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

{
if (&other == this) return true;
if (d == other.d) return true;
bool containerEqual = true;
{
if (other.hasContainerItemType())
{
containerEqual = d->containerItem.buildDBusSignature() ==
}
else
containerEqual = false;
}
else if (other.hasContainerItemType())
containerEqual = false;
return d->type == other.d->type && containerEqual && d->list == other.d->list;
}

+ 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
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.

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

{
{
if (ok != 0) *ok = false;
return TQValueList<bool>();
}
TQValueList<bool> result;
TQValueList<TQT_DBusData>::const_iterator it = d->list.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
for (; it != endIt; ++it)
{
result << (*it).toBool();
}
if (ok != 0) *ok = true;
return result;
}
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.

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

{
{
if (ok != 0) *ok = false;
return TQValueList<TQ_UINT8>();
}
TQValueList<TQ_UINT8> result;
TQValueList<TQT_DBusData>::const_iterator it = d->list.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
for (; it != endIt; ++it)
{
result << (*it).toByte();
}
if (ok != 0) *ok = true;
return result;
}
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.

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

{
{
if (ok != 0) *ok = false;
return TQValueList<double>();
}
TQValueList<double> result;
TQValueList<TQT_DBusData>::const_iterator it = d->list.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
for (; it != endIt; ++it)
{
result << (*it).toDouble();
}
if (ok != 0) *ok = true;
return result;
}
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.

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

{
{
if (ok != 0) *ok = false;
return TQValueList<TQ_INT16>();
}
TQValueList<TQ_INT16> result;
TQValueList<TQT_DBusData>::const_iterator it = d->list.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
for (; it != endIt; ++it)
{
result << (*it).toInt16();
}
if (ok != 0) *ok = true;
return result;
}
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.

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

{
{
if (ok != 0) *ok = false;
return TQValueList<TQ_INT32>();
}
TQValueList<TQ_INT32> result;
TQValueList<TQT_DBusData>::const_iterator it = d->list.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
for (; it != endIt; ++it)
{
result << (*it).toInt32();
}
if (ok != 0) *ok = true;
return result;
}
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.

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

{
{
if (ok != 0) *ok = false;
return TQValueList<TQ_INT64>();
}
TQValueList<TQ_INT64> result;
TQValueList<TQT_DBusData>::const_iterator it = d->list.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
for (; it != endIt; ++it)
{
result << (*it).toInt64();
}
if (ok != 0) *ok = true;
return result;
}
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.

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

{
{
if (ok != 0) *ok = false;
return TQValueList<TQT_DBusObjectPath>();
}
TQValueList<TQT_DBusObjectPath> result;
TQValueList<TQT_DBusData>::const_iterator it = d->list.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
for (; it != endIt; ++it)
{
result << (*it).toObjectPath();
}
if (ok != 0) *ok = true;
return result;
}
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.

References toTQStringList().

{
return toTQStringList(ok);
}

+ 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
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.

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

{
{
if (ok != 0) *ok = false;
return TQStringList();
}
TQStringList result;
TQValueList<TQT_DBusData>::const_iterator it = d->list.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
for (; it != endIt; ++it)
{
result << (*it).toString();
}
if (ok != 0) *ok = true;
return result;
}

+ 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.

{
return d->list;
}

+ 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
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.

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

{
{
if (ok != 0) *ok = false;
return TQValueList<TQ_UINT16>();
}
TQValueList<TQ_UINT16> result;
TQValueList<TQT_DBusData>::const_iterator it = d->list.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
for (; it != endIt; ++it)
{
result << (*it).toUInt16();
}
if (ok != 0) *ok = true;
return result;
}
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.

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

{
{
if (ok != 0) *ok = false;
return TQValueList<TQ_UINT32>();
}
TQValueList<TQ_UINT32> result;
TQValueList<TQT_DBusData>::const_iterator it = d->list.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
for (; it != endIt; ++it)
{
result << (*it).toUInt32();
}
if (ok != 0) *ok = true;
return result;
}
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.

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

{
{
if (ok != 0) *ok = false;
return TQValueList<TQ_UINT64>();
}
TQValueList<TQ_UINT64> result;
TQValueList<TQT_DBusData>::const_iterator it = d->list.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
for (; it != endIt; ++it)
{
result << (*it).toUInt64();
}
if (ok != 0) *ok = true;
return result;
}
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.

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

{
{
if (ok != 0) *ok = false;
return TQValueList<TQT_DBusUnixFd>();
}
TQValueList<TQT_DBusUnixFd> result;
TQValueList<TQT_DBusData>::const_iterator it = d->list.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
for (; it != endIt; ++it)
{
result << (*it).toUnixFd();
}
if (ok != 0) *ok = true;
return result;
}
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.

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

{
{
if (ok != 0) *ok = false;
return TQValueList<TQT_DBusVariant>();
}
TQValueList<TQT_DBusVariant> result;
TQValueList<TQT_DBusData>::const_iterator it = d->list.begin();
TQValueList<TQT_DBusData>::const_iterator endIt = d->list.end();
for (; it != endIt; ++it)
{
result << (*it).toVariant();
}
if (ok != 0) *ok = true;
return result;
}
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.

{
return d->type;
}

+ Here is the caller graph for this function:

Member Data Documentation

Private* TQT_DBusDataList::d
private

Definition at line 754 of file tqdbusdatalist.h.


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