diff OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp @ 5249:f22c8fac764b db-protobuf

added "/tools/labels" to list all the labels that are associated with any resource
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 07 Apr 2023 22:54:57 +0200
parents a7d95f951f8a
children 261ce0ed85e6
line wrap: on
line diff
--- a/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp	Fri Apr 07 22:18:37 2023 +0200
+++ b/OrthancServer/Sources/Database/SQLiteDatabaseWrapper.cpp	Fri Apr 07 22:54:57 2023 +0200
@@ -1123,6 +1123,20 @@
         target.insert(s.ColumnString(0));
       }
     }
+
+
+    virtual void ListAllLabels(std::set<std::string>& target) ORTHANC_OVERRIDE
+    {
+      target.clear();
+
+      SQLite::Statement s(db_, SQLITE_FROM_HERE, 
+                          "SELECT DISTINCT label FROM Labels");
+
+      while (s.Step())
+      {
+        target.insert(s.ColumnString(0));
+      }
+    }
   };