!import
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
enumerateInterfaces
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
1 function enumerateInterfaces(obj)
2 {
3 var interfaces = new Array();
4 for (i in Components.interfaces)
5 {
6 try
7 {
8 obj.QueryInterface(Components.interfaces[i]);
9 interfaces.push(i);
10 }
11 catch(e) {}
12 }
13 return interfaces;
14 }
15
enumerateProperties
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
16 function enumerateProperties(obj, excludeComplexTypes)
17 {
18 var properties = "";
19 for (p in obj)
20 {
21 try
22 {
23 if (excludeComplexTypes
24 && (typeof obj[p] == 'object' || typeof obj[p] == 'function')) next;
25 properties += p + " = " + obj[p] + "\n";
26 }
27 catch(e) {
28 properties += p + " = " + e + "\n";
29 }
30 }
31 return properties;
32 }
33
34 // minimal implementation of nsIOutputStream for use by dumpRDF, adapted from
35 // http://groups.google.com/groups?selm=20011203111618.C1302%40erde.jan.netgaroo.de
36 var DumpOutputStream = {
write
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
37 write: function(buf, count) { dump(buf); return count; }
38 };
39
dumpRDF
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
40 function dumpRDF( aDS ) {
41 var serializer = Components.classes["@mozilla.org/rdf/xml-serializer;1"]
42 .createInstance( Components.interfaces.nsIRDFXMLSerializer );
43
44 serializer.init( aDS );
45
46 serializer.QueryInterface( Components.interfaces.nsIRDFXMLSource )
47 .Serialize( DumpOutputStream );
48 }