comparison 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
comparison
equal deleted inserted replaced
303:c76a35a85c69 304:4eea080e6e7a
35 #include <stdlib.h> // To define "_exit()" under Windows 35 #include <stdlib.h> // To define "_exit()" under Windows
36 #include <glog/logging.h> 36 #include <glog/logging.h>
37 37
38 namespace Orthanc 38 namespace Orthanc
39 { 39 {
40 bool RestApi::SharedCall::ParseJsonRequestInternal(Json::Value& result,
41 const char* request)
42 {
43 result.clear();
44 Json::Reader reader;
45 return reader.parse(request, result);
46 }
47
48
49 bool RestApi::GetCall::ParseJsonRequest(Json::Value& result) const
50 {
51 result.clear();
52
53 for (HttpHandler::Arguments::const_iterator
54 it = getArguments_->begin(); it != getArguments_->end(); it++)
55 {
56 result[it->first] = result[it->second];
57 }
58
59 return true;
60 }
61
62
40 bool RestApi::IsGetAccepted(const UriComponents& uri) 63 bool RestApi::IsGetAccepted(const UriComponents& uri)
41 { 64 {
42 for (GetHandlers::const_iterator it = getHandlers_.begin(); 65 for (GetHandlers::const_iterator it = getHandlers_.begin();
43 it != getHandlers_.end(); it++) 66 it != getHandlers_.end(); it++)
44 { 67 {