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
3c68a796
Unverified
Commit
3c68a796
authored
Jan 23, 2018
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🔥
deprecated iterator_wrapper #874
Also fixed some warnings from GCC.
parent
7eabb6ba
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
40 additions
and
26 deletions
+40
-26
Makefile
Makefile
+1
-1
README.md
README.md
+1
-1
develop/detail/iterators/iteration_proxy.hpp
develop/detail/iterators/iteration_proxy.hpp
+1
-1
develop/detail/serializer.hpp
develop/detail/serializer.hpp
+5
-4
develop/json.hpp
develop/json.hpp
+12
-6
doc/avatars.png
doc/avatars.png
+0
-0
src/json.hpp
src/json.hpp
+18
-11
test/Makefile
test/Makefile
+1
-1
test/src/unit-items.cpp
test/src/unit-items.cpp
+0
-0
test/src/unit-regression.cpp
test/src/unit-regression.cpp
+1
-1
No files found.
Makefile
View file @
3c68a796
...
...
@@ -104,7 +104,7 @@ doctest:
# -Wno-keyword-macro: unit-tests use "#define private public"
# -Wno-deprecated-declarations: the library deprecated some functions
# -Wno-weak-vtables: exception class is defined inline, but has virtual method
# -Wno-range-loop-analysis: ite
rator_wrapper
tests "for(const auto i...)"
# -Wno-range-loop-analysis: ite
ms
tests "for(const auto i...)"
# -Wno-float-equal: not all comparisons in the tests can be replaced by Approx
# -Wno-switch-enum -Wno-covered-switch-default: pedantic/contradicting warnings about switches
# -Wno-padded: padding is nothing to warn about
...
...
README.md
View file @
3c68a796
...
...
@@ -933,7 +933,7 @@ I deeply appreciate the help of the following people.
-
[
bogemic
](
https://github.com/bogemic
)
fixed some C++17 deprecation warnings.
-
[
Eren Okka
](
https://github.com/erengy
)
fixed some MSVC warnings.
-
[
abolz
](
https://github.com/abolz
)
integrated the Grisu2 algorithm for proper floating-point formatting, allowing more roundtrip checks to succeed.
-
[
Vadim Evard
](
https://github.com/Pipeliner
)
fixed a Markdown issue in the README.
Thanks a lot for helping out! Please
[
let me know
](
mailto:mail@nlohmann.me
)
if I forgot someone.
...
...
develop/detail/iterators/iteration_proxy.hpp
View file @
3c68a796
...
...
@@ -9,7 +9,7 @@ namespace nlohmann
{
namespace
detail
{
/// proxy class for the ite
rator_wrapper functions
/// proxy class for the ite
ms() function
template
<
typename
IteratorType
>
class
iteration_proxy
{
private:
...
...
develop/detail/serializer.hpp
View file @
3c68a796
...
...
@@ -351,14 +351,15 @@ class serializer
{
if
(
codepoint
<=
0xFFFF
)
{
std
::
snprintf
(
string_buffer
.
data
()
+
bytes
,
7
,
"
\\
u%04x"
,
codepoint
);
std
::
snprintf
(
string_buffer
.
data
()
+
bytes
,
7
,
"
\\
u%04x"
,
static_cast
<
uint16_t
>
(
codepoint
));
bytes
+=
6
;
}
else
{
std
::
snprintf
(
string_buffer
.
data
()
+
bytes
,
13
,
"
\\
u%04x
\\
u%04x"
,
(
0xD7C0
+
(
codepoint
>>
10
)),
(
0xDC00
+
(
codepoint
&
0x3FF
)));
static_cast
<
uint16_t
>
(
0xD7C0
+
(
codepoint
>>
10
)),
static_cast
<
uint16_t
>
(
0xDC00
+
(
codepoint
&
0x3FF
)));
bytes
+=
12
;
}
}
...
...
@@ -598,7 +599,7 @@ class serializer
codep
=
(
state
!=
UTF8_ACCEPT
)
?
(
byte
&
0x3fu
)
|
(
codep
<<
6
)
:
(
0xff
>>
type
)
&
(
byte
);
:
static_cast
<
uint32_t
>
(
0xff
>>
type
)
&
(
byte
);
state
=
utf8d
[
256u
+
state
*
16u
+
type
];
return
state
;
...
...
develop/json.hpp
View file @
3c68a796
...
...
@@ -4480,18 +4480,24 @@ class basic_json
@note The name of this function is not yet final and may change in the
future.
@deprecated This stream operator is deprecated and will be removed in
future 4.0.0 of the library. Please use @ref items() instead;
that is, replace `json::iterator_wrapper(j)` with `j.items()`.
*/
JSON_DEPRECATED
static
iteration_proxy
<
iterator
>
iterator_wrapper
(
reference
ref
)
noexcept
{
return
iteration_proxy
<
iterator
>
(
ref
);
return
ref
.
items
(
);
}
/*!
@copydoc iterator_wrapper(reference)
*/
JSON_DEPRECATED
static
iteration_proxy
<
const_iterator
>
iterator_wrapper
(
const_reference
ref
)
noexcept
{
return
iteration_proxy
<
const_iterator
>
(
ref
);
return
ref
.
items
(
);
}
/*!
...
...
@@ -6127,8 +6133,8 @@ class basic_json
/*!
@brief serialize to stream
@deprecated This stream operator is deprecated and will be removed in
a
future
version
of the library. Please use
@deprecated This stream operator is deprecated and will be removed in
future
4.0.0
of the library. Please use
@ref operator<<(std::ostream&, const basic_json&)
instead; that is, replace calls like `j >> o;` with `o << j;`.
@since version 1.0.0; deprecated since version 3.0.0
...
...
@@ -6313,8 +6319,8 @@ class basic_json
/*!
@brief deserialize from stream
@deprecated This stream operator is deprecated and will be removed in
a
future version
of the library. Please use
@deprecated This stream operator is deprecated and will be removed in
version 4.0.0
of the library. Please use
@ref operator>>(std::istream&, basic_json&)
instead; that is, replace calls like `j << i;` with `i >> j;`.
@since version 1.0.0; deprecated since version 3.0.0
...
...
doc/avatars.png
View replaced file @
7eabb6ba
View file @
3c68a796
574 KB
|
W:
|
H:
575 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/json.hpp
View file @
3c68a796
...
...
@@ -4445,7 +4445,7 @@ namespace nlohmann
{
namespace
detail
{
/// proxy class for the ite
rator_wrapper functions
/// proxy class for the ite
ms() function
template
<
typename
IteratorType
>
class
iteration_proxy
{
private:
...
...
@@ -8498,14 +8498,15 @@ class serializer
{
if
(
codepoint
<=
0xFFFF
)
{
std
::
snprintf
(
string_buffer
.
data
()
+
bytes
,
7
,
"
\\
u%04x"
,
codepoint
);
std
::
snprintf
(
string_buffer
.
data
()
+
bytes
,
7
,
"
\\
u%04x"
,
static_cast
<
uint16_t
>
(
codepoint
));
bytes
+=
6
;
}
else
{
std
::
snprintf
(
string_buffer
.
data
()
+
bytes
,
13
,
"
\\
u%04x
\\
u%04x"
,
(
0xD7C0
+
(
codepoint
>>
10
)),
(
0xDC00
+
(
codepoint
&
0x3FF
)));
static_cast
<
uint16_t
>
(
0xD7C0
+
(
codepoint
>>
10
)),
static_cast
<
uint16_t
>
(
0xDC00
+
(
codepoint
&
0x3FF
)));
bytes
+=
12
;
}
}
...
...
@@ -8745,7 +8746,7 @@ class serializer
codep
=
(
state
!=
UTF8_ACCEPT
)
?
(
byte
&
0x3fu
)
|
(
codep
<<
6
)
:
(
0xff
>>
type
)
&
(
byte
);
:
static_cast
<
uint32_t
>
(
0xff
>>
type
)
&
(
byte
);
state
=
utf8d
[
256u
+
state
*
16u
+
type
];
return
state
;
...
...
@@ -13308,18 +13309,24 @@ class basic_json
@note The name of this function is not yet final and may change in the
future.
@deprecated This stream operator is deprecated and will be removed in
future 4.0.0 of the library. Please use @ref items() instead;
that is, replace `json::iterator_wrapper(j)` with `j.items()`.
*/
JSON_DEPRECATED
static
iteration_proxy
<
iterator
>
iterator_wrapper
(
reference
ref
)
noexcept
{
return
iteration_proxy
<
iterator
>
(
ref
);
return
ref
.
items
(
);
}
/*!
@copydoc iterator_wrapper(reference)
*/
JSON_DEPRECATED
static
iteration_proxy
<
const_iterator
>
iterator_wrapper
(
const_reference
ref
)
noexcept
{
return
iteration_proxy
<
const_iterator
>
(
ref
);
return
ref
.
items
(
);
}
/*!
...
...
@@ -14955,8 +14962,8 @@ class basic_json
/*!
@brief serialize to stream
@deprecated This stream operator is deprecated and will be removed in
a
future
version
of the library. Please use
@deprecated This stream operator is deprecated and will be removed in
future
4.0.0
of the library. Please use
@ref operator<<(std::ostream&, const basic_json&)
instead; that is, replace calls like `j >> o;` with `o << j;`.
@since version 1.0.0; deprecated since version 3.0.0
...
...
@@ -15141,8 +15148,8 @@ class basic_json
/*!
@brief deserialize from stream
@deprecated This stream operator is deprecated and will be removed in
a
future version
of the library. Please use
@deprecated This stream operator is deprecated and will be removed in
version 4.0.0
of the library. Please use
@ref operator>>(std::istream&, basic_json&)
instead; that is, replace calls like `j << i;` with `i >> j;`.
@since version 1.0.0; deprecated since version 3.0.0
...
...
test/Makefile
View file @
3c68a796
...
...
@@ -25,7 +25,7 @@ SOURCES = src/unit.cpp \
src/unit-element_access1.cpp
\
src/unit-element_access2.cpp
\
src/unit-inspection.cpp
\
src/unit-ite
rator_wrapper
.cpp
\
src/unit-ite
ms
.cpp
\
src/unit-iterators1.cpp
\
src/unit-iterators2.cpp
\
src/unit-merge_patch.cpp
\
...
...
test/src/unit-ite
rator_wrapper
.cpp
→
test/src/unit-ite
ms
.cpp
View file @
3c68a796
File moved
test/src/unit-regression.cpp
View file @
3c68a796
...
...
@@ -843,7 +843,7 @@ TEST_CASE("regression tests")
{
json
j
=
json
::
parse
(
"166020696663385964490"
);
CHECK
(
j
.
is_number_float
());
CHECK
(
j
.
get
<
json
::
number_float_t
>
()
==
static_cast
<
json
::
number_float_t
>
(
166020696663385964490.0
)
);
CHECK
(
j
.
get
<
json
::
number_float_t
>
()
==
166020696663385964490.0
);
}
SECTION
(
"issue #405 - Heap-buffer-overflow (OSS-Fuzz issue 342)"
)
...
...
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