]> git.cworth.org Git - apitrace/blobdiff - specs/stdapi.py
Add API::getAllInterfaces helper method.
[apitrace] / specs / stdapi.py
index a1b382f7d3b3d91d58d6066342754af6b20399f3..61e2b21b756e2f241f2d8a7b130e07f18fbce58c 100644 (file)
@@ -661,6 +661,14 @@ class API:
                 collector.visit(method.type)
         return collector.types
 
+    def getAllInterfaces(self):
+        types = self.getAllTypes()
+        interfaces = [type for type in types if isinstance(type, Interface)]
+        for interface in self.interfaces:
+            if interface not in interfaces:
+                interfaces.append(interface)
+        return interfaces
+
     def addFunction(self, function):
         self.functions.append(function)