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
d5755344
Commit
d5755344
authored
May 28, 2020
by
Francois Chabot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
brought back the from_*(ptr, len) syntax with a deprecation warning
parent
248f3102
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
0 deletions
+98
-0
include/nlohmann/json.hpp
include/nlohmann/json.hpp
+49
-0
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+49
-0
No files found.
include/nlohmann/json.hpp
View file @
d5755344
...
...
@@ -6639,6 +6639,7 @@ class basic_json
return
result
;
}
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
parse
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
parse
(
detail
::
span_input_adapter
&&
i
,
const
parser_callback_t
cb
=
nullptr
,
...
...
@@ -6661,6 +6662,8 @@ class basic_json
return
parser
(
detail
::
input_adapter
(
std
::
move
(
first
),
std
::
move
(
last
))).
accept
(
true
);
}
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
accept
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
bool
accept
(
detail
::
span_input_adapter
&&
i
)
{
return
parser
(
i
.
get
()).
accept
(
true
);
...
...
@@ -6728,6 +6731,7 @@ class basic_json
}
template
<
typename
SAX
>
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
sax_parse
(
ptr
,
ptr
+
len
,
...))
JSON_HEDLEY_NON_NULL
(
2
)
static
bool
sax_parse
(
detail
::
span_input_adapter
&&
i
,
SAX
*
sax
,
input_format_t
format
=
input_format_t
::
json
,
...
...
@@ -7403,6 +7407,18 @@ class basic_json
return
res
?
result
:
basic_json
(
value_t
::
discarded
);
}
template
<
typename
T
>
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
from_cbor
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_cbor
(
const
T
*
ptr
,
std
::
size_t
len
,
const
bool
strict
=
true
,
const
bool
allow_exceptions
=
true
)
{
return
from_cbor
(
ptr
,
ptr
+
len
,
strict
,
allow_exceptions
);
}
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
from_cbor
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_cbor
(
detail
::
span_input_adapter
&&
i
,
const
bool
strict
=
true
,
...
...
@@ -7531,6 +7547,17 @@ class basic_json
}
template
<
typename
T
>
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
from_msgpack
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_msgpack
(
const
T
*
ptr
,
std
::
size_t
len
,
const
bool
strict
=
true
,
const
bool
allow_exceptions
=
true
)
{
return
from_msgpack
(
ptr
,
ptr
+
len
,
strict
,
allow_exceptions
);
}
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
from_msgpack
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_msgpack
(
detail
::
span_input_adapter
&&
i
,
const
bool
strict
=
true
,
...
...
@@ -7634,7 +7661,18 @@ class basic_json
return
res
?
result
:
basic_json
(
value_t
::
discarded
);
}
template
<
typename
T
>
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
from_ubjson
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_ubjson
(
const
T
*
ptr
,
std
::
size_t
len
,
const
bool
strict
=
true
,
const
bool
allow_exceptions
=
true
)
{
return
from_ubjson
(
ptr
,
ptr
+
len
,
strict
,
allow_exceptions
);
}
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
from_ubjson
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_ubjson
(
detail
::
span_input_adapter
&&
i
,
const
bool
strict
=
true
,
const
bool
allow_exceptions
=
true
)
...
...
@@ -7736,6 +7774,17 @@ class basic_json
return
res
?
result
:
basic_json
(
value_t
::
discarded
);
}
template
<
typename
T
>
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
from_bson
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_bson
(
const
T
*
ptr
,
std
::
size_t
len
,
const
bool
strict
=
true
,
const
bool
allow_exceptions
=
true
)
{
return
from_bson
(
ptr
,
ptr
+
len
,
strict
,
allow_exceptions
);
}
JSON_HEDLEY_DEPRECATED
(
3.8.0
,
from_bson
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_bson
(
detail
::
span_input_adapter
&&
i
,
const
bool
strict
=
true
,
...
...
single_include/nlohmann/json.hpp
View file @
d5755344
...
...
@@ -22402,6 +22402,7 @@ class basic_json
return
result
;
}
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
parse
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
parse
(
detail
::
span_input_adapter
&&
i
,
const
parser_callback_t
cb
=
nullptr
,
...
...
@@ -22424,6 +22425,8 @@ class basic_json
return
parser
(
detail
::
input_adapter
(
std
::
move
(
first
),
std
::
move
(
last
))).
accept
(
true
);
}
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
accept
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
bool
accept
(
detail
::
span_input_adapter
&&
i
)
{
return
parser
(
i
.
get
()).
accept
(
true
);
...
...
@@ -22491,6 +22494,7 @@ class basic_json
}
template
<
typename
SAX
>
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
sax_parse
(
ptr
,
ptr
+
len
,
...))
JSON_HEDLEY_NON_NULL
(
2
)
static
bool
sax_parse
(
detail
::
span_input_adapter
&&
i
,
SAX
*
sax
,
input_format_t
format
=
input_format_t
::
json
,
...
...
@@ -23166,6 +23170,18 @@ class basic_json
return
res
?
result
:
basic_json
(
value_t
::
discarded
);
}
template
<
typename
T
>
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
from_cbor
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_cbor
(
const
T
*
ptr
,
std
::
size_t
len
,
const
bool
strict
=
true
,
const
bool
allow_exceptions
=
true
)
{
return
from_cbor
(
ptr
,
ptr
+
len
,
strict
,
allow_exceptions
);
}
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
from_cbor
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_cbor
(
detail
::
span_input_adapter
&&
i
,
const
bool
strict
=
true
,
...
...
@@ -23294,6 +23310,17 @@ class basic_json
}
template
<
typename
T
>
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
from_msgpack
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_msgpack
(
const
T
*
ptr
,
std
::
size_t
len
,
const
bool
strict
=
true
,
const
bool
allow_exceptions
=
true
)
{
return
from_msgpack
(
ptr
,
ptr
+
len
,
strict
,
allow_exceptions
);
}
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
from_msgpack
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_msgpack
(
detail
::
span_input_adapter
&&
i
,
const
bool
strict
=
true
,
...
...
@@ -23397,7 +23424,18 @@ class basic_json
return
res
?
result
:
basic_json
(
value_t
::
discarded
);
}
template
<
typename
T
>
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
from_ubjson
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_ubjson
(
const
T
*
ptr
,
std
::
size_t
len
,
const
bool
strict
=
true
,
const
bool
allow_exceptions
=
true
)
{
return
from_ubjson
(
ptr
,
ptr
+
len
,
strict
,
allow_exceptions
);
}
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
from_ubjson
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_ubjson
(
detail
::
span_input_adapter
&&
i
,
const
bool
strict
=
true
,
const
bool
allow_exceptions
=
true
)
...
...
@@ -23499,6 +23537,17 @@ class basic_json
return
res
?
result
:
basic_json
(
value_t
::
discarded
);
}
template
<
typename
T
>
JSON_HEDLEY_DEPRECATED_FOR
(
3.8.0
,
from_bson
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_bson
(
const
T
*
ptr
,
std
::
size_t
len
,
const
bool
strict
=
true
,
const
bool
allow_exceptions
=
true
)
{
return
from_bson
(
ptr
,
ptr
+
len
,
strict
,
allow_exceptions
);
}
JSON_HEDLEY_DEPRECATED
(
3.8.0
,
from_bson
(
ptr
,
ptr
+
len
))
JSON_HEDLEY_WARN_UNUSED_RESULT
static
basic_json
from_bson
(
detail
::
span_input_adapter
&&
i
,
const
bool
strict
=
true
,
...
...
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