Changeset 9425 in vbox for trunk/src/VBox/Frontends/VirtualBox4/include
- Timestamp:
- Jun 5, 2008 1:43:54 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 31667
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/COMDefs.h
r9401 r9425 31 31 * @{ 32 32 * 33 * The Qt-COM support layer provides a set of defin tions and smart classes for33 * The Qt-COM support layer provides a set of definitions and smart classes for 34 34 * writing simple, clean and platform-independent code to access COM/XPCOM 35 35 * components through exposed COM interfaces. This layer is based on the 36 * COM/XPCOM Abst arction Layer library (the VBoxCOM glue library defined in36 * COM/XPCOM Abstraction Layer library (the VBoxCOM glue library defined in 37 37 * include/VBox/com and implemented in src/VBox/Main/glue). 38 38 * … … 42 42 * @{ 43 43 * 44 * COM/XPCOM arrays are mapped to QV alueVector objects. QValueVector templates45 * declared with a type that corresponds to the COM type of elements in the46 * array using normal Qt-COM type mapping rules. Here is a code example that47 * demonstrates how to call interface methods that take and return arrays (this48 * example isbased on examples given in @ref grp_COM_arrays):44 * COM/XPCOM arrays are mapped to QVector objects. QVector templates declared 45 * with a type that corresponds to the COM type of elements in the array using 46 * normal Qt-COM type mapping rules. Here is a code example that demonstrates 47 * how to call interface methods that take and return arrays (this example is 48 * based on examples given in @ref grp_COM_arrays): 49 49 * @code 50 50 … … 53 53 // ... 54 54 55 QV alueVector <LONG> in (3);55 QVector <LONG> in (3); 56 56 in [0] = -1; 57 57 in [1] = -2; 58 58 in [2] = -3; 59 59 60 QV alueVector <LONG> out;61 QV alueVector <LONG> ret;60 QVector <LONG> out; 61 QVector <LONG> ret; 62 62 63 63 ret = component.TestArrays (in, out); … … 258 258 { 259 259 aArr.reset (aVec.size()); 260 size_t i = 0; 261 for (typename QVector <T>::const_iterator it = aVec.begin(); 262 it != aVec.end(); ++ it, ++ i) 263 aArr [i] = *it; 260 for (int i = 0; i < aVec.size(); ++i) 261 aArr [i] = aVec.at (i); 264 262 } 265 263 … … 267 265 static void FromSafeArray (const com::SafeArray <T> &aArr, QVector <T> &aVec) 268 266 { 269 aVec = QVector <T> (aArr.size()); 270 size_t i = 0; 271 for (typename QVector <T>::iterator it = aVec.begin(); 272 it != aVec.end(); ++ it, ++ i) 273 *it = aArr [i]; 267 aVec.resize (aArr.size()); 268 for (int i = 0; i < aVec.size(); ++i) 269 aVec [i] = aArr [i]; 274 270 } 275 271 … … 295 291 { 296 292 aArr.reset (aVec.size()); 297 size_t i = 0; 298 for (typename QVector <CI>::const_iterator it = aVec.begin(); 299 it != aVec.end(); ++ it, ++ i) 300 { 301 aArr [i] = (*it).iface(); 293 for (int i = 0; i < aVec.size(); ++i) 294 { 295 aArr [i] = aVec.at (i); 302 296 if (aArr [i]) 303 297 aArr [i]->AddRef(); … … 309 303 QVector <CI> &aVec) 310 304 { 311 aVec = QVector <CI> (aArr.size()); 312 size_t i = 0; 313 for (typename QVector <CI>::iterator it = aVec.begin(); 314 it != aVec.end(); ++ it, ++ i) 315 (*it).attach (aArr [i]); 305 aVec.resize (aArr.size()); 306 for (int i = 0; i < aVec.size(); ++i) 307 aVec [i].attach (aArr [i]); 316 308 } 317 309 … … 525 517 526 518 /** 527 * Returns @c true if the result code rep esents success (with or without519 * Returns @c true if the result code represents success (with or without 528 520 * warnings). 529 521 */ … … 531 523 532 524 /** 533 * Returns @c true if the result code represen ds success with one or more525 * Returns @c true if the result code represents success with one or more 534 526 * warnings. 535 527 */ … … 537 529 538 530 /** 539 * Returns @c true if the result code represen ds success with no warnings.531 * Returns @c true if the result code represents success with no warnings. 540 532 */ 541 533 bool isReallyOk() const { return mRC == S_OK; } … … 647 639 648 640 /** 649 * Returns @c true if the result code rep esents success (with or without641 * Returns @c true if the result code represents success (with or without 650 642 * warnings). 651 643 */ … … 653 645 654 646 /** 655 * Returns @c true if the result code represen ds success with one or more647 * Returns @c true if the result code represents success with one or more 656 648 * warnings. 657 649 */ … … 659 651 660 652 /** 661 * Returns @c true if the result code represen ds success with no warnings.653 * Returns @c true if the result code represents success with no warnings. 662 654 */ 663 655 bool isReallyOk() const { return !isNull() && B::mRC == S_OK; }
Note:
See TracChangeset
for help on using the changeset viewer.