Mercurial > hg > orthanc
comparison OrthancFramework/Resources/CheckOrthancFrameworkSymbols.py @ 4304:50b0c69b653a
continued abi
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 06 Nov 2020 16:33:52 +0100 |
parents | 44b53a2c0a13 |
children | 8992faf451fc |
comparison
equal
deleted
inserted
replaced
4303:44b53a2c0a13 | 4304:50b0c69b653a |
---|---|
143 | 143 |
144 ## | 144 ## |
145 ## Ignore pure abstract interfaces, by checking the following | 145 ## Ignore pure abstract interfaces, by checking the following |
146 ## criteria: | 146 ## criteria: |
147 ## - It must be a C++ class (not a struct) | 147 ## - It must be a C++ class (not a struct) |
148 ## - The class name must start with "I" | |
149 ## - All its methods must be pure virtual (abstract) and public | 148 ## - All its methods must be pure virtual (abstract) and public |
150 ## - Its destructor must be public, virtual, and must do nothing | 149 ## - Its destructor must be public, virtual, and must do nothing |
151 ## | 150 ## |
152 | 151 |
153 if (child.kind == clang.cindex.CursorKind.CLASS_DECL and | 152 if child.kind == clang.cindex.CursorKind.CLASS_DECL: |
154 fqn[-1].startswith('I')): | |
155 abstract = True | 153 abstract = True |
156 isPublic = False | 154 isPublic = False |
157 | 155 |
158 for i in child.get_children(): | 156 for i in child.get_children(): |
159 if i.kind == clang.cindex.CursorKind.VISIBILITY_ATTR: # "default" | 157 if i.kind == clang.cindex.CursorKind.VISIBILITY_ATTR: # "default" |
183 len(list(c[0].get_children())) != 0): | 181 len(list(c[0].get_children())) != 0): |
184 abstract = False | 182 abstract = False |
185 elif (i.kind == clang.cindex.CursorKind.CLASS_DECL or | 183 elif (i.kind == clang.cindex.CursorKind.CLASS_DECL or |
186 i.kind == clang.cindex.CursorKind.STRUCT_DECL): | 184 i.kind == clang.cindex.CursorKind.STRUCT_DECL): |
187 ExploreClass(i, fqn + [ i.spelling ]) | 185 ExploreClass(i, fqn + [ i.spelling ]) |
186 elif (i.kind == clang.cindex.CursorKind.TYPEDEF_DECL or # Allow "typedef" | |
187 i.kind == clang.cindex.CursorKind.ENUM_DECL): # Allow enums | |
188 pass | |
188 else: | 189 else: |
189 abstract = False | 190 abstract = False |
190 | 191 |
191 if abstract: | 192 if abstract: |
192 print('Detected a pure interface (this is fine): %s' % ('::'.join(fqn))) | 193 print('Detected a pure interface (this is fine): %s' % ('::'.join(fqn))) |