Changeset 9401 in vbox for trunk/src/VBox/Frontends/VirtualBox4/include/COMDefs.h
- Timestamp:
- Jun 5, 2008 8:01:41 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/COMDefs.h
r9381 r9401 10 10 11 11 /* 12 * Copyright (C) 2006-200 7Sun Microsystems, Inc.12 * Copyright (C) 2006-2008 Sun Microsystems, Inc. 13 13 * 14 14 * This file is part of VirtualBox Open Source Edition (OSE), as … … 80 80 #undef ASSERT 81 81 82 #include <qstring.h> 83 #include <quuid.h> 84 #include <q3valuevector.h> 82 /* Qt includes */ 83 #include <QString> 84 #include <QUuid> 85 #include <QVector> 85 86 86 87 #include <iprt/memory> // for auto_copy_ptr … … 228 229 229 230 template <typename QT, typename CT> 230 static void ToSafeArray (const Q 3ValueVector <QT> &aVec, com::SafeArray <CT> &aArr)231 static void ToSafeArray (const QVector <QT> &aVec, com::SafeArray <CT> &aArr) 231 232 { 232 233 AssertMsgFailedReturnVoid (("No conversion!\n")); … … 234 235 235 236 template <typename CT, typename QT> 236 static void FromSafeArray (const com::SafeArray <CT> &aArr, Q 3ValueVector <QT> &aVec)237 static void FromSafeArray (const com::SafeArray <CT> &aArr, QVector <QT> &aVec) 237 238 { 238 239 AssertMsgFailedReturnVoid (("No conversion!\n")); … … 240 241 241 242 template <typename QT, typename CT> 242 static void ToSafeArray (const Q 3ValueVector <QT *> &aVec, com::SafeArray <CT *> &aArr)243 static void ToSafeArray (const QVector <QT *> &aVec, com::SafeArray <CT *> &aArr) 243 244 { 244 245 AssertMsgFailedReturnVoid (("No conversion!\n")); … … 246 247 247 248 template <typename CT, typename QT> 248 static void FromSafeArray (const com::SafeArray <CT *> &aArr, Q 3ValueVector <QT *> &aVec)249 static void FromSafeArray (const com::SafeArray <CT *> &aArr, QVector <QT *> &aVec) 249 250 { 250 251 AssertMsgFailedReturnVoid (("No conversion!\n")); … … 254 255 255 256 template <typename T> 256 static void ToSafeArray (const Q 3ValueVector <T> &aVec, com::SafeArray <T> &aArr)257 static void ToSafeArray (const QVector <T> &aVec, com::SafeArray <T> &aArr) 257 258 { 258 259 aArr.reset (aVec.size()); 259 260 size_t i = 0; 260 for (typename Q 3ValueVector <T>::const_iterator it = aVec.begin();261 for (typename QVector <T>::const_iterator it = aVec.begin(); 261 262 it != aVec.end(); ++ it, ++ i) 262 263 aArr [i] = *it; … … 264 265 265 266 template <typename T> 266 static void FromSafeArray (const com::SafeArray <T> &aArr, Q 3ValueVector <T> &aVec)267 { 268 aVec = Q 3ValueVector <T> (aArr.size());267 static void FromSafeArray (const com::SafeArray <T> &aArr, QVector <T> &aVec) 268 { 269 aVec = QVector <T> (aArr.size()); 269 270 size_t i = 0; 270 for (typename Q 3ValueVector <T>::iterator it = aVec.begin();271 for (typename QVector <T>::iterator it = aVec.begin(); 271 272 it != aVec.end(); ++ it, ++ i) 272 273 *it = aArr [i]; … … 275 276 /* Arrays of strings */ 276 277 277 static void ToSafeArray (const Q 3ValueVector <QString> &aVec,278 static void ToSafeArray (const QVector <QString> &aVec, 278 279 com::SafeArray <BSTR> &aArr); 279 280 static void FromSafeArray (const com::SafeArray <BSTR> &aArr, 280 Q 3ValueVector <QString> &aVec);281 QVector <QString> &aVec); 281 282 282 283 /* Arrays of interface pointers. Note: we need a separate pair of names … … 290 291 291 292 template <class CI, class I> 292 static void ToSafeIfaceArray (const Q 3ValueVector <CI> &aVec,293 static void ToSafeIfaceArray (const QVector <CI> &aVec, 293 294 com::SafeIfaceArray <I> &aArr) 294 295 { 295 296 aArr.reset (aVec.size()); 296 297 size_t i = 0; 297 for (typename Q 3ValueVector <CI>::const_iterator it = aVec.begin();298 for (typename QVector <CI>::const_iterator it = aVec.begin(); 298 299 it != aVec.end(); ++ it, ++ i) 299 300 { … … 306 307 template <class I, class CI> 307 308 static void FromSafeIfaceArray (const com::SafeIfaceArray <I> &aArr, 308 Q 3ValueVector <CI> &aVec)309 { 310 aVec = Q 3ValueVector <CI> (aArr.size());309 QVector <CI> &aVec) 310 { 311 aVec = QVector <CI> (aArr.size()); 311 312 size_t i = 0; 312 for (typename Q 3ValueVector <CI>::iterator it = aVec.begin();313 for (typename QVector <CI>::iterator it = aVec.begin(); 313 314 it != aVec.end(); ++ it, ++ i) 314 315 (*it).attach (aArr [i]);
Note:
See TracChangeset
for help on using the changeset viewer.