diff OrthancServer/Sources/ServerEnumerations.cpp @ 5829:963945d780d6 find-refactoring tip

tools/find ResponseContent
author Alain Mazy <am@orthanc.team>
date Mon, 07 Oct 2024 18:10:08 +0200
parents 3765085693e5
children
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerEnumerations.cpp	Mon Oct 07 15:19:26 2024 +0200
+++ b/OrthancServer/Sources/ServerEnumerations.cpp	Mon Oct 07 18:10:08 2024 +0200
@@ -616,4 +616,45 @@
         throw OrthancException(ErrorCode_ParameterOutOfRange);
     }
   }
-}
+
+  ResponseContentFlags StringToResponseContent(const std::string& value)
+  {
+    if (value == "MainDicomTags")
+    {
+      return ResponseContentFlags_MainDicomTags;
+    }
+    else if (value == "Metadata")
+    {
+      return ResponseContentFlags_Metadata;
+    }
+    else if (value == "Status")
+    {
+      return ResponseContentFlags_Status;
+    }
+    else if (value == "Parent")
+    {
+      return ResponseContentFlags_Parent;
+    }
+    else if (value == "Children")
+    {
+      return ResponseContentFlags_Children;
+    }
+    else if (value == "Labels")
+    {
+      return ResponseContentFlags_Labels;
+    }
+    else if (value == "Attachments")
+    {
+      return ResponseContentFlags_Attachments;
+    }
+    else if (value == "IsStable")
+    {
+      return ResponseContentFlags_IsStable;
+    }
+    else
+    {
+      throw OrthancException(ErrorCode_ParameterOutOfRange,
+                             "Unrecognized value for \"ResponseContent\": " + value);
+    }    
+  }
+}
\ No newline at end of file