Mercurial > hg > orthanc
diff Core/RestApi/RestApi.cpp @ 304:4eea080e6e7a
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 19 Dec 2012 14:57:18 +0100 |
parents | 5694365ecb96 |
children | 5a96dac27959 |
line wrap: on
line diff
--- a/Core/RestApi/RestApi.cpp Tue Dec 18 19:01:01 2012 +0100 +++ b/Core/RestApi/RestApi.cpp Wed Dec 19 14:57:18 2012 +0100 @@ -37,6 +37,29 @@ namespace Orthanc { + bool RestApi::SharedCall::ParseJsonRequestInternal(Json::Value& result, + const char* request) + { + result.clear(); + Json::Reader reader; + return reader.parse(request, result); + } + + + bool RestApi::GetCall::ParseJsonRequest(Json::Value& result) const + { + result.clear(); + + for (HttpHandler::Arguments::const_iterator + it = getArguments_->begin(); it != getArguments_->end(); it++) + { + result[it->first] = result[it->second]; + } + + return true; + } + + bool RestApi::IsGetAccepted(const UriComponents& uri) { for (GetHandlers::const_iterator it = getHandlers_.begin();