3030using namespace std ;
3131using namespace solidity ::lsp;
3232
33- JSONTransport::JSONTransport (istream& _in, ostream& _out):
33+ IOStreamTransport::IOStreamTransport (istream& _in, ostream& _out):
3434 m_input{_in},
3535 m_output{_out}
3636{
3737}
3838
39- JSONTransport::JSONTransport ():
40- JSONTransport (cin, cout)
39+ IOStreamTransport::IOStreamTransport ():
40+ IOStreamTransport (cin, cout)
4141{
4242}
4343
44- bool JSONTransport ::closed () const noexcept
44+ bool IOStreamTransport ::closed () const noexcept
4545{
4646 return m_input.eof ();
4747}
4848
49- optional<Json::Value> JSONTransport ::receive ()
49+ optional<Json::Value> IOStreamTransport ::receive ()
5050{
5151 auto const headers = parseHeaders ();
5252 if (!headers)
@@ -75,30 +75,30 @@ optional<Json::Value> JSONTransport::receive()
7575 return {move (jsonMessage)};
7676}
7777
78- void JSONTransport ::notify (string _method, Json::Value _message)
78+ void IOStreamTransport ::notify (string _method, Json::Value _message)
7979{
8080 Json::Value json;
8181 json[" method" ] = move (_method);
8282 json[" params" ] = move (_message);
8383 send (move (json));
8484}
8585
86- void JSONTransport ::reply (MessageID _id, Json::Value _message)
86+ void IOStreamTransport ::reply (MessageID _id, Json::Value _message)
8787{
8888 Json::Value json;
8989 json[" result" ] = move (_message);
9090 send (move (json), _id);
9191}
9292
93- void JSONTransport ::error (MessageID _id, ErrorCode _code, string _message)
93+ void IOStreamTransport ::error (MessageID _id, ErrorCode _code, string _message)
9494{
9595 Json::Value json;
9696 json[" error" ][" code" ] = static_cast <int >(_code);
9797 json[" error" ][" message" ] = move (_message);
9898 send (move (json), _id);
9999}
100100
101- void JSONTransport ::send (Json::Value _json, MessageID _id)
101+ void IOStreamTransport ::send (Json::Value _json, MessageID _id)
102102{
103103 solAssert (_json.isObject ());
104104 _json[" jsonrpc" ] = " 2.0" ;
@@ -114,7 +114,7 @@ void JSONTransport::send(Json::Value _json, MessageID _id)
114114 m_output.flush ();
115115}
116116
117- optional<map<string, string>> JSONTransport ::parseHeaders ()
117+ optional<map<string, string>> IOStreamTransport ::parseHeaders ()
118118{
119119 map<string, string> headers;
120120
0 commit comments