clang-tools
7.0.0
|
Main JSONRPC entry point. More...
#include <JSONRPCDispatcher.h>
Public Types | |
using | Handler = std::function< void(const llvm::json::Value &)> |
Public Member Functions | |
JSONRPCDispatcher (Handler UnknownHandler) | |
Create a new JSONRPCDispatcher. More... | |
void | registerHandler (StringRef Method, Handler H) |
Registers a Handler for the specified Method. More... | |
bool | call (const llvm::json::Value &Message, JSONOutput &Out) const |
Parses a JSONRPC message and calls the Handler for it. More... | |
Main JSONRPC entry point.
This parses the JSONRPC "header" and calls the registered Handler for the method received.
Definition at line 73 of file JSONRPCDispatcher.h.
using clang::clangd::JSONRPCDispatcher::Handler = std::function<void(const llvm::json::Value &)> |
Definition at line 76 of file JSONRPCDispatcher.h.
|
inline |
Create a new JSONRPCDispatcher.
UnknownHandler is called when an unknown method is received.
Definition at line 80 of file JSONRPCDispatcher.h.
References clang::clangd::call(), clang::tidy::modernize::Message, and clang::clangd::Method.
bool JSONRPCDispatcher::call | ( | const llvm::json::Value & | Message, |
JSONOutput & | Out | ||
) | const |
Parses a JSONRPC message and calls the Handler for it.
Definition at line 172 of file JSONRPCDispatcher.cpp.
void JSONRPCDispatcher::registerHandler | ( | StringRef | Method, |
Handler | H | ||
) |
Registers a Handler for the specified Method.
Definition at line 150 of file JSONRPCDispatcher.cpp.