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
d2e4f0b0
Unverified
Commit
d2e4f0b0
authored
Oct 28, 2018
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✏
fixed some typos
parent
f0c14595
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
31 deletions
+36
-31
parser.hpp
include/nlohmann/detail/input/parser.hpp
+2
-2
type_traits.hpp
include/nlohmann/detail/meta/type_traits.hpp
+9
-9
binary_writer.hpp
include/nlohmann/detail/output/binary_writer.hpp
+1
-0
serializer.hpp
include/nlohmann/detail/output/serializer.hpp
+4
-3
json.hpp
include/nlohmann/json.hpp
+1
-1
json.hpp
single_include/nlohmann/json.hpp
+19
-16
No files found.
include/nlohmann/detail/input/parser.hpp
View file @
d2e4f0b0
...
@@ -167,7 +167,7 @@ class parser
...
@@ -167,7 +167,7 @@ class parser
template
<
typename
SAX
>
template
<
typename
SAX
>
bool
sax_parse_internal
(
SAX
*
sax
)
bool
sax_parse_internal
(
SAX
*
sax
)
{
{
// stack to remember the hie
a
rarchy of structured values we are parsing
// stack to remember the hierarchy of structured values we are parsing
// true = array; false = object
// true = array; false = object
std
::
vector
<
bool
>
states
;
std
::
vector
<
bool
>
states
;
// value to avoid a goto (see comment where set to true)
// value to avoid a goto (see comment where set to true)
...
@@ -351,7 +351,7 @@ class parser
...
@@ -351,7 +351,7 @@ class parser
// we reached this line after we successfully parsed a value
// we reached this line after we successfully parsed a value
if
(
states
.
empty
())
if
(
states
.
empty
())
{
{
// empty stack: we reached the end of the hie
a
rarchy: done
// empty stack: we reached the end of the hierarchy: done
return
true
;
return
true
;
}
}
else
else
...
...
include/nlohmann/detail/meta/type_traits.hpp
View file @
d2e4f0b0
...
@@ -221,28 +221,28 @@ struct is_compatible_string_type_impl <
...
@@ -221,28 +221,28 @@ struct is_compatible_string_type_impl <
std
::
is_constructible
<
typename
BasicJsonType
::
string_t
,
CompatibleStringType
>::
value
;
std
::
is_constructible
<
typename
BasicJsonType
::
string_t
,
CompatibleStringType
>::
value
;
};
};
template
<
typename
BasicJsonType
,
typename
ConstrutibleStringType
>
template
<
typename
BasicJsonType
,
typename
Constru
c
tibleStringType
>
struct
is_compatible_string_type
struct
is_compatible_string_type
:
is_compatible_string_type_impl
<
BasicJsonType
,
ConstrutibleStringType
>
{};
:
is_compatible_string_type_impl
<
BasicJsonType
,
Constru
c
tibleStringType
>
{};
template
<
typename
BasicJsonType
,
typename
ConstrutibleStringType
,
template
<
typename
BasicJsonType
,
typename
Constru
c
tibleStringType
,
typename
=
void
>
typename
=
void
>
struct
is_constructible_string_type_impl
:
std
::
false_type
{};
struct
is_constructible_string_type_impl
:
std
::
false_type
{};
template
<
typename
BasicJsonType
,
typename
ConstrutibleStringType
>
template
<
typename
BasicJsonType
,
typename
Constru
c
tibleStringType
>
struct
is_constructible_string_type_impl
<
struct
is_constructible_string_type_impl
<
BasicJsonType
,
ConstrutibleStringType
,
BasicJsonType
,
Constru
c
tibleStringType
,
enable_if_t
<
is_detected_exact
<
typename
BasicJsonType
::
string_t
::
value_type
,
enable_if_t
<
is_detected_exact
<
typename
BasicJsonType
::
string_t
::
value_type
,
value_type_t
,
ConstrutibleStringType
>::
value
>>
value_type_t
,
Constru
c
tibleStringType
>::
value
>>
{
{
static
constexpr
auto
value
=
static
constexpr
auto
value
=
std
::
is_constructible
<
ConstrutibleStringType
,
std
::
is_constructible
<
Constru
c
tibleStringType
,
typename
BasicJsonType
::
string_t
>::
value
;
typename
BasicJsonType
::
string_t
>::
value
;
};
};
template
<
typename
BasicJsonType
,
typename
ConstrutibleStringType
>
template
<
typename
BasicJsonType
,
typename
Constru
c
tibleStringType
>
struct
is_constructible_string_type
struct
is_constructible_string_type
:
is_constructible_string_type_impl
<
BasicJsonType
,
ConstrutibleStringType
>
{};
:
is_constructible_string_type_impl
<
BasicJsonType
,
Constru
c
tibleStringType
>
{};
template
<
typename
BasicJsonType
,
typename
CompatibleArrayType
,
typename
=
void
>
template
<
typename
BasicJsonType
,
typename
CompatibleArrayType
,
typename
=
void
>
struct
is_compatible_array_type_impl
:
std
::
false_type
{};
struct
is_compatible_array_type_impl
:
std
::
false_type
{};
...
...
include/nlohmann/detail/output/binary_writer.hpp
View file @
d2e4f0b0
...
@@ -1287,6 +1287,7 @@ class binary_writer
...
@@ -1287,6 +1287,7 @@ class binary_writer
oa
->
write_characters
(
vec
.
data
(),
sizeof
(
NumberType
));
oa
->
write_characters
(
vec
.
data
(),
sizeof
(
NumberType
));
}
}
public
:
// The following to_char_type functions are implement the conversion
// The following to_char_type functions are implement the conversion
// between uint8_t and CharType. In case CharType is not unsigned,
// between uint8_t and CharType. In case CharType is not unsigned,
// such a conversion is required to allow values greater than 128.
// such a conversion is required to allow values greater than 128.
...
...
include/nlohmann/detail/output/serializer.hpp
View file @
d2e4f0b0
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include <nlohmann/detail/conversions/to_chars.hpp>
#include <nlohmann/detail/conversions/to_chars.hpp>
#include <nlohmann/detail/macro_scope.hpp>
#include <nlohmann/detail/macro_scope.hpp>
#include <nlohmann/detail/meta/cpp_future.hpp>
#include <nlohmann/detail/meta/cpp_future.hpp>
#include <nlohmann/detail/output/binary_writer.hpp>
#include <nlohmann/detail/output/output_adapters.hpp>
#include <nlohmann/detail/output/output_adapters.hpp>
#include <nlohmann/detail/value_t.hpp>
#include <nlohmann/detail/value_t.hpp>
...
@@ -449,9 +450,9 @@ class serializer
...
@@ -449,9 +450,9 @@ class serializer
}
}
else
else
{
{
string_buffer
[
bytes
++
]
=
'\xEF'
;
string_buffer
[
bytes
++
]
=
detail
::
binary_writer
<
BasicJsonType
,
char
>::
to_char_type
(
'\xEF'
)
;
string_buffer
[
bytes
++
]
=
'\xBF'
;
string_buffer
[
bytes
++
]
=
detail
::
binary_writer
<
BasicJsonType
,
char
>::
to_char_type
(
'\xBF'
)
;
string_buffer
[
bytes
++
]
=
'\xBD'
;
string_buffer
[
bytes
++
]
=
detail
::
binary_writer
<
BasicJsonType
,
char
>::
to_char_type
(
'\xBD'
)
;
}
}
bytes_after_last_accept
=
bytes
;
bytes_after_last_accept
=
bytes
;
}
}
...
...
include/nlohmann/json.hpp
View file @
d2e4f0b0
...
@@ -6750,7 +6750,7 @@ class basic_json
...
@@ -6750,7 +6750,7 @@ class basic_json
map | object | 0xBF
map | object | 0xBF
False | `false` | 0xF4
False | `false` | 0xF4
True | `true` | 0xF5
True | `true` | 0xF5
N
i
ll | `null` | 0xF6
N
u
ll | `null` | 0xF6
Half-Precision Float | number_float | 0xF9
Half-Precision Float | number_float | 0xF9
Single-Precision Float | number_float | 0xFA
Single-Precision Float | number_float | 0xFA
Double-Precision Float | number_float | 0xFB
Double-Precision Float | number_float | 0xFB
...
...
single_include/nlohmann/json.hpp
View file @
d2e4f0b0
...
@@ -612,28 +612,28 @@ struct is_compatible_string_type_impl <
...
@@ -612,28 +612,28 @@ struct is_compatible_string_type_impl <
std
::
is_constructible
<
typename
BasicJsonType
::
string_t
,
CompatibleStringType
>::
value
;
std
::
is_constructible
<
typename
BasicJsonType
::
string_t
,
CompatibleStringType
>::
value
;
};
};
template
<
typename
BasicJsonType
,
typename
ConstrutibleStringType
>
template
<
typename
BasicJsonType
,
typename
Constru
c
tibleStringType
>
struct
is_compatible_string_type
struct
is_compatible_string_type
:
is_compatible_string_type_impl
<
BasicJsonType
,
ConstrutibleStringType
>
{};
:
is_compatible_string_type_impl
<
BasicJsonType
,
Constru
c
tibleStringType
>
{};
template
<
typename
BasicJsonType
,
typename
ConstrutibleStringType
,
template
<
typename
BasicJsonType
,
typename
Constru
c
tibleStringType
,
typename
=
void
>
typename
=
void
>
struct
is_constructible_string_type_impl
:
std
::
false_type
{};
struct
is_constructible_string_type_impl
:
std
::
false_type
{};
template
<
typename
BasicJsonType
,
typename
ConstrutibleStringType
>
template
<
typename
BasicJsonType
,
typename
Constru
c
tibleStringType
>
struct
is_constructible_string_type_impl
<
struct
is_constructible_string_type_impl
<
BasicJsonType
,
ConstrutibleStringType
,
BasicJsonType
,
Constru
c
tibleStringType
,
enable_if_t
<
is_detected_exact
<
typename
BasicJsonType
::
string_t
::
value_type
,
enable_if_t
<
is_detected_exact
<
typename
BasicJsonType
::
string_t
::
value_type
,
value_type_t
,
ConstrutibleStringType
>::
value
>>
value_type_t
,
Constru
c
tibleStringType
>::
value
>>
{
{
static
constexpr
auto
value
=
static
constexpr
auto
value
=
std
::
is_constructible
<
ConstrutibleStringType
,
std
::
is_constructible
<
Constru
c
tibleStringType
,
typename
BasicJsonType
::
string_t
>::
value
;
typename
BasicJsonType
::
string_t
>::
value
;
};
};
template
<
typename
BasicJsonType
,
typename
ConstrutibleStringType
>
template
<
typename
BasicJsonType
,
typename
Constru
c
tibleStringType
>
struct
is_constructible_string_type
struct
is_constructible_string_type
:
is_constructible_string_type_impl
<
BasicJsonType
,
ConstrutibleStringType
>
{};
:
is_constructible_string_type_impl
<
BasicJsonType
,
Constru
c
tibleStringType
>
{};
template
<
typename
BasicJsonType
,
typename
CompatibleArrayType
,
typename
=
void
>
template
<
typename
BasicJsonType
,
typename
CompatibleArrayType
,
typename
=
void
>
struct
is_compatible_array_type_impl
:
std
::
false_type
{};
struct
is_compatible_array_type_impl
:
std
::
false_type
{};
...
@@ -4979,7 +4979,7 @@ class parser
...
@@ -4979,7 +4979,7 @@ class parser
template
<
typename
SAX
>
template
<
typename
SAX
>
bool
sax_parse_internal
(
SAX
*
sax
)
bool
sax_parse_internal
(
SAX
*
sax
)
{
{
// stack to remember the hie
a
rarchy of structured values we are parsing
// stack to remember the hierarchy of structured values we are parsing
// true = array; false = object
// true = array; false = object
std
::
vector
<
bool
>
states
;
std
::
vector
<
bool
>
states
;
// value to avoid a goto (see comment where set to true)
// value to avoid a goto (see comment where set to true)
...
@@ -5163,7 +5163,7 @@ class parser
...
@@ -5163,7 +5163,7 @@ class parser
// we reached this line after we successfully parsed a value
// we reached this line after we successfully parsed a value
if
(
states
.
empty
())
if
(
states
.
empty
())
{
{
// empty stack: we reached the end of the hie
a
rarchy: done
// empty stack: we reached the end of the hierarchy: done
return
true
;
return
true
;
}
}
else
else
...
@@ -6526,7 +6526,7 @@ class binary_reader
...
@@ -6526,7 +6526,7 @@ class binary_reader
@param[in, out] result A reference to the string variable where the read
@param[in, out] result A reference to the string variable where the read
string is to be stored.
string is to be stored.
@tparam NumberType The type of the length @a len
@tparam NumberType The type of the length @a len
@pre len >
0
@pre len >
= 1
@return `true` if the string was successfully parsed
@return `true` if the string was successfully parsed
*/
*/
template
<
typename
NumberType
>
template
<
typename
NumberType
>
...
@@ -9612,6 +9612,7 @@ class binary_writer
...
@@ -9612,6 +9612,7 @@ class binary_writer
oa
->
write_characters
(
vec
.
data
(),
sizeof
(
NumberType
));
oa
->
write_characters
(
vec
.
data
(),
sizeof
(
NumberType
));
}
}
public
:
// The following to_char_type functions are implement the conversion
// The following to_char_type functions are implement the conversion
// between uint8_t and CharType. In case CharType is not unsigned,
// between uint8_t and CharType. In case CharType is not unsigned,
// such a conversion is required to allow values greater than 128.
// such a conversion is required to allow values greater than 128.
...
@@ -10780,6 +10781,8 @@ char* to_chars(char* first, const char* last, FloatType value)
...
@@ -10780,6 +10781,8 @@ char* to_chars(char* first, const char* last, FloatType value)
// #include <nlohmann/detail/meta/cpp_future.hpp>
// #include <nlohmann/detail/meta/cpp_future.hpp>
// #include <nlohmann/detail/output/binary_writer.hpp>
// #include <nlohmann/detail/output/output_adapters.hpp>
// #include <nlohmann/detail/output/output_adapters.hpp>
// #include <nlohmann/detail/value_t.hpp>
// #include <nlohmann/detail/value_t.hpp>
...
@@ -11214,9 +11217,9 @@ class serializer
...
@@ -11214,9 +11217,9 @@ class serializer
}
}
else
else
{
{
string_buffer
[
bytes
++
]
=
'\xEF'
;
string_buffer
[
bytes
++
]
=
detail
::
binary_writer
<
BasicJsonType
,
char
>::
to_char_type
(
'\xEF'
)
;
string_buffer
[
bytes
++
]
=
'\xBF'
;
string_buffer
[
bytes
++
]
=
detail
::
binary_writer
<
BasicJsonType
,
char
>::
to_char_type
(
'\xBF'
)
;
string_buffer
[
bytes
++
]
=
'\xBD'
;
string_buffer
[
bytes
++
]
=
detail
::
binary_writer
<
BasicJsonType
,
char
>::
to_char_type
(
'\xBD'
)
;
}
}
bytes_after_last_accept
=
bytes
;
bytes_after_last_accept
=
bytes
;
}
}
...
@@ -19011,7 +19014,7 @@ class basic_json
...
@@ -19011,7 +19014,7 @@ class basic_json
map | object | 0xBF
map | object | 0xBF
False | `false` | 0xF4
False | `false` | 0xF4
True | `true` | 0xF5
True | `true` | 0xF5
N
i
ll | `null` | 0xF6
N
u
ll | `null` | 0xF6
Half-Precision Float | number_float | 0xF9
Half-Precision Float | number_float | 0xF9
Single-Precision Float | number_float | 0xFA
Single-Precision Float | number_float | 0xFA
Double-Precision Float | number_float | 0xFB
Double-Precision Float | number_float | 0xFB
...
...
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