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
c4e7ed8c
Commit
c4e7ed8c
authored
Nov 09, 2015
by
Kamal Marhubi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove indirection through parseJsonValue
parent
b6477c2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
14 deletions
+4
-14
json.c++
c++/src/capnp/compat/json.c++
+4
-14
No files found.
c++/src/capnp/compat/json.c++
View file @
c4e7ed8c
...
...
@@ -45,12 +45,6 @@ struct FieldHash {
}
// namespace
namespace
_
{
// private
void
parseJsonValue
(
kj
::
ArrayPtr
<
const
char
>
input
,
JsonValue
::
Builder
output
);
}
// namespace _ (private)
struct
JsonCodec
::
Impl
{
bool
prettyPrint
=
false
;
...
...
@@ -221,10 +215,6 @@ kj::String JsonCodec::encodeRaw(JsonValue::Reader value) const {
return
impl
->
encodeRaw
(
value
,
0
,
multiline
,
false
).
flatten
();
}
void
JsonCodec
::
decodeRaw
(
kj
::
ArrayPtr
<
const
char
>
input
,
JsonValue
::
Builder
output
)
const
{
_
::
parseJsonValue
(
input
,
output
);
}
void
JsonCodec
::
encode
(
DynamicValue
::
Reader
input
,
Type
type
,
JsonValue
::
Builder
output
)
const
{
// TODO(soon): For interfaces, check for handlers on superclasses, per documentation...
// TODO(soon): For branded types, should we check for handlers on the generic?
...
...
@@ -382,7 +372,7 @@ Orphan<DynamicValue> JsonCodec::decode(
// -----------------------------------------------------------------------------
namespace
_
{
// private
namespace
{
class
Parser
{
public
:
...
...
@@ -616,15 +606,15 @@ const kj::ArrayPtr<const char> Parser::NULL_ = kj::ArrayPtr<const char>({'n','u'
const
kj
::
ArrayPtr
<
const
char
>
Parser
::
FALSE
=
kj
::
ArrayPtr
<
const
char
>
({
'f'
,
'a'
,
'l'
,
's'
,
'e'
});
const
kj
::
ArrayPtr
<
const
char
>
Parser
::
TRUE
=
kj
::
ArrayPtr
<
const
char
>
({
't'
,
'r'
,
'u'
,
'e'
});
}
// namespace
void
parseJsonValue
(
kj
::
ArrayPtr
<
const
char
>
input
,
JsonValue
::
Builder
output
)
{
void
JsonCodec
::
decodeRaw
(
kj
::
ArrayPtr
<
const
char
>
input
,
JsonValue
::
Builder
output
)
const
{
// TODO(security): should we check there are no non-whitespace characters left in input?
Parser
parser
(
input
);
parser
.
parseValue
(
output
);
}
}
// namespace _ (private)
// -----------------------------------------------------------------------------
Orphan
<
DynamicValue
>
JsonCodec
::
HandlerBase
::
decodeBase
(
...
...
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