Mercurial > hg > orthanc
comparison OrthancFramework/Sources/RestApi/RestApiCall.cpp @ 4473:68f52897c119
new URIs: /tools/accepted-transfer-syntaxes and /tools/unknown-sop-class-accepted to replace Lua callbacks for transfer syntaxes
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 26 Jan 2021 14:48:10 +0100 |
parents | d9473bd5ed43 |
children | 7053502fbf97 |
comparison
equal
deleted
inserted
replaced
4472:28a4baadde17 | 4473:68f52897c119 |
---|---|
20 **/ | 20 **/ |
21 | 21 |
22 | 22 |
23 #include "../PrecompiledHeaders.h" | 23 #include "../PrecompiledHeaders.h" |
24 #include "RestApiCall.h" | 24 #include "RestApiCall.h" |
25 | |
26 #include "../OrthancException.h" | |
27 | |
25 | 28 |
26 namespace Orthanc | 29 namespace Orthanc |
27 { | 30 { |
28 void RestApiCall::GetUriComponentsNames(std::set<std::string>& components) const | 31 void RestApiCall::GetUriComponentsNames(std::set<std::string>& components) const |
29 { | 32 { |
57 documentation_.reset(new RestApiCallDocumentation(method_)); | 60 documentation_.reset(new RestApiCallDocumentation(method_)); |
58 } | 61 } |
59 | 62 |
60 return *documentation_; | 63 return *documentation_; |
61 } | 64 } |
65 | |
66 | |
67 bool RestApiCall::ParseBoolean(const std::string& value) | |
68 { | |
69 std::string stripped = Toolbox::StripSpaces(value); | |
70 | |
71 if (stripped == "0" || | |
72 stripped == "false") | |
73 { | |
74 return false; | |
75 } | |
76 else if (stripped == "1" || | |
77 stripped == "true") | |
78 { | |
79 return true; | |
80 } | |
81 else | |
82 { | |
83 throw OrthancException(ErrorCode_BadFileFormat, "Boolean value expected"); | |
84 } | |
85 } | |
62 } | 86 } |