Mercurial > hg > orthanc
comparison OrthancFramework/Sources/RestApi/RestApiHierarchy.cpp @ 4300:b30a8de92ad9
abi continued
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 05 Nov 2020 19:33:18 +0100 |
parents | 4d42408da117 |
children | 44b53a2c0a13 |
comparison
equal
deleted
inserted
replaced
4299:3f85db78c441 | 4300:b30a8de92ad9 |
---|---|
59 throw OrthancException(ErrorCode_ParameterOutOfRange); | 59 throw OrthancException(ErrorCode_ParameterOutOfRange); |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 | 63 |
64 void RestApiHierarchy::Resource::Register(RestApiGetCall::Handler handler) | |
65 { | |
66 getHandler_ = handler; | |
67 } | |
68 | |
69 void RestApiHierarchy::Resource::Register(RestApiPutCall::Handler handler) | |
70 { | |
71 putHandler_ = handler; | |
72 } | |
73 | |
74 void RestApiHierarchy::Resource::Register(RestApiPostCall::Handler handler) | |
75 { | |
76 postHandler_ = handler; | |
77 } | |
78 | |
79 void RestApiHierarchy::Resource::Register(RestApiDeleteCall::Handler handler) | |
80 { | |
81 deleteHandler_ = handler; | |
82 } | |
83 | |
84 | |
64 bool RestApiHierarchy::Resource::IsEmpty() const | 85 bool RestApiHierarchy::Resource::IsEmpty() const |
65 { | 86 { |
66 return (getHandler_ == NULL && | 87 return (getHandler_ == NULL && |
67 postHandler_ == NULL && | 88 postHandler_ == NULL && |
68 putHandler_ == NULL && | 89 putHandler_ == NULL && |
143 { | 164 { |
144 return false; | 165 return false; |
145 } | 166 } |
146 } | 167 } |
147 | 168 |
169 | |
170 RestApiHierarchy::IVisitor::~IVisitor() | |
171 { | |
172 } | |
148 | 173 |
149 | 174 |
150 void RestApiHierarchy::DeleteChildren(Children& children) | 175 void RestApiHierarchy::DeleteChildren(Children& children) |
151 { | 176 { |
152 for (Children::iterator it = children.begin(); | 177 for (Children::iterator it = children.begin(); |
387 for (Children::const_iterator it = wildcardChildren_.begin(); | 412 for (Children::const_iterator it = wildcardChildren_.begin(); |
388 it != wildcardChildren_.end(); ++it) | 413 it != wildcardChildren_.end(); ++it) |
389 { | 414 { |
390 it->second->CreateSiteMap(target["<" + it->first + ">"]); | 415 it->second->CreateSiteMap(target["<" + it->first + ">"]); |
391 } | 416 } |
417 } | |
418 | |
419 bool RestApiHierarchy::GetDirectory(Json::Value &result, const UriComponents &uri) | |
420 { | |
421 return GetDirectory(result, uri, 0); | |
392 } | 422 } |
393 | 423 |
394 | 424 |
395 bool RestApiHierarchy::LookupResource(const UriComponents& uri, | 425 bool RestApiHierarchy::LookupResource(const UriComponents& uri, |
396 IVisitor& visitor) | 426 IVisitor& visitor) |
461 { | 491 { |
462 methods.insert(HttpMethod_Get); | 492 methods.insert(HttpMethod_Get); |
463 } | 493 } |
464 } | 494 } |
465 } | 495 } |
496 | |
466 } | 497 } |