Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
7f513230
Commit
7f513230
authored
Dec 06, 2017
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing const qualifiers on JsonCodec.
parent
6a59486e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
json.h
c++/src/capnp/compat/json.h
+4
-4
No files found.
c++/src/capnp/compat/json.h
View file @
7f513230
...
...
@@ -76,7 +76,7 @@ public:
// the call stack. The default is 64.
template
<
typename
T
>
kj
::
String
encode
(
T
&&
value
);
kj
::
String
encode
(
T
&&
value
)
const
;
// Encode any Cap'n Proto value to JSON, including primitives and
// Dynamic{Enum,Struct,List,Capability}, but not DynamicValue (see below).
...
...
@@ -126,7 +126,7 @@ public:
// Translate JsonValue <-> text.
template
<
typename
T
>
void
encode
(
T
&&
value
,
JsonValue
::
Builder
output
);
void
encode
(
T
&&
value
,
JsonValue
::
Builder
output
)
const
;
void
encode
(
DynamicValue
::
Reader
input
,
Type
type
,
JsonValue
::
Builder
output
)
const
;
void
decode
(
JsonValue
::
Reader
input
,
DynamicStruct
::
Builder
output
)
const
;
template
<
typename
T
>
...
...
@@ -228,7 +228,7 @@ template <bool isDynamic>
struct
EncodeImpl
;
template
<
typename
T
>
kj
::
String
JsonCodec
::
encode
(
T
&&
value
)
{
kj
::
String
JsonCodec
::
encode
(
T
&&
value
)
const
{
Type
type
=
Type
::
from
(
value
);
typedef
FromAny
<
kj
::
Decay
<
T
>>
Base
;
return
encode
(
DynamicValue
::
Reader
(
ReaderFor
<
Base
>
(
kj
::
fwd
<
T
>
(
value
))),
type
);
...
...
@@ -265,7 +265,7 @@ inline DynamicEnum JsonCodec::decode(kj::ArrayPtr<const char> input, EnumSchema
// -----------------------------------------------------------------------------
template
<
typename
T
>
void
JsonCodec
::
encode
(
T
&&
value
,
JsonValue
::
Builder
output
)
{
void
JsonCodec
::
encode
(
T
&&
value
,
JsonValue
::
Builder
output
)
const
{
typedef
FromAny
<
kj
::
Decay
<
T
>>
Base
;
encode
(
DynamicValue
::
Reader
(
ReaderFor
<
Base
>
(
kj
::
fwd
<
T
>
(
value
))),
Type
::
from
<
Base
>
(),
output
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment