diff Core/Toolbox.cpp @ 473:c9a5d72f8481

changing the namespace of HTTP enumerations
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 15 Jul 2013 17:22:13 +0200
parents 30086c1aca30
children a9693dc7089c
line wrap: on
line diff
--- a/Core/Toolbox.cpp	Mon Jul 15 13:50:36 2013 +0200
+++ b/Core/Toolbox.cpp	Mon Jul 15 17:22:13 2013 +0200
@@ -132,9 +132,9 @@
 #if defined(_WIN32)
   static BOOL WINAPI ConsoleControlHandler(DWORD dwCtrlType)
   {
-	// http://msdn.microsoft.com/en-us/library/ms683242(v=vs.85).aspx
-	finish = true;
-	return true;
+    // http://msdn.microsoft.com/en-us/library/ms683242(v=vs.85).aspx
+    finish = true;
+    return true;
   }
 #else
   static void SignalHandler(int)
@@ -169,7 +169,7 @@
   void Toolbox::ServerBarrier()
   {
 #if defined(_WIN32)
-	SetConsoleCtrlHandler(ConsoleControlHandler, true);
+    SetConsoleCtrlHandler(ConsoleControlHandler, true);
 #else
     signal(SIGINT, SignalHandler);
     signal(SIGQUIT, SignalHandler);
@@ -182,7 +182,7 @@
     }
 
 #if defined(_WIN32)
-	SetConsoleCtrlHandler(ConsoleControlHandler, false);
+    SetConsoleCtrlHandler(ConsoleControlHandler, false);
 #else
     signal(SIGINT, NULL);
     signal(SIGQUIT, NULL);
@@ -697,4 +697,26 @@
         throw OrthancException(ErrorCode_NotImplemented);
     }
   }
+
+
+  const char* Toolbox::ToString(HttpMethod method)
+  {
+    switch (method)
+    {
+      case HttpMethod_Get:
+        return "GET";
+
+      case HttpMethod_Post:
+        return "POST";
+
+      case HttpMethod_Delete:
+        return "DELETE";
+
+      case HttpMethod_Put:
+        return "PUT";
+
+      default:
+        return "?";
+    }
+  }
 }