diff OrthancServer/Sources/Search/DatabaseLookup.h @ 5248:a7d95f951f8a db-protobuf

replaced "WithLabels" and "WithoutLabels", by "Labels" and "LabelsConstraint"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 07 Apr 2023 22:18:37 +0200
parents df39c7583a49
children 48b8dae6dc77
line wrap: on
line diff
--- a/OrthancServer/Sources/Search/DatabaseLookup.h	Fri Apr 07 15:44:12 2023 +0200
+++ b/OrthancServer/Sources/Search/DatabaseLookup.h	Fri Apr 07 22:18:37 2023 +0200
@@ -22,6 +22,7 @@
 
 #pragma once
 
+#include "../Search/ISqlLookupFormatter.h"
 #include "DicomTagConstraint.h"
 
 class DcmItem;
@@ -32,8 +33,8 @@
   {
   private:
     std::vector<DicomTagConstraint*>  constraints_;
-    std::set<std::string>             withLabels_;
-    std::set<std::string>             withoutLabels_;
+    std::set<std::string>             labels_;
+    LabelsConstraint                  labelsConstraint_;
 
     void AddDicomConstraintInternal(const DicomTag& tag,
                                     ValueRepresentation vr,
@@ -44,7 +45,8 @@
     void AddConstraintInternal(DicomTagConstraint* constraint);  // Takes ownership
 
   public:
-    DatabaseLookup()
+    DatabaseLookup() :
+      labelsConstraint_(LabelsConstraint_All)
     {
     }
 
@@ -95,18 +97,21 @@
 
     void RemoveConstraint(const DicomTag& tag);
 
-    void AddWithLabel(const std::string& label);
-
-    void AddWithoutLabel(const std::string& label);
+    void AddLabel(const std::string& label);
 
-    const std::set<std::string>& GetWithLabels() const
+    void SetLabelsConstraint(LabelsConstraint constraint)
     {
-      return withLabels_;
+      labelsConstraint_ = constraint;
     }
 
-    const std::set<std::string>& GetWithoutLabels() const
+    const std::set<std::string>& GetLabels() const
     {
-      return withoutLabels_;
+      return labels_;
+    }
+
+    LabelsConstraint GetLabelsConstraint() const
+    {
+      return labelsConstraint_;
     }
   };
 }