|
|
@@ -241,4 +241,49 @@ HttpReply HttpReply::StockReply(HttpReply::Status::type status)
|
|
|
return reply;
|
|
|
}
|
|
|
|
|
|
+namespace Conversions {
|
|
|
+
|
|
|
+HttpReply::Status::type HttpReply(HttpServer::HttpReply::Status::type status)
|
|
|
+{
|
|
|
+ switch (status)
|
|
|
+ {
|
|
|
+ case HttpServer::HttpReply::Status::Ok:
|
|
|
+ return HttpReply::Status::Ok;
|
|
|
+ case HttpServer::HttpReply::Status::Created:
|
|
|
+ return HttpReply::Status::Created;
|
|
|
+ case HttpServer::HttpReply::Status::Accepted:
|
|
|
+ return HttpReply::Status::Accepted;
|
|
|
+ case HttpServer::HttpReply::Status::NoContent:
|
|
|
+ return HttpReply::Status::NoContent;
|
|
|
+ case HttpServer::HttpReply::Status::MultipleChoices:
|
|
|
+ return HttpReply::Status::MultipleChoices;
|
|
|
+ case HttpServer::HttpReply::Status::MovedPermanently:
|
|
|
+ return HttpReply::Status::MovedPermanently;
|
|
|
+ case HttpServer::HttpReply::Status::MovedTemporarily:
|
|
|
+ return HttpReply::Status::MovedTemporarily;
|
|
|
+ case HttpReply::Status::NotModified:
|
|
|
+ return HttpReply::Status::NotModified;
|
|
|
+ case HttpServer::HttpReply::Status::BadRequest:
|
|
|
+ return HttpReply::Status::BadRequest;
|
|
|
+ case HttpServer::HttpReply::Status::Unauthorized:
|
|
|
+ return HttpReply::Status::Unauthorized;
|
|
|
+ case HttpServer::HttpReply::Status::Forbidden:
|
|
|
+ return HttpReply::Status::Forbidden;
|
|
|
+ case HttpServer::HttpReply::Status::NotFound:
|
|
|
+ return HttpReply::Status::NotFound;
|
|
|
+ case HttpServer::HttpServer::HttpReply::Status::InternalServerError:
|
|
|
+ return HttpReply::Status::InternalServerError;
|
|
|
+ case HttpServer::HttpReply::Status::NotImplemented:
|
|
|
+ return HttpReply::Status::NotImplemented;
|
|
|
+ case HttpServer::HttpReply::Status::BadGateway:
|
|
|
+ return HttpReply::Status::BadGateway;
|
|
|
+ case HttpServer::HttpReply::Status::ServiceUnavailable:
|
|
|
+ return HttpReply::Status::ServiceUnavailable;
|
|
|
+ default:
|
|
|
+ return HttpReply::Status::InternalServerError;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+} // namespace Conversions
|
|
|
+
|
|
|
} // namespace Http
|