changeset 43:9be852ad33d2

rename for c
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 Sep 2012 09:59:34 +0200
parents ea48f38afe5f
children 4d25b1b5d192 33d67e1ab173
files Core/HttpServer/EmbeddedResourceHttpHandler.cpp Core/HttpServer/FilesystemHttpHandler.cpp Core/HttpServer/HttpOutput.cpp Core/HttpServer/HttpOutput.h Core/HttpServer/MongooseServer.cpp PalantirCppClient/HttpClient.cpp PalantirCppClient/HttpClient.h PalantirCppClient/HttpEnumerations.h PalantirCppClient/HttpException.cpp PalantirCppClient/HttpException.h PalantirServer/PalantirRestApi.cpp
diffstat 11 files changed, 170 insertions(+), 166 deletions(-) [+]
line wrap: on
line diff
--- a/Core/HttpServer/EmbeddedResourceHttpHandler.cpp	Mon Sep 03 11:34:00 2012 +0200
+++ b/Core/HttpServer/EmbeddedResourceHttpHandler.cpp	Tue Sep 04 09:59:34 2012 +0200
@@ -67,7 +67,7 @@
     }
     catch (PalantirException& e)
     {
-      output.SendHeader(HttpStatus_404_NotFound);
+      output.SendHeader(Palantir_HttpStatus_404_NotFound);
     }
   } 
 }
--- a/Core/HttpServer/FilesystemHttpHandler.cpp	Mon Sep 03 11:34:00 2012 +0200
+++ b/Core/HttpServer/FilesystemHttpHandler.cpp	Tue Sep 04 09:59:34 2012 +0200
@@ -136,7 +136,7 @@
     }
     else
     {
-      output.SendHeader(HttpStatus_404_NotFound);
+      output.SendHeader(Palantir_HttpStatus_404_NotFound);
     }
   } 
 }
--- a/Core/HttpServer/HttpOutput.cpp	Mon Sep 03 11:34:00 2012 +0200
+++ b/Core/HttpServer/HttpOutput.cpp	Tue Sep 04 09:59:34 2012 +0200
@@ -82,17 +82,17 @@
   void HttpOutput::SendMethodNotAllowedError(const std::string& allowed)
   {
     std::string s = 
-      "HTTP/1.1 405 " + std::string(HttpException::GetDescription(HttpStatus_405_MethodNotAllowed)) +
+      "HTTP/1.1 405 " + std::string(HttpException::GetDescription(Palantir_HttpStatus_405_MethodNotAllowed)) +
       "\r\nAllow: " + allowed + 
       "\r\n\r\n";
     Send(&s[0], s.size());
   }
 
 
-  void HttpOutput::SendHeader(HttpStatus status)
+  void HttpOutput::SendHeader(Palantir_HttpStatus status)
   {
-    if (status == HttpStatus_200_Ok ||
-        status == HttpStatus_405_MethodNotAllowed)
+    if (status == Palantir_HttpStatus_200_Ok ||
+        status == Palantir_HttpStatus_405_MethodNotAllowed)
     {
       throw PalantirException("Please use the dedicated methods to this HTTP status code in HttpOutput");
     }
@@ -101,7 +101,7 @@
   }
 
 
-  void HttpOutput::SendHeaderInternal(HttpStatus status)
+  void HttpOutput::SendHeaderInternal(Palantir_HttpStatus status)
   {
     std::string s = "HTTP/1.1 " + 
       boost::lexical_cast<std::string>(status) +
@@ -136,7 +136,7 @@
     FILE* fp = fopen(path.c_str(), "rb");
     if (!fp)
     {
-      SendHeaderInternal(HttpStatus_500_InternalServerError);
+      SendHeaderInternal(Palantir_HttpStatus_500_InternalServerError);
       return;
     }
   
@@ -180,7 +180,7 @@
   void HttpOutput::Redirect(const std::string& path)
   {
     std::string s = 
-      "HTTP/1.1 301 " + std::string(HttpException::GetDescription(HttpStatus_301_MovedPermanently)) + 
+      "HTTP/1.1 301 " + std::string(HttpException::GetDescription(Palantir_HttpStatus_301_MovedPermanently)) + 
       "\r\nLocation: " + path +
       "\r\n\r\n";
     Send(&s[0], s.size());  
--- a/Core/HttpServer/HttpOutput.h	Mon Sep 03 11:34:00 2012 +0200
+++ b/Core/HttpServer/HttpOutput.h	Tue Sep 04 09:59:34 2012 +0200
@@ -30,7 +30,7 @@
   class HttpOutput
   {
   private:
-    void SendHeaderInternal(HttpStatus status);
+    void SendHeaderInternal(Palantir_HttpStatus status);
 
     void SendOkHeader(const char* contentType,
                       bool hasContentLength,
@@ -56,7 +56,7 @@
 
     void SendMethodNotAllowedError(const std::string& allowed);
 
-    void SendHeader(HttpStatus status);
+    void SendHeader(Palantir_HttpStatus status);
 
 
     // Higher-level constructs to send entire files or buffers -------------------
--- a/Core/HttpServer/MongooseServer.cpp	Mon Sep 03 11:34:00 2012 +0200
+++ b/Core/HttpServer/MongooseServer.cpp	Tue Sep 04 09:59:34 2012 +0200
@@ -481,7 +481,7 @@
         HttpHandler::Arguments::const_iterator ct = headers.find("content-type");
         if (ct == headers.end())
         {
-          output.SendHeader(HttpStatus_400_BadRequest);
+          output.SendHeader(Palantir_HttpStatus_400_BadRequest);
           return (void*) "";
         }
 
@@ -501,11 +501,11 @@
         switch (status)
         {
         case PostDataStatus_NoLength:
-          output.SendHeader(HttpStatus_411_LengthRequired);
+          output.SendHeader(Palantir_HttpStatus_411_LengthRequired);
           return (void*) "";
 
         case PostDataStatus_Failure:
-          output.SendHeader(HttpStatus_400_BadRequest);
+          output.SendHeader(Palantir_HttpStatus_400_BadRequest);
           return (void*) "";
 
         case PostDataStatus_Pending:
@@ -531,12 +531,12 @@
         catch (PalantirException& e)
         {
           std::cerr << "MongooseServer Exception [" << e.What() << "]" << std::endl;
-          output.SendHeader(HttpStatus_500_InternalServerError);        
+          output.SendHeader(Palantir_HttpStatus_500_InternalServerError);        
         }
       }
       else
       {
-        output.SendHeader(HttpStatus_404_NotFound);
+        output.SendHeader(Palantir_HttpStatus_404_NotFound);
       }
 
       // Mark as processed
--- a/PalantirCppClient/HttpClient.cpp	Mon Sep 03 11:34:00 2012 +0200
+++ b/PalantirCppClient/HttpClient.cpp	Tue Sep 04 09:59:34 2012 +0200
@@ -93,8 +93,8 @@
 #endif
 
     url_ = "";
-    method_ = HttpMethod_Get;
-    lastStatus_ = HttpStatus_200_Ok;
+    method_ = Palantir_HttpMethod_Get;
+    lastStatus_ = Palantir_HttpStatus_200_Ok;
     isVerbose_ = false;
   }
 
@@ -130,11 +130,11 @@
 
     switch (method_)
     {
-    case HttpMethod_Get:
+    case Palantir_HttpMethod_Get:
       CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_HTTPGET, 1L));
       break;
 
-    case HttpMethod_Post:
+    case Palantir_HttpMethod_Post:
       CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_POST, 1L));
       CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_HTTPHEADER, pimpl_->postHeaders_));
 
@@ -151,12 +151,12 @@
 
       break;
 
-    case HttpMethod_Delete:
+    case Palantir_HttpMethod_Delete:
       CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_NOBODY, 1L));
       CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_CUSTOMREQUEST, "DELETE"));
       break;
 
-    case HttpMethod_Put:
+    case Palantir_HttpMethod_Put:
       CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_PUT, 1L));
       break;
 
@@ -173,11 +173,11 @@
     if (status == 0)
     {
       // This corresponds to a call to an inexistent host
-      lastStatus_ = HttpStatus_500_InternalServerError;
+      lastStatus_ = Palantir_HttpStatus_500_InternalServerError;
     }
     else
     {
-      lastStatus_ = static_cast<HttpStatus>(status);
+      lastStatus_ = static_cast<Palantir_HttpStatus>(status);
     }
 
     return (status >= 200 && status < 300);
--- a/PalantirCppClient/HttpClient.h	Mon Sep 03 11:34:00 2012 +0200
+++ b/PalantirCppClient/HttpClient.h	Tue Sep 04 09:59:34 2012 +0200
@@ -43,8 +43,8 @@
     boost::shared_ptr<PImpl> pimpl_;
 
     std::string url_;
-    HttpMethod method_;
-    HttpStatus lastStatus_;
+    Palantir_HttpMethod method_;
+    Palantir_HttpStatus lastStatus_;
     std::string postData_;
     bool isVerbose_;
 
@@ -68,12 +68,12 @@
       return url_;
     }
 
-    void SetMethod(HttpMethod method)
+    void SetMethod(Palantir_HttpMethod method)
     {
       method_ = method;
     }
 
-    HttpMethod GetMethod() const
+    Palantir_HttpMethod GetMethod() const
     {
       return method_;
     }
@@ -99,7 +99,7 @@
 
     bool Apply(Json::Value& answer);
 
-    HttpStatus GetLastStatus() const
+    Palantir_HttpStatus GetLastStatus() const
     {
       return lastStatus_;
     }
--- a/PalantirCppClient/HttpEnumerations.h	Mon Sep 03 11:34:00 2012 +0200
+++ b/PalantirCppClient/HttpEnumerations.h	Tue Sep 04 09:59:34 2012 +0200
@@ -27,83 +27,87 @@
 
 #pragma once
 
-namespace Palantir
+
+/**
+ * This file contains the enumerations for the access to the Palantir
+ * REST API in C and C++. Namespaces are not used, in order to enable
+ * the access in C.
+ **/
+
+// Most common, non-joke and non-experimental HTTP status codes
+// http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
+enum Palantir_HttpStatus
 {
-  // Most common, non-joke and non-experimental HTTP status codes
-  // http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
-  enum HttpStatus
-  {
-    HttpStatus_None = -1,
-
-    // 1xx Informational
-    HttpStatus_100_Continue = 100,
-    HttpStatus_101_SwitchingProtocols = 101,
-    HttpStatus_102_Processing = 102,
+  Palantir_HttpStatus_None = -1,
 
-    // 2xx Success
-    HttpStatus_200_Ok = 200,
-    HttpStatus_201_Created = 201,
-    HttpStatus_202_Accepted = 202,
-    HttpStatus_203_NonAuthoritativeInformation = 203,
-    HttpStatus_204_NoContent = 204,
-    HttpStatus_205_ResetContent = 205,
-    HttpStatus_206_PartialContent = 206,
-    HttpStatus_207_MultiStatus = 207,
-    HttpStatus_208_AlreadyReported = 208,
-    HttpStatus_226_IMUsed = 226,
+  // 1xx Informational
+  Palantir_HttpStatus_100_Continue = 100,
+  Palantir_HttpStatus_101_SwitchingProtocols = 101,
+  Palantir_HttpStatus_102_Processing = 102,
 
-    // 3xx Redirection
-    HttpStatus_300_MultipleChoices = 300,
-    HttpStatus_301_MovedPermanently = 301,
-    HttpStatus_302_Found = 302,
-    HttpStatus_303_SeeOther = 303,
-    HttpStatus_304_NotModified = 304,
-    HttpStatus_305_UseProxy = 305,
-    HttpStatus_307_TemporaryRedirect = 307,
+  // 2xx Success
+  Palantir_HttpStatus_200_Ok = 200,
+  Palantir_HttpStatus_201_Created = 201,
+  Palantir_HttpStatus_202_Accepted = 202,
+  Palantir_HttpStatus_203_NonAuthoritativeInformation = 203,
+  Palantir_HttpStatus_204_NoContent = 204,
+  Palantir_HttpStatus_205_ResetContent = 205,
+  Palantir_HttpStatus_206_PartialContent = 206,
+  Palantir_HttpStatus_207_MultiStatus = 207,
+  Palantir_HttpStatus_208_AlreadyReported = 208,
+  Palantir_HttpStatus_226_IMUsed = 226,
 
-    // 4xx Client Error
-    HttpStatus_400_BadRequest = 400,
-    HttpStatus_401_Unauthorized = 401,
-    HttpStatus_402_PaymentRequired = 402,
-    HttpStatus_403_Forbidden = 403,
-    HttpStatus_404_NotFound = 404,
-    HttpStatus_405_MethodNotAllowed = 405,
-    HttpStatus_406_NotAcceptable = 406,
-    HttpStatus_407_ProxyAuthenticationRequired = 407,
-    HttpStatus_408_RequestTimeout = 408,
-    HttpStatus_409_Conflict = 409,
-    HttpStatus_410_Gone = 410,
-    HttpStatus_411_LengthRequired = 411,
-    HttpStatus_412_PreconditionFailed = 412,
-    HttpStatus_413_RequestEntityTooLarge = 413,
-    HttpStatus_414_RequestUriTooLong = 414,
-    HttpStatus_415_UnsupportedMediaType = 415,
-    HttpStatus_416_RequestedRangeNotSatisfiable = 416,
-    HttpStatus_417_ExpectationFailed = 417,
-    HttpStatus_422_UnprocessableEntity = 422,
-    HttpStatus_423_Locked = 423,
-    HttpStatus_424_FailedDependency = 424,
-    HttpStatus_426_UpgradeRequired = 426,
+  // 3xx Redirection
+  Palantir_HttpStatus_300_MultipleChoices = 300,
+  Palantir_HttpStatus_301_MovedPermanently = 301,
+  Palantir_HttpStatus_302_Found = 302,
+  Palantir_HttpStatus_303_SeeOther = 303,
+  Palantir_HttpStatus_304_NotModified = 304,
+  Palantir_HttpStatus_305_UseProxy = 305,
+  Palantir_HttpStatus_307_TemporaryRedirect = 307,
 
-    // 5xx Server Error
-    HttpStatus_500_InternalServerError = 500,
-    HttpStatus_501_NotImplemented = 501,
-    HttpStatus_502_BadGateway = 502,
-    HttpStatus_503_ServiceUnavailable = 503,
-    HttpStatus_504_GatewayTimeout = 504,
-    HttpStatus_505_HttpVersionNotSupported = 505,
-    HttpStatus_506_VariantAlsoNegotiates = 506,
-    HttpStatus_507_InsufficientStorage = 507,
-    HttpStatus_509_BandwidthLimitExceeded = 509,
-    HttpStatus_510_NotExtended = 510
-  };
+  // 4xx Client Error
+  Palantir_HttpStatus_400_BadRequest = 400,
+  Palantir_HttpStatus_401_Unauthorized = 401,
+  Palantir_HttpStatus_402_PaymentRequired = 402,
+  Palantir_HttpStatus_403_Forbidden = 403,
+  Palantir_HttpStatus_404_NotFound = 404,
+  Palantir_HttpStatus_405_MethodNotAllowed = 405,
+  Palantir_HttpStatus_406_NotAcceptable = 406,
+  Palantir_HttpStatus_407_ProxyAuthenticationRequired = 407,
+  Palantir_HttpStatus_408_RequestTimeout = 408,
+  Palantir_HttpStatus_409_Conflict = 409,
+  Palantir_HttpStatus_410_Gone = 410,
+  Palantir_HttpStatus_411_LengthRequired = 411,
+  Palantir_HttpStatus_412_PreconditionFailed = 412,
+  Palantir_HttpStatus_413_RequestEntityTooLarge = 413,
+  Palantir_HttpStatus_414_RequestUriTooLong = 414,
+  Palantir_HttpStatus_415_UnsupportedMediaType = 415,
+  Palantir_HttpStatus_416_RequestedRangeNotSatisfiable = 416,
+  Palantir_HttpStatus_417_ExpectationFailed = 417,
+  Palantir_HttpStatus_422_UnprocessableEntity = 422,
+  Palantir_HttpStatus_423_Locked = 423,
+  Palantir_HttpStatus_424_FailedDependency = 424,
+  Palantir_HttpStatus_426_UpgradeRequired = 426,
+
+  // 5xx Server Error
+  Palantir_HttpStatus_500_InternalServerError = 500,
+  Palantir_HttpStatus_501_NotImplemented = 501,
+  Palantir_HttpStatus_502_BadGateway = 502,
+  Palantir_HttpStatus_503_ServiceUnavailable = 503,
+  Palantir_HttpStatus_504_GatewayTimeout = 504,
+  Palantir_HttpStatus_505_HttpVersionNotSupported = 505,
+  Palantir_HttpStatus_506_VariantAlsoNegotiates = 506,
+  Palantir_HttpStatus_507_InsufficientStorage = 507,
+  Palantir_HttpStatus_509_BandwidthLimitExceeded = 509,
+  Palantir_HttpStatus_510_NotExtended = 510
+};
 
 
-  enum HttpMethod
-  {
-    HttpMethod_Get,
-    HttpMethod_Post,
-    HttpMethod_Delete,
-    HttpMethod_Put
-  };
-}
+enum Palantir_HttpMethod
+{
+  Palantir_HttpMethod_Get = 0,
+  Palantir_HttpMethod_Post = 1,
+  Palantir_HttpMethod_Delete = 2,
+  Palantir_HttpMethod_Put = 3
+};
--- a/PalantirCppClient/HttpException.cpp	Mon Sep 03 11:34:00 2012 +0200
+++ b/PalantirCppClient/HttpException.cpp	Tue Sep 04 09:59:34 2012 +0200
@@ -31,7 +31,7 @@
 {
   const char* HttpException::What() const
   {
-    if (status_ == HttpStatus_None)
+    if (status_ == Palantir_HttpStatus_None)
     {
       return custom_.c_str();
     }
@@ -41,164 +41,164 @@
     }
   }
 
-  const char* HttpException::GetDescription(HttpStatus status)
+  const char* HttpException::GetDescription(Palantir_HttpStatus status)
   {
     switch (status)
     {
-    case HttpStatus_100_Continue:
+    case Palantir_HttpStatus_100_Continue:
       return "Continue";
 
-    case HttpStatus_101_SwitchingProtocols:
+    case Palantir_HttpStatus_101_SwitchingProtocols:
       return "Switching Protocols";
 
-    case HttpStatus_102_Processing:
+    case Palantir_HttpStatus_102_Processing:
       return "Processing";
 
-    case HttpStatus_200_Ok:
+    case Palantir_HttpStatus_200_Ok:
       return "OK";
 
-    case HttpStatus_201_Created:
+    case Palantir_HttpStatus_201_Created:
       return "Created";
 
-    case HttpStatus_202_Accepted:
+    case Palantir_HttpStatus_202_Accepted:
       return "Accepted";
 
-    case HttpStatus_203_NonAuthoritativeInformation:
+    case Palantir_HttpStatus_203_NonAuthoritativeInformation:
       return "Non-Authoritative Information";
 
-    case HttpStatus_204_NoContent:
+    case Palantir_HttpStatus_204_NoContent:
       return "No Content";
 
-    case HttpStatus_205_ResetContent:
+    case Palantir_HttpStatus_205_ResetContent:
       return "Reset Content";
 
-    case HttpStatus_206_PartialContent:
+    case Palantir_HttpStatus_206_PartialContent:
       return "Partial Content";
 
-    case HttpStatus_207_MultiStatus:
+    case Palantir_HttpStatus_207_MultiStatus:
       return "Multi-Status";
 
-    case HttpStatus_208_AlreadyReported:
+    case Palantir_HttpStatus_208_AlreadyReported:
       return "Already Reported";
 
-    case HttpStatus_226_IMUsed:
+    case Palantir_HttpStatus_226_IMUsed:
       return "IM Used";
 
-    case HttpStatus_300_MultipleChoices:
+    case Palantir_HttpStatus_300_MultipleChoices:
       return "Multiple Choices";
 
-    case HttpStatus_301_MovedPermanently:
+    case Palantir_HttpStatus_301_MovedPermanently:
       return "Moved Permanently";
 
-    case HttpStatus_302_Found:
+    case Palantir_HttpStatus_302_Found:
       return "Found";
 
-    case HttpStatus_303_SeeOther:
+    case Palantir_HttpStatus_303_SeeOther:
       return "See Other";
 
-    case HttpStatus_304_NotModified:
+    case Palantir_HttpStatus_304_NotModified:
       return "Not Modified";
 
-    case HttpStatus_305_UseProxy:
+    case Palantir_HttpStatus_305_UseProxy:
       return "Use Proxy";
 
-    case HttpStatus_307_TemporaryRedirect:
+    case Palantir_HttpStatus_307_TemporaryRedirect:
       return "Temporary Redirect";
 
-    case HttpStatus_400_BadRequest:
+    case Palantir_HttpStatus_400_BadRequest:
       return "Bad Request";
 
-    case HttpStatus_401_Unauthorized:
+    case Palantir_HttpStatus_401_Unauthorized:
       return "Unauthorized";
 
-    case HttpStatus_402_PaymentRequired:
+    case Palantir_HttpStatus_402_PaymentRequired:
       return "Payment Required";
 
-    case HttpStatus_403_Forbidden:
+    case Palantir_HttpStatus_403_Forbidden:
       return "Forbidden";
 
-    case HttpStatus_404_NotFound:
+    case Palantir_HttpStatus_404_NotFound:
       return "Not Found";
 
-    case HttpStatus_405_MethodNotAllowed:
+    case Palantir_HttpStatus_405_MethodNotAllowed:
       return "Method Not Allowed";
 
-    case HttpStatus_406_NotAcceptable:
+    case Palantir_HttpStatus_406_NotAcceptable:
       return "Not Acceptable";
 
-    case HttpStatus_407_ProxyAuthenticationRequired:
+    case Palantir_HttpStatus_407_ProxyAuthenticationRequired:
       return "Proxy Authentication Required";
 
-    case HttpStatus_408_RequestTimeout:
+    case Palantir_HttpStatus_408_RequestTimeout:
       return "Request Timeout";
 
-    case HttpStatus_409_Conflict:
+    case Palantir_HttpStatus_409_Conflict:
       return "Conflict";
 
-    case HttpStatus_410_Gone:
+    case Palantir_HttpStatus_410_Gone:
       return "Gone";
 
-    case HttpStatus_411_LengthRequired:
+    case Palantir_HttpStatus_411_LengthRequired:
       return "Length Required";
 
-    case HttpStatus_412_PreconditionFailed:
+    case Palantir_HttpStatus_412_PreconditionFailed:
       return "Precondition Failed";
 
-    case HttpStatus_413_RequestEntityTooLarge:
+    case Palantir_HttpStatus_413_RequestEntityTooLarge:
       return "Request Entity Too Large";
 
-    case HttpStatus_414_RequestUriTooLong:
+    case Palantir_HttpStatus_414_RequestUriTooLong:
       return "Request-URI Too Long";
 
-    case HttpStatus_415_UnsupportedMediaType:
+    case Palantir_HttpStatus_415_UnsupportedMediaType:
       return "Unsupported Media Type";
 
-    case HttpStatus_416_RequestedRangeNotSatisfiable:
+    case Palantir_HttpStatus_416_RequestedRangeNotSatisfiable:
       return "Requested Range Not Satisfiable";
 
-    case HttpStatus_417_ExpectationFailed:
+    case Palantir_HttpStatus_417_ExpectationFailed:
       return "Expectation Failed";
 
-    case HttpStatus_422_UnprocessableEntity:
+    case Palantir_HttpStatus_422_UnprocessableEntity:
       return "Unprocessable Entity";
 
-    case HttpStatus_423_Locked:
+    case Palantir_HttpStatus_423_Locked:
       return "Locked";
 
-    case HttpStatus_424_FailedDependency:
+    case Palantir_HttpStatus_424_FailedDependency:
       return "Failed Dependency";
 
-    case HttpStatus_426_UpgradeRequired:
+    case Palantir_HttpStatus_426_UpgradeRequired:
       return "Upgrade Required";
 
-    case HttpStatus_500_InternalServerError:
+    case Palantir_HttpStatus_500_InternalServerError:
       return "Internal Server Error";
 
-    case HttpStatus_501_NotImplemented:
+    case Palantir_HttpStatus_501_NotImplemented:
       return "Not Implemented";
 
-    case HttpStatus_502_BadGateway:
+    case Palantir_HttpStatus_502_BadGateway:
       return "Bad Gateway";
 
-    case HttpStatus_503_ServiceUnavailable:
+    case Palantir_HttpStatus_503_ServiceUnavailable:
       return "Service Unavailable";
 
-    case HttpStatus_504_GatewayTimeout:
+    case Palantir_HttpStatus_504_GatewayTimeout:
       return "Gateway Timeout";
 
-    case HttpStatus_505_HttpVersionNotSupported:
+    case Palantir_HttpStatus_505_HttpVersionNotSupported:
       return "HTTP Version Not Supported";
 
-    case HttpStatus_506_VariantAlsoNegotiates:
+    case Palantir_HttpStatus_506_VariantAlsoNegotiates:
       return "Variant Also Negotiates";
 
-    case HttpStatus_507_InsufficientStorage:
+    case Palantir_HttpStatus_507_InsufficientStorage:
       return "Insufficient Storage";
 
-    case HttpStatus_509_BandwidthLimitExceeded:
+    case Palantir_HttpStatus_509_BandwidthLimitExceeded:
       return "Bandwidth Limit Exceeded";
 
-    case HttpStatus_510_NotExtended:
+    case Palantir_HttpStatus_510_NotExtended:
       return "Not Extended";
 
     default:
--- a/PalantirCppClient/HttpException.h	Mon Sep 03 11:34:00 2012 +0200
+++ b/PalantirCppClient/HttpException.h	Tue Sep 04 09:59:34 2012 +0200
@@ -36,24 +36,24 @@
   class HttpException
   {
   private:
-    HttpStatus status_;
+    Palantir_HttpStatus status_;
     std::string custom_;
 
   public:
-    static const char* GetDescription(HttpStatus status);
+    static const char* GetDescription(Palantir_HttpStatus status);
 
     HttpException(const std::string& custom)
     {
-      status_ = HttpStatus_None;
+      status_ = Palantir_HttpStatus_None;
       custom_ = custom;
     }
 
-    HttpException(HttpStatus status)
+    HttpException(Palantir_HttpStatus status)
     {
       status_ = status;
     }
 
-    HttpStatus GetHttpStatus() const
+    Palantir_HttpStatus GetHttpStatus() const
     {
       return status_;
     }
--- a/PalantirServer/PalantirRestApi.cpp	Mon Sep 03 11:34:00 2012 +0200
+++ b/PalantirServer/PalantirRestApi.cpp	Tue Sep 04 09:59:34 2012 +0200
@@ -426,7 +426,7 @@
         }
         else
         {
-          output.SendHeader(HttpStatus_415_UnsupportedMediaType);
+          output.SendHeader(Palantir_HttpStatus_415_UnsupportedMediaType);
           return;
         }
       }
@@ -629,7 +629,7 @@
         }
         catch (boost::bad_lexical_cast)
         {
-          output.SendHeader(HttpStatus_400_BadRequest);
+          output.SendHeader(Palantir_HttpStatus_400_BadRequest);
           return;
         }
 
@@ -640,7 +640,7 @@
 
         if (!index_.GetChanges(result, since, filter, limit))
         {
-          output.SendHeader(HttpStatus_400_BadRequest);
+          output.SendHeader(Palantir_HttpStatus_400_BadRequest);
           return;
         }
 
@@ -730,7 +730,7 @@
               (uri[2] == "find" && !DicomFind(result, connection, postData)) ||
               (uri[2] == "store" && !DicomStore(result, connection, postData)))
           {
-            output.SendHeader(HttpStatus_400_BadRequest);
+            output.SendHeader(Palantir_HttpStatus_400_BadRequest);
             return;
           }
         }
@@ -744,7 +744,7 @@
     }
     else
     {
-      output.SendHeader(HttpStatus_404_NotFound);
+      output.SendHeader(Palantir_HttpStatus_404_NotFound);
     }
   }
 }