diff OrthancServer/Sources/ServerEnumerations.cpp @ 5061:e95fadefeb72

new MaximumStorageMode configuration
author Alain Mazy <am@osimis.io>
date Tue, 09 Aug 2022 17:57:38 +0200
parents d4e5ca0c9307
children 849000df79b6
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerEnumerations.cpp	Mon Aug 08 12:42:48 2022 +0200
+++ b/OrthancServer/Sources/ServerEnumerations.cpp	Tue Aug 09 17:57:38 2022 +0200
@@ -218,6 +218,24 @@
     return mode == FindStorageAccessMode_DiskOnLookupAndAnswer;
   }
 
+  MaxStorageMode StringToMaxStorageMode(const std::string& value)
+  {
+    if (value == "Recycle")
+    {
+      return MaxStorageMode_Recycle;
+    }
+    else if (value == "Reject")
+    {
+      return MaxStorageMode_Reject;
+    }
+    else
+    {
+      throw OrthancException(ErrorCode_ParameterOutOfRange,
+                             "Configuration option \"MaxStorageMode\" "
+                             "should be \"Recycle\" or \"Reject\": " + value);
+    }    
+  }
+
   BuiltinDecoderTranscoderOrder StringToBuiltinDecoderTranscoderOrder(const std::string& value)
   {
     if (value == "Before")