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
aba8b584
Unverified
Commit
aba8b584
authored
Aug 16, 2017
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🔨
approach to un-break the changes for #462
parent
22b59693
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
2 deletions
+21
-2
json.hpp
src/json.hpp
+19
-0
unit-cbor.cpp
test/src/unit-cbor.cpp
+1
-1
unit-msgpack.cpp
test/src/unit-msgpack.cpp
+1
-1
No files found.
src/json.hpp
View file @
aba8b584
...
@@ -13182,6 +13182,15 @@ class basic_json
...
@@ -13182,6 +13182,15 @@ class basic_json
return
binary_reader
(
i
).
parse_cbor
(
strict
);
return
binary_reader
(
i
).
parse_cbor
(
strict
);
}
}
/*!
@copydoc from_cbor(detail::input_adapter, const bool)
*/
template
<
typename
A1
,
typename
A2
,
detail
::
enable_if_t
<
std
::
is_constructible
<
detail
::
input_adapter
,
A1
,
A2
>::
value
,
int
>
=
0
>
static
basic_json
from_cbor
(
A1
&&
a1
,
A2
&&
a2
,
const
bool
strict
=
true
)
{
return
binary_reader
(
detail
::
input_adapter
(
std
::
forward
<
A1
>
(
a1
),
std
::
forward
<
A2
>
(
a2
))).
parse_cbor
(
strict
);
}
/*!
/*!
@brief create a JSON value from an input in MessagePack format
@brief create a JSON value from an input in MessagePack format
...
@@ -13260,6 +13269,16 @@ class basic_json
...
@@ -13260,6 +13269,16 @@ class basic_json
return
binary_reader
(
i
).
parse_msgpack
(
strict
);
return
binary_reader
(
i
).
parse_msgpack
(
strict
);
}
}
/*!
@copydoc from_msgpack(detail::input_adapter, const bool)
*/
template
<
typename
A1
,
typename
A2
,
detail
::
enable_if_t
<
std
::
is_constructible
<
detail
::
input_adapter
,
A1
,
A2
>::
value
,
int
>
=
0
>
static
basic_json
from_msgpack
(
A1
&&
a1
,
A2
&&
a2
,
const
bool
strict
=
true
)
{
return
binary_reader
(
detail
::
input_adapter
(
std
::
forward
<
A1
>
(
a1
),
std
::
forward
<
A2
>
(
a2
))).
parse_msgpack
(
strict
);
}
/// @}
/// @}
//////////////////////////
//////////////////////////
...
...
test/src/unit-cbor.cpp
View file @
aba8b584
...
@@ -1322,7 +1322,7 @@ TEST_CASE("single CBOR roundtrip")
...
@@ -1322,7 +1322,7 @@ TEST_CASE("single CBOR roundtrip")
// check with different start index
// check with different start index
packed
.
insert
(
packed
.
begin
(),
5
,
0xff
);
packed
.
insert
(
packed
.
begin
(),
5
,
0xff
);
CHECK
(
j1
==
json
::
from_cbor
(
{
packed
.
begin
()
+
5
,
packed
.
end
()}
));
CHECK
(
j1
==
json
::
from_cbor
(
packed
.
begin
()
+
5
,
packed
.
end
()
));
}
}
}
}
...
...
test/src/unit-msgpack.cpp
View file @
aba8b584
...
@@ -1164,7 +1164,7 @@ TEST_CASE("single MessagePack roundtrip")
...
@@ -1164,7 +1164,7 @@ TEST_CASE("single MessagePack roundtrip")
// check with different start index
// check with different start index
packed
.
insert
(
packed
.
begin
(),
5
,
0xff
);
packed
.
insert
(
packed
.
begin
(),
5
,
0xff
);
CHECK
(
j1
==
json
::
from_msgpack
(
{
packed
.
begin
()
+
5
,
packed
.
end
()}
));
CHECK
(
j1
==
json
::
from_msgpack
(
packed
.
begin
()
+
5
,
packed
.
end
()
));
}
}
}
}
...
...
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