nixd
Loading...
Searching...
No Matches
nixd
lib
Protocol
lib/Protocol/Protocol.cpp
Go to the documentation of this file.
1
#include "
nixd/Protocol/Protocol.h
"
2
3
namespace
nixd::rpc
{
4
5
using namespace
llvm::json;
6
7
Value
toJSON
(
const
RegisterBCParams
&Params) {
8
return
Object
{{
"Shm"
, Params.
Shm
},
9
{
"BasePath"
, Params.
BasePath
},
10
{
"CachePath"
, Params.
CachePath
},
11
{
"Size"
, Params.
Size
}};
12
}
13
14
bool
fromJSON
(
const
Value &Params,
RegisterBCParams
&R,
Path
P) {
15
ObjectMapper O(Params, P);
16
return
O && O.map(
"Shm"
, R.
Shm
) && O.map(
"BasePath"
, R.
BasePath
) &&
17
O.map(
"CachePath"
, R.
CachePath
) && O.map(
"Size"
, R.
Size
);
18
}
19
20
Value
toJSON
(
const
ExprValueParams
&Params) {
21
return
Object
{{
"ExprID"
, Params.
ExprID
}};
22
}
23
24
bool
fromJSON
(
const
Value &Params,
ExprValueParams
&R,
Path
P) {
25
ObjectMapper O(Params, P);
26
return
O && O.map(
"ExprID"
, R.
ExprID
);
27
}
28
29
Value
toJSON
(
const
ExprValueResponse
&Params) {
30
return
Object
{{
"ResultKind"
, Params.
ResultKind
},
31
{
"ValueID"
, Params.
ValueID
},
32
{
"ValueKind"
, Params.
ValueKind
}};
33
}
34
35
bool
fromJSON
(
const
Value &Params,
ExprValueResponse
&R,
Path
P) {
36
ObjectMapper O(Params, P);
37
return
O && O.map(
"ResultKind"
, R.
ResultKind
) &&
38
O.map(
"ValueID"
, R.
ValueID
) && O.map(
"ValueKind"
, R.
ValueKind
);
39
}
40
41
}
// namespace nixd::rpc
Protocol.h
lspserver::Path
std::string Path
Definition
Path.h:24
lspserver::SymbolKind::Object
@ Object
nixd::rpc
Definition
include/nixd/Protocol/Protocol.h:8
nixd::rpc::fromJSON
bool fromJSON(const llvm::json::Value &Params, RegisterBCParams &R, llvm::json::Path P)
nixd::rpc::toJSON
llvm::json::Value toJSON(const RegisterBCParams &Params)
Definition
lib/Protocol/Protocol.cpp:7
nixd::rpc::ExprValueParams
Definition
include/nixd/Protocol/Protocol.h:28
nixd::rpc::ExprValueParams::ExprID
std::int64_t ExprID
Definition
include/nixd/Protocol/Protocol.h:29
nixd::rpc::ExprValueResponse
Definition
include/nixd/Protocol/Protocol.h:36
nixd::rpc::ExprValueResponse::ValueKind
int ValueKind
Definition
include/nixd/Protocol/Protocol.h:62
nixd::rpc::ExprValueResponse::ResultKind
int ResultKind
Definition
include/nixd/Protocol/Protocol.h:50
nixd::rpc::ExprValueResponse::ValueID
std::int64_t ValueID
The value ID, for future reference.
Definition
include/nixd/Protocol/Protocol.h:55
nixd::rpc::RegisterBCParams
Definition
include/nixd/Protocol/Protocol.h:17
nixd::rpc::RegisterBCParams::CachePath
std::string CachePath
Definition
include/nixd/Protocol/Protocol.h:20
nixd::rpc::RegisterBCParams::Shm
std::string Shm
Definition
include/nixd/Protocol/Protocol.h:18
nixd::rpc::RegisterBCParams::BasePath
std::string BasePath
Definition
include/nixd/Protocol/Protocol.h:19
nixd::rpc::RegisterBCParams::Size
std::int64_t Size
Definition
include/nixd/Protocol/Protocol.h:21
Generated by
1.12.0