Mercurial > hg > orthanc-java
changeset 67:2e2363ba431b
print functions that are not wrapped yet
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 20 Aug 2025 15:58:07 +0200 |
parents | b87ce7874ddc |
children | 65c86e666eda |
files | CodeGeneration/CodeModel.py CodeGeneration/CppCodeGeneration.py CodeGeneration/CustomFunctions.json CodeGeneration/CustomMethods.json |
diffstat | 4 files changed, 31 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/CodeGeneration/CodeModel.py Wed Aug 20 14:27:24 2025 +0200 +++ b/CodeGeneration/CodeModel.py Wed Aug 20 15:58:07 2025 +0200 @@ -420,6 +420,7 @@ 'since_sdk' : since_sdk, 'is_custom' : is_custom, 'return_sdk_type' : f['return_sdk_type'], + 'sdk_functions' : f.get('sdk_functions', []), } if 'documentation' in f:
--- a/CodeGeneration/CppCodeGeneration.py Wed Aug 20 14:27:24 2025 +0200 +++ b/CodeGeneration/CppCodeGeneration.py Wed Aug 20 15:58:07 2025 +0200 @@ -73,6 +73,34 @@ customFunctionsPath = args.custom_functions, customMethodsPath = args.custom_methods) + +def RemoveKey(dic, key): + if key in dic: + dic.remove(key) + +unwrappedFunctions = model.get('unwrapped_functions') + +# List of the functions that are manually implemented in the C++ code +# (check out "env.RegisterNatives()" in "Plugin.cpp") +for sdk in [ + 'OrthancPluginRegisterRestCallback', + 'OrthancPluginRegisterRestCallbackNoLock', + 'OrthancPluginRegisterOnChangeCallback', +]: + RemoveKey(unwrappedFunctions, sdk) + + +for f in model['native_functions']: + if f['is_custom']: + for sdk in f['sdk_functions']: + RemoveKey(unwrappedFunctions, sdk) + +print('\nFunctions in the latest Orthanc SDK that are not wrapped yet:') +for f in unwrappedFunctions: + print('- %s()' % f) +print('') + + with open(os.path.join(ROOT, 'CppNativeSDK.mustache'), 'r') as f: template = f.read()
--- a/CodeGeneration/CustomFunctions.json Wed Aug 20 14:27:24 2025 +0200 +++ b/CodeGeneration/CustomFunctions.json Wed Aug 20 15:58:07 2025 +0200 @@ -1,6 +1,7 @@ [ { "c_function" : "OrthancPluginCustom_GetQueueSize", + "sdk_functions" : [ "OrthancPluginGetQueueSize" ], "documentation" : { "description" : [ "Get the number of elements in a queue." ], "args" : {
--- a/CodeGeneration/CustomMethods.json Wed Aug 20 14:27:24 2025 +0200 +++ b/CodeGeneration/CustomMethods.json Wed Aug 20 15:58:07 2025 +0200 @@ -3,6 +3,7 @@ { "short_name" : "next", "c_function" : "OrthancPluginCustom_KeysValuesIteratorNext", + "sdk_functions" : [ "OrthancPluginKeysValuesIteratorNext" ], "documentation" : { "description" : [ "Advance to the next element in the iterator." ], "return" : "Whether the iterator is done."