mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-08 19:22:29 +00:00
9f48226663
Inline nlohmann/json for the JSON parsing itself, and handle requests with the same SCGI interface as XML-RPC. Based off the work in https://github.com/jesec/rtorrent
25 lines
447 B
C++
25 lines
447 B
C++
#ifndef RTORRENT_RPC_JSONRPC_H
|
|
#define RTORRENT_RPC_JSONRPC_H
|
|
|
|
#include <functional>
|
|
|
|
#include <cstdint>
|
|
|
|
namespace rpc {
|
|
|
|
class JsonRpc {
|
|
public:
|
|
using slot_write = std::function<bool(const char*, uint32_t)>;
|
|
|
|
void initialize() {};
|
|
void cleanup() {};
|
|
|
|
bool process(const char* in_buffer, uint32_t length, slot_write callback);
|
|
|
|
void insert_command(const char* name, const char* parm, const char* doc) {};
|
|
};
|
|
|
|
} // namespace rpc
|
|
|
|
#endif
|