On 10/21/2012 12:31 PM, Neil wrote:
While reviewing a patch that had to call into login manager from C++ I
noticed that we don't have an RAII class for handling the array
outparam. Would one be appreciated? I have written something that I
call nsXPIDLArray, which so far has the following features:
* Most of the work handled by a generic base class
* Able to assign and swap arrays
* Able to adopt a returned XPIDL array outparam
* Able to write to a return XPIDL array outparam
* Able to pass as an XPIDL array inparam
* Able to copy an XPIDL array inparam parameter
* Able to create an nsISimpleEnumerator
* Mundane stuff, i.e.
o safe and unsafe indexing
o get index of object
o enumerate forwards and backwards
o sorting
o inserting single object and other arrays
o replacing objects
o appending single objects and other arrays
o removing objects
+1, I hate how annoying array outparams (and inparams) are in C++.
That said, I think interfacing with nsTArray (or nsTArray<nsCOMPtr<T>>
for refcounted outparams) would be a plus...
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform