changeset 4349:85237ae3a076

relax CheckOrthancFrameworkSymbols.py about one friend stream function
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sun, 06 Dec 2020 12:47:54 +0100
parents 93c281752e7a
children e457c30970cf
files OrthancFramework/Resources/CheckOrthancFrameworkSymbols.py OrthancFramework/Sources/DicomFormat/DicomTag.h
diffstat 2 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancFramework/Resources/CheckOrthancFrameworkSymbols.py	Sun Dec 06 12:21:31 2020 +0100
+++ b/OrthancFramework/Resources/CheckOrthancFrameworkSymbols.py	Sun Dec 06 12:47:54 2020 +0100
@@ -251,6 +251,16 @@
         elif (i.kind == clang.cindex.CursorKind.TYPEDEF_DECL or  # Allow "typedef"
               i.kind == clang.cindex.CursorKind.ENUM_DECL):      # Allow enums
             pass
+
+        elif i.kind == clang.cindex.CursorKind.FRIEND_DECL:
+            children = list(i.get_children())
+            if (isPublic and
+                (len(children) != 1 or
+                 not children[0].displayname in [
+                     # This is supported for ABI compatibility with Orthanc <= 1.8.0
+                     'operator<<(std::ostream &, const Orthanc::DicomTag &)',
+                 ])):
+                raise Exception('Unsupported: %s, %s' % (i.kind, i.location))
             
         else:
             if isPublic:
--- a/OrthancFramework/Sources/DicomFormat/DicomTag.h	Sun Dec 06 12:21:31 2020 +0100
+++ b/OrthancFramework/Sources/DicomFormat/DicomTag.h	Sun Dec 06 12:47:54 2020 +0100
@@ -26,6 +26,7 @@
 #include <set>
 #include <stdint.h>
 
+#include "../Compatibility.h"
 #include "../Enumerations.h"
 
 namespace Orthanc
@@ -73,7 +74,7 @@
                                  DicomModule module);
 
 #if ORTHANC_BUILDING_FRAMEWORK_LIBRARY == 1
-    ORTHANC_PUBLIC friend std::ostream& operator<< (std::ostream& o, const DicomTag& tag);
+    ORTHANC_PUBLIC friend std::ostream& operator<< (std::ostream& o, const DicomTag& tag) ORTHANC_DEPRECATED;
 #endif
   };