Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
102c4743
Unverified
Commit
102c4743
authored
Jan 28, 2018
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🔨
clean up
parent
6855bbb9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
+10
-8
develop/detail/output/binary_writer.hpp
develop/detail/output/binary_writer.hpp
+4
-3
src/json.hpp
src/json.hpp
+4
-3
test/src/unit-cbor.cpp
test/src/unit-cbor.cpp
+1
-1
test/src/unit-ubjson.cpp
test/src/unit-ubjson.cpp
+1
-1
No files found.
develop/detail/output/binary_writer.hpp
View file @
102c4743
...
...
@@ -684,10 +684,11 @@ class binary_writer
@tparam NumberType the type of the number
@note This function needs to respect the system's endianess, because bytes
in CBOR
and MessagePack are stored in network order (big endian) and
therefore need reordering on little endian systems.
in CBOR
, MessagePack, and UBJSON are stored in network order (big
endian) and
therefore need reordering on little endian systems.
*/
template
<
typename
NumberType
>
void
write_number
(
NumberType
n
)
template
<
typename
NumberType
>
void
write_number
(
const
NumberType
n
)
{
// step 1: write number to array of length NumberType
std
::
array
<
CharType
,
sizeof
(
NumberType
)
>
vec
;
...
...
src/json.hpp
View file @
102c4743
...
...
@@ -6846,10 +6846,11 @@ class binary_writer
@tparam NumberType the type of the number
@note This function needs to respect the system's endianess, because bytes
in CBOR
and MessagePack are stored in network order (big endian) and
therefore need reordering on little endian systems.
in CBOR
, MessagePack, and UBJSON are stored in network order (big
endian) and
therefore need reordering on little endian systems.
*/
template
<
typename
NumberType
>
void
write_number
(
NumberType
n
)
template
<
typename
NumberType
>
void
write_number
(
const
NumberType
n
)
{
// step 1: write number to array of length NumberType
std
::
array
<
CharType
,
sizeof
(
NumberType
)
>
vec
;
...
...
test/src/unit-cbor.cpp
View file @
102c4743
...
...
@@ -1703,7 +1703,7 @@ TEST_CASE("CBOR roundtrips", "[hide]")
}
}
TEST_CASE
(
"all first bytes"
,
"[!throws]"
)
TEST_CASE
(
"all
CBOR
first bytes"
,
"[!throws]"
)
{
// these bytes will fail immediately with exception parse_error.112
std
::
set
<
uint8_t
>
unsupported
=
...
...
test/src/unit-ubjson.cpp
View file @
102c4743
...
...
@@ -2071,7 +2071,7 @@ TEST_CASE("Universal Binary JSON Specification Examples 2")
*/
TEST_CASE
(
"all first bytes"
,
"[!throws]"
)
TEST_CASE
(
"all
UBJSON
first bytes"
,
"[!throws]"
)
{
// these bytes will fail immediately with exception parse_error.112
std
::
set
<
uint8_t
>
supported
=
...
...
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