changeset 55:064f60ba180e

added "since_sdk" in the code model
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 09 Aug 2025 10:12:46 +0200
parents d8a4ecf81642
children 2059b5216851
files CodeGeneration/ParseOrthancSDK.py NEWS
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/CodeGeneration/ParseOrthancSDK.py	Wed Jun 25 15:58:19 2025 +0200
+++ b/CodeGeneration/ParseOrthancSDK.py	Sat Aug 09 10:12:46 2025 +0200
@@ -444,6 +444,17 @@
             countAllFunctions += 1
             continue
 
+        since_sdk = None
+        for annotate in filter(lambda x: x.kind == clang.cindex.CursorKind.ANNOTATE_ATTR,
+                               node.get_children()):
+            s = annotate.spelling.split(' ')
+            if s[0] == 'ORTHANC_PLUGIN_SINCE_SDK':
+                assert(len(s) == 2)
+                version = s[1].split('.')
+                assert(len(version) == 3)
+                assert(since_sdk == None)
+                since_sdk = [ int(version[0]), int(version[1]), int(version[2]) ]
+
         args = list(filter(lambda x: x.kind == clang.cindex.CursorKind.PARM_DECL,
                            node.get_children()))
 
@@ -496,6 +507,7 @@
                     'c_function' : node.spelling,
                     'const' : args[0].type.get_pointee().is_const_qualified(),
                     'documentation' : doc,
+                    'since_sdk' : since_sdk,
                     }
 
                 if not EncodeArguments(method, args[1:]):
@@ -518,6 +530,7 @@
             f = {
                 'c_function' : node.spelling,
                 'documentation' : doc,
+                'since_sdk' : since_sdk,
             }
 
             if not EncodeArguments(f, args):
--- a/NEWS	Wed Jun 25 15:58:19 2025 +0200
+++ b/NEWS	Sat Aug 09 10:12:46 2025 +0200
@@ -1,6 +1,9 @@
 Pending changes in the mainline
 ===============================
 
+* Added the "since_sdk" information for functions in the code model,
+  as derived from the ORTHANC_PLUGIN_SINCE_SDK macro in SDK >= 1.12.9
+
 
 Version 1.0 (2024-06-14)
 ========================