Lines Matching refs:json
32 Reply(const llvm::json::Value &id, StringRef method,
39 void operator()(llvm::Expected<llvm::json::Value> reply);
44 llvm::json::Value id;
49 Reply::Reply(const llvm::json::Value &id, llvm::StringRef method, in Reply()
59 void Reply::operator()(llvm::Expected<llvm::json::Value> reply) { in operator ()()
81 bool MessageHandler::onNotify(llvm::StringRef method, llvm::json::Value value) { in onNotify()
96 bool MessageHandler::onCall(llvm::StringRef method, llvm::json::Value params, in onCall()
97 llvm::json::Value id) { in onCall()
112 bool MessageHandler::onReply(llvm::json::Value id, in onReply()
113 llvm::Expected<llvm::json::Value> result) { in onReply()
116 Callback<llvm::json::Value> replyHandler = in onReply()
117 [&id](llvm::Expected<llvm::json::Value> result) { in onReply()
137 static llvm::json::Object encodeError(llvm::Error error) { in encodeError()
148 return llvm::json::Object{ in encodeError()
155 llvm::Error decodeError(const llvm::json::Object &o) { in decodeError()
163 void JSONTransport::notify(StringRef method, llvm::json::Value params) { in notify()
164 sendMessage(llvm::json::Object{ in notify()
170 void JSONTransport::call(StringRef method, llvm::json::Value params, in call()
171 llvm::json::Value id) { in call()
172 sendMessage(llvm::json::Object{ in call()
179 void JSONTransport::reply(llvm::json::Value id, in reply()
180 llvm::Expected<llvm::json::Value> result) { in reply()
182 return sendMessage(llvm::json::Object{ in reply()
189 sendMessage(llvm::json::Object{ in reply()
197 std::string json; in run() local
204 if (succeeded(readMessage(json))) { in run()
205 if (llvm::Expected<llvm::json::Value> doc = llvm::json::parse(json)) { in run()
216 void JSONTransport::sendMessage(llvm::json::Value msg) { in sendMessage()
226 bool JSONTransport::handleMessage(llvm::json::Value msg, in handleMessage()
229 llvm::json::Object *object = msg.getAsObject(); in handleMessage()
235 llvm::Optional<llvm::json::Value> id; in handleMessage()
236 if (llvm::json::Value *i = object->get("id")) in handleMessage()
247 llvm::json::Value result = nullptr; in handleMessage()
248 if (llvm::json::Value *r = object->get("result")) in handleMessage()
254 llvm::json::Value params = nullptr; in handleMessage()
255 if (llvm::json::Value *p = object->get("params")) in handleMessage()
292 LogicalResult JSONTransport::readStandardMessage(std::string &json) { in readStandardMessage() argument
318 json.resize(contentLength); in readStandardMessage()
320 read = std::fread(&json[pos], 1, contentLength - pos, in); in readStandardMessage()
338 LogicalResult JSONTransport::readDelimitedMessage(std::string &json) { in readDelimitedMessage() argument
339 json.clear(); in readDelimitedMessage()
350 json += line; in readDelimitedMessage()