comparison OrthancFramework/Sources/RestApi/RestApiHierarchy.h @ 4300:b30a8de92ad9

abi continued
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 05 Nov 2020 19:33:18 +0100
parents bf7b9edf6b81
children 44b53a2c0a13
comparison
equal deleted inserted replaced
4299:3f85db78c441 4300:b30a8de92ad9
45 public: 45 public:
46 Resource(); 46 Resource();
47 47
48 bool HasHandler(HttpMethod method) const; 48 bool HasHandler(HttpMethod method) const;
49 49
50 void Register(RestApiGetCall::Handler handler) 50 void Register(RestApiGetCall::Handler handler);
51 {
52 getHandler_ = handler;
53 }
54 51
55 void Register(RestApiPutCall::Handler handler) 52 void Register(RestApiPutCall::Handler handler);
56 {
57 putHandler_ = handler;
58 }
59 53
60 void Register(RestApiPostCall::Handler handler) 54 void Register(RestApiPostCall::Handler handler);
61 {
62 postHandler_ = handler;
63 }
64 55
65 void Register(RestApiDeleteCall::Handler handler) 56 void Register(RestApiDeleteCall::Handler handler);
66 {
67 deleteHandler_ = handler;
68 }
69 57
70 bool IsEmpty() const; 58 bool IsEmpty() const;
71 59
72 bool Handle(RestApiGetCall& call) const; 60 bool Handle(RestApiGetCall& call) const;
73 61
80 68
81 69
82 class IVisitor : public boost::noncopyable 70 class IVisitor : public boost::noncopyable
83 { 71 {
84 public: 72 public:
85 virtual ~IVisitor() 73 virtual ~IVisitor();
86 {
87 }
88 74
89 virtual bool Visit(const Resource& resource, 75 virtual bool Visit(const Resource& resource,
90 const UriComponents& uri, 76 const UriComponents& uri,
91 const IHttpHandler::Arguments& components, 77 const IHttpHandler::Arguments& components,
92 const UriComponents& trailing) = 0; 78 const UriComponents& trailing) = 0;
138 RestApiDeleteCall::Handler handler); 124 RestApiDeleteCall::Handler handler);
139 125
140 void CreateSiteMap(Json::Value& target) const; 126 void CreateSiteMap(Json::Value& target) const;
141 127
142 bool GetDirectory(Json::Value& result, 128 bool GetDirectory(Json::Value& result,
143 const UriComponents& uri) 129 const UriComponents& uri);
144 {
145 return GetDirectory(result, uri, 0);
146 }
147 130
148 bool LookupResource(const UriComponents& uri, 131 bool LookupResource(const UriComponents& uri,
149 IVisitor& visitor); 132 IVisitor& visitor);
150 133
151 void GetAcceptedMethods(std::set<HttpMethod>& methods, 134 void GetAcceptedMethods(std::set<HttpMethod>& methods,