Mercurial > hg > orthanc
comparison OrthancCppClient/HttpException.h @ 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 | e3a40c7846b8 |
children | a9693dc7089c |
comparison
equal
deleted
inserted
replaced
472:722b56b99093 | 473:c9a5d72f8481 |
---|---|
25 **/ | 25 **/ |
26 | 26 |
27 | 27 |
28 #pragma once | 28 #pragma once |
29 | 29 |
30 #include "HttpEnumerations.h" | 30 #include "../Core/Enumerations.h" |
31 | 31 |
32 #include <string> | 32 #include <string> |
33 | 33 |
34 namespace Orthanc | 34 namespace Orthanc |
35 { | 35 { |
36 class HttpException | 36 class HttpException |
37 { | 37 { |
38 private: | 38 private: |
39 Orthanc_HttpStatus status_; | 39 HttpStatus status_; |
40 std::string custom_; | 40 std::string custom_; |
41 | 41 |
42 public: | 42 public: |
43 static const char* GetDescription(Orthanc_HttpStatus status); | 43 static const char* GetDescription(HttpStatus status); |
44 | 44 |
45 HttpException(const std::string& custom) | 45 HttpException(const std::string& custom) |
46 { | 46 { |
47 status_ = Orthanc_HttpStatus_None; | 47 status_ = HttpStatus_None; |
48 custom_ = custom; | 48 custom_ = custom; |
49 } | 49 } |
50 | 50 |
51 HttpException(Orthanc_HttpStatus status) | 51 HttpException(HttpStatus status) |
52 { | 52 { |
53 status_ = status; | 53 status_ = status; |
54 } | 54 } |
55 | 55 |
56 Orthanc_HttpStatus GetHttpStatus() const | 56 HttpStatus GetHttpStatus() const |
57 { | 57 { |
58 return status_; | 58 return status_; |
59 } | 59 } |
60 | 60 |
61 const char* What() const; | 61 const char* What() const; |