Peter Djalaliev wrote:
Hello,
This is quite general question.
I have a method, which is passed as an argument a nsIInputStream
pointer (e.g. SetUploadStream() in Netlib's nsHttpChannel.cpp). Is
there any way for me to find out what other interfaces this object
implements (e.g. nsIFileInputStream, nsIBufferedInputStream, etc.)
without having to call do_QueryInterface for each interface that I
think this object might implement?
For example, if the object implements an interface that I don't know
about, is there a way for me to find out which one?
I am looking for something of the sort of being able to "ask" the
object "What is the list of all interfaces you implement?" rather than
asking it "Do you implement this interface?" multiple times, for each
interface separately.
Some objects implement nsIClassInfo, and some of these objects implement the
nsIClassInfo.getInterfaces method, which allows you to query the interfaces
an object implements. But only some objects implement this method.
See
http://benjamin.smedbergs.us/blog/2006-02-18/xpcom-detecting-reference-cycles-or-switching-to-gc/#comment-5740
for some additional info on classinfo, which doesn't quite follow normal
XPCOM rules.
--BDS
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom