mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
RequestHander: Add GetRequestList()
This commit is contained in:
parent
11d28d17f1
commit
680b5c470e
@ -238,9 +238,9 @@ WebSocketProtocol::ProcessResult WebSocketProtocol::ProcessMessage(SessionPtr se
|
||||
|
||||
std::vector<std::string> WebSocketProtocol::GetRequestList()
|
||||
{
|
||||
std::vector<std::string> ret;
|
||||
RequestHandler requestHandler;
|
||||
|
||||
return ret;
|
||||
return requestHandler.GetRequestList();
|
||||
}
|
||||
|
||||
std::vector<std::string> WebSocketProtocol::GetEventList()
|
||||
|
@ -25,4 +25,14 @@ RequestResult RequestHandler::ProcessRequest(const Request& request)
|
||||
}
|
||||
|
||||
return std::bind(handler, this, std::placeholders::_1)(request);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> RequestHandler::GetRequestList()
|
||||
{
|
||||
std::vector<std::string> ret;
|
||||
for (auto const& [key, val] : _handlerMap) {
|
||||
ret.push_back(key);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ typedef RequestResult(RequestHandler::*RequestMethodHandler)(const Request&);
|
||||
class RequestHandler {
|
||||
public:
|
||||
RequestResult ProcessRequest(const Request& request);
|
||||
std::vector<std::string> GetRequestList();
|
||||
|
||||
private:
|
||||
RequestResult GetVersion(const Request&);
|
||||
|
Loading…
Reference in New Issue
Block a user