Changeset 10709 in vbox
- Timestamp:
- Jul 16, 2008 7:23:38 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/com/array.h
r10151 r10709 153 153 * supported and therefore cannot be used as element types. 154 154 * 155 * In order to pass input BSTR array parameters delcared using the 156 * ComSafeArrayIn (INPTR BSTR, aParam) macro to the SafeArray<> constructor 157 * using the ComSafeArrayInArg() macro, you should use INPTR BSTR as the 158 * SafeArray<> template argument, not just BSTR. 159 * 155 160 * Arrays of interface pointers are also supported but they require to use a 156 161 * special SafeArray implementation, com::SafeIfacePointer, which takes the … … 265 270 return const_cast <const PRUnichar **> (aArr); 266 271 } 272 static const PRUnichar **__asInParam_Arr (const PRUnichar **aArr) { return aArr; } 273 }; 274 275 template<> 276 struct SafeArrayTraits <const PRUnichar *> 277 { 278 protected: 279 280 static void Init (const PRUnichar * &aElem) { aElem = NULL; } 281 static void Uninit (const PRUnichar * &aElem) 282 { 283 if (aElem) 284 { 285 ::SysFreeString (const_cast <PRUnichar *> (aElem)); 286 aElem = NULL; 287 } 288 } 289 290 static void Copy (const PRUnichar * aFrom, const PRUnichar * &aTo) 291 { 292 AssertCompile (sizeof (PRUnichar) == sizeof (OLECHAR)); 293 aTo = aFrom ? ::SysAllocString ((const OLECHAR *) aFrom) : NULL; 294 } 295 296 public: 297 298 /* Magic to workaround strict rules of par. 4.4.4 of the C++ standard */ 267 299 static const PRUnichar **__asInParam_Arr (const PRUnichar **aArr) { return aArr; } 268 300 };
Note:
See TracChangeset
for help on using the changeset viewer.