DBus-1-TQt  1.0
tqdbusdatalist.cpp
Go to the documentation of this file.
00001 /* qdbusdatalist.cpp list of DBUS data transport type
00002  *
00003  * Copyright (C) 2007 Kevin Krammer <kevin.krammer@gmx.at>
00004  *
00005  * Licensed under the Academic Free License version 2.1
00006  *
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
00020  * USA.
00021  *
00022  */
00023 
00024 #include "tqdbusdatalist.h"
00025 #include "tqdbusobjectpath.h"
00026 #include "tqdbusunixfd.h"
00027 #include "tqdbusvariant.h"
00028 
00029 #include <tqstringlist.h>
00030 
00031 class TQT_DBusDataList::Private
00032 {
00033 public:
00034     Private() : type(TQT_DBusData::Invalid) {}
00035 
00036 public:
00037     TQT_DBusData::Type type;
00038     TQT_DBusData containerItem;
00039     TQValueList<TQT_DBusData> list;
00040 };
00041 
00042 TQT_DBusDataList::TQT_DBusDataList() : d(new Private())
00043 {
00044 }
00045 
00046 TQT_DBusDataList::TQT_DBusDataList(TQT_DBusData::Type simpleItemType) : d(new Private())
00047 {
00048     d->type = simpleItemType;
00049 }
00050 
00051 TQT_DBusDataList::TQT_DBusDataList(const TQT_DBusData& containerItemType) : 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 }
00067 
00068 TQT_DBusDataList::TQT_DBusDataList(const TQT_DBusDataList& other) : d(new Private())
00069 {
00070     d->type = other.d->type;
00071     d->list = other.d->list;
00072     d->containerItem = other.d->containerItem;
00073 }
00074 
00075 TQT_DBusDataList::TQT_DBusDataList(const TQValueList<TQT_DBusData>& other) : 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 }
00114 
00115 TQT_DBusDataList::TQT_DBusDataList(const TQValueList<bool>& other) : 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 }
00128 
00129 TQT_DBusDataList::TQT_DBusDataList(const TQValueList<TQ_UINT8>& other) : 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 }
00142 
00143 TQT_DBusDataList::TQT_DBusDataList(const TQValueList<TQ_INT16>& other) : 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 }
00156 
00157 TQT_DBusDataList::TQT_DBusDataList(const TQValueList<TQ_UINT16>& other) : 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 }
00170 
00171 TQT_DBusDataList::TQT_DBusDataList(const TQValueList<TQ_INT32>& other) : 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 }
00184 
00185 TQT_DBusDataList::TQT_DBusDataList(const TQValueList<TQ_UINT32>& other) : 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 }
00198 
00199 TQT_DBusDataList::TQT_DBusDataList(const TQValueList<TQ_INT64>& other) : 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 }
00212 
00213 TQT_DBusDataList::TQT_DBusDataList(const TQValueList<TQ_UINT64>& other) : 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 }
00226 
00227 TQT_DBusDataList::TQT_DBusDataList(const TQValueList<double>& other) : 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 }
00240 
00241 TQT_DBusDataList::TQT_DBusDataList(const TQValueList<TQT_DBusVariant>& other)
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 }
00255 
00256 TQT_DBusDataList::TQT_DBusDataList(const TQStringList& other) : 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 }
00269 
00270 TQT_DBusDataList::TQT_DBusDataList(const TQValueList<TQT_DBusObjectPath>& other)
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 }
00284 
00285 TQT_DBusDataList::TQT_DBusDataList(const TQValueList<TQT_DBusUnixFd>& other)
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 }
00299 
00300 TQT_DBusDataList::~TQT_DBusDataList()
00301 {
00302     delete d;
00303 }
00304 
00305 TQT_DBusDataList& TQT_DBusDataList::operator=(const TQT_DBusDataList& other)
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 }
00315 
00316 TQT_DBusDataList& TQT_DBusDataList::operator=(const TQValueList<TQT_DBusData>& other)
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 }
00362 
00363 TQT_DBusDataList& TQT_DBusDataList::operator=(const TQStringList& other)
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 }
00378 
00379 TQT_DBusData::Type TQT_DBusDataList::type() const
00380 {
00381     return d->type;
00382 }
00383 
00384 bool TQT_DBusDataList::hasContainerItemType() const
00385 {
00386     return d->type == TQT_DBusData::List || d->type == TQT_DBusData::Map
00387                                       || d->type == TQT_DBusData::Struct;
00388 }
00389 
00390 TQT_DBusData TQT_DBusDataList::containerItemType() const
00391 {
00392     return d->containerItem;
00393 }
00394 
00395 bool TQT_DBusDataList::isEmpty() const
00396 {
00397     return d->list.isEmpty();
00398 }
00399 
00400 uint TQT_DBusDataList::count() const
00401 {
00402     return d->list.count();
00403 }
00404 
00405 bool TQT_DBusDataList::operator==(const TQT_DBusDataList& other) const
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 }
00426 
00427 bool TQT_DBusDataList::operator!=(const TQT_DBusDataList& other) const
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 }
00448 
00449 void TQT_DBusDataList::clear()
00450 {
00451     d->list.clear();
00452 }
00453 
00454 TQT_DBusDataList& TQT_DBusDataList::operator<<(const TQT_DBusData& data)
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 }
00491 
00492 TQValueList<TQT_DBusData> TQT_DBusDataList::toTQValueList() const
00493 {
00494     return d->list;
00495 }
00496 
00497 TQStringList TQT_DBusDataList::toTQStringList(bool* ok) const
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 }
00518 
00519 TQValueList<bool> TQT_DBusDataList::toBoolList(bool* ok) const
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 }
00540 
00541 TQValueList<TQ_UINT8> TQT_DBusDataList::toByteList(bool* ok) const
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 }
00562 
00563 TQValueList<TQ_INT16> TQT_DBusDataList::toInt16List(bool* ok) const
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 }
00584 
00585 TQValueList<TQ_UINT16> TQT_DBusDataList::toUInt16List(bool* ok) const
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 }
00606 
00607 TQValueList<TQ_INT32> TQT_DBusDataList::toInt32List(bool* ok) const
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 }
00628 
00629 TQValueList<TQ_UINT32> TQT_DBusDataList::toUInt32List(bool* ok) const
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 }
00650 
00651 TQValueList<TQ_INT64> TQT_DBusDataList::toInt64List(bool* ok) const
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 }
00672 
00673 TQValueList<TQ_UINT64> TQT_DBusDataList::toUInt64List(bool* ok) const
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 }
00694 
00695 TQValueList<double> TQT_DBusDataList::toDoubleList(bool* ok) const
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 }
00716 
00717 TQValueList<TQString> TQT_DBusDataList::toStringList(bool* ok) const
00718 {
00719     return toTQStringList(ok);
00720 }
00721 
00722 TQValueList<TQT_DBusObjectPath> TQT_DBusDataList::toObjectPathList(bool* ok) const
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 }
00743 
00744 TQValueList<TQT_DBusUnixFd> TQT_DBusDataList::toUnixFdList(bool* ok) const
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 }
00765 
00766 TQValueList<TQT_DBusVariant> TQT_DBusDataList::toVariantList(bool* ok) const
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 }
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines