Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
json
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
json
Commits
5b53f03e
Unverified
Commit
5b53f03e
authored
Feb 19, 2017
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into TurpentineDistillery-feature/locale_independent_num_to_str
parents
d1479e47
9a9d0ba3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
json.hpp
src/json.hpp
+7
-7
json.hpp.re2c
src/json.hpp.re2c
+7
-7
No files found.
src/json.hpp
View file @
5b53f03e
...
@@ -6545,10 +6545,10 @@ class basic_json
...
@@ -6545,10 +6545,10 @@ class basic_json
{
{
case
8
:
case
8
:
{
{
vec
.
push_back
(
static_cast
<
uint8_t
>
((
number
>>
070
)
&
0xff
));
vec
.
push_back
(
static_cast
<
uint8_t
>
((
static_cast
<
uint64_t
>
(
number
)
>>
070
)
&
0xff
));
vec
.
push_back
(
static_cast
<
uint8_t
>
((
number
>>
060
)
&
0xff
));
vec
.
push_back
(
static_cast
<
uint8_t
>
((
static_cast
<
uint64_t
>
(
number
)
>>
060
)
&
0xff
));
vec
.
push_back
(
static_cast
<
uint8_t
>
((
number
>>
050
)
&
0xff
));
vec
.
push_back
(
static_cast
<
uint8_t
>
((
static_cast
<
uint64_t
>
(
number
)
>>
050
)
&
0xff
));
vec
.
push_back
(
static_cast
<
uint8_t
>
((
number
>>
040
)
&
0xff
));
vec
.
push_back
(
static_cast
<
uint8_t
>
((
static_cast
<
uint64_t
>
(
number
)
>>
040
)
&
0xff
));
// intentional fall-through
// intentional fall-through
}
}
...
@@ -7021,7 +7021,7 @@ class basic_json
...
@@ -7021,7 +7021,7 @@ class basic_json
const
auto
N
=
j
.
m_value
.
string
->
size
();
const
auto
N
=
j
.
m_value
.
string
->
size
();
if
(
N
<=
0x17
)
if
(
N
<=
0x17
)
{
{
v
.
push_back
(
0x60
+
N
);
// 1 byte for string + size
v
.
push_back
(
0x60
+
static_cast
<
uint8_t
>
(
N
)
);
// 1 byte for string + size
}
}
else
if
(
N
<=
0xff
)
else
if
(
N
<=
0xff
)
{
{
...
@@ -7057,7 +7057,7 @@ class basic_json
...
@@ -7057,7 +7057,7 @@ class basic_json
const
auto
N
=
j
.
m_value
.
array
->
size
();
const
auto
N
=
j
.
m_value
.
array
->
size
();
if
(
N
<=
0x17
)
if
(
N
<=
0x17
)
{
{
v
.
push_back
(
0x80
+
N
);
// 1 byte for array + size
v
.
push_back
(
0x80
+
static_cast
<
uint8_t
>
(
N
)
);
// 1 byte for array + size
}
}
else
if
(
N
<=
0xff
)
else
if
(
N
<=
0xff
)
{
{
...
@@ -7095,7 +7095,7 @@ class basic_json
...
@@ -7095,7 +7095,7 @@ class basic_json
const
auto
N
=
j
.
m_value
.
object
->
size
();
const
auto
N
=
j
.
m_value
.
object
->
size
();
if
(
N
<=
0x17
)
if
(
N
<=
0x17
)
{
{
v
.
push_back
(
0xa0
+
N
);
// 1 byte for object + size
v
.
push_back
(
0xa0
+
static_cast
<
uint8_t
>
(
N
)
);
// 1 byte for object + size
}
}
else
if
(
N
<=
0xff
)
else
if
(
N
<=
0xff
)
{
{
...
...
src/json.hpp.re2c
View file @
5b53f03e
...
@@ -6545,10 +6545,10 @@ class basic_json
...
@@ -6545,10 +6545,10 @@ class basic_json
{
{
case 8:
case 8:
{
{
vec.push_back(static_cast<uint8_t>((
number
>> 070) & 0xff));
vec.push_back(static_cast<uint8_t>((
static_cast<uint64_t>(number)
>> 070) & 0xff));
vec.push_back(static_cast<uint8_t>((
number
>> 060) & 0xff));
vec.push_back(static_cast<uint8_t>((
static_cast<uint64_t>(number)
>> 060) & 0xff));
vec.push_back(static_cast<uint8_t>((
number
>> 050) & 0xff));
vec.push_back(static_cast<uint8_t>((
static_cast<uint64_t>(number)
>> 050) & 0xff));
vec.push_back(static_cast<uint8_t>((
number
>> 040) & 0xff));
vec.push_back(static_cast<uint8_t>((
static_cast<uint64_t>(number)
>> 040) & 0xff));
// intentional fall-through
// intentional fall-through
}
}
...
@@ -7021,7 +7021,7 @@ class basic_json
...
@@ -7021,7 +7021,7 @@ class basic_json
const auto N = j.m_value.string->size();
const auto N = j.m_value.string->size();
if (N <= 0x17)
if (N <= 0x17)
{
{
v.push_back(0x60 +
N
); // 1 byte for string + size
v.push_back(0x60 +
static_cast<uint8_t>(N)
); // 1 byte for string + size
}
}
else if (N <= 0xff)
else if (N <= 0xff)
{
{
...
@@ -7057,7 +7057,7 @@ class basic_json
...
@@ -7057,7 +7057,7 @@ class basic_json
const auto N = j.m_value.array->size();
const auto N = j.m_value.array->size();
if (N <= 0x17)
if (N <= 0x17)
{
{
v.push_back(0x80 +
N
); // 1 byte for array + size
v.push_back(0x80 +
static_cast<uint8_t>(N)
); // 1 byte for array + size
}
}
else if (N <= 0xff)
else if (N <= 0xff)
{
{
...
@@ -7095,7 +7095,7 @@ class basic_json
...
@@ -7095,7 +7095,7 @@ class basic_json
const auto N = j.m_value.object->size();
const auto N = j.m_value.object->size();
if (N <= 0x17)
if (N <= 0x17)
{
{
v.push_back(0xa0 +
N
); // 1 byte for object + size
v.push_back(0xa0 +
static_cast<uint8_t>(N)
); // 1 byte for object + size
}
}
else if (N <= 0xff)
else if (N <= 0xff)
{
{
...
...
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