comparison OrthancServer/OrthancHttpHandler.cpp @ 1445:d26c8a93d05a

refactoring: SimpleGet
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 01 Jul 2015 12:30:19 +0200
parents 895ab369d63c
children 8dc80ba768aa
comparison
equal deleted inserted replaced
1444:b2b09a3dbd8e 1445:d26c8a93d05a
67 orthancRestApi_ = &handler; 67 orthancRestApi_ = &handler;
68 } 68 }
69 } 69 }
70 70
71 71
72 IHttpHandler& OrthancHttpHandler::GetOrthancRestApi() const 72 IHttpHandler& OrthancHttpHandler::RestrictToOrthancRestApi(bool restrict)
73 { 73 {
74 if (orthancRestApi_ == NULL) 74 if (restrict)
75 { 75 {
76 throw OrthancException(ErrorCode_InternalError); 76 if (orthancRestApi_ == NULL)
77 {
78 throw OrthancException(ErrorCode_InternalError);
79 }
80
81 return *orthancRestApi_;
77 } 82 }
78 83 else
79 return *orthancRestApi_; 84 {
85 return *this;
86 }
80 } 87 }
81 } 88 }