1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2024-09-28 13:20:46 +00:00
falk-werner_webfuse-provider/test/webfuse/utils/ws_server2.hpp
2020-06-13 14:59:58 +02:00

37 lines
683 B
C++

#ifndef WF_TEST_UTILS_WS_SERVER2_HPP
#define WF_TEST_UTILS_WS_SERVER2_HPP
#include <jansson.h>
#include <string>
namespace webfuse_test
{
class IIvokationHandler
{
public:
virtual ~IIvokationHandler() = default;
virtual std::string Invoke(char const * method, json_t * params) = 0;
};
class WsServer2
{
WsServer2(WsServer2 const &) = delete;
WsServer2 & operator=(WsServer2 const & ) = delete;
public:
WsServer2(
IIvokationHandler& handler,
std::string const & protocol,
int port = 0);
virtual ~WsServer2();
bool IsConnected();
std::string const & GetUrl() const;
private:
class Private;
Private * d;
};
}
#endif