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
abc61370
Commit
abc61370
authored
Mar 22, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed #48 (using nonmember begin/end)
parent
5526de13
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
json.hpp
src/json.hpp
+5
-4
json.hpp.re2c
src/json.hpp.re2c
+2
-2
No files found.
src/json.hpp
View file @
abc61370
...
@@ -410,7 +410,7 @@ class basic_json
...
@@ -410,7 +410,7 @@ class basic_json
{
{
Allocator
<
object_t
>
alloc
;
Allocator
<
object_t
>
alloc
;
m_value
.
object
=
alloc
.
allocate
(
1
);
m_value
.
object
=
alloc
.
allocate
(
1
);
alloc
.
construct
(
m_value
.
object
,
value
.
begin
(),
value
.
end
(
));
alloc
.
construct
(
m_value
.
object
,
std
::
begin
(
value
),
std
::
end
(
value
));
}
}
/// create an array (explicit)
/// create an array (explicit)
...
@@ -438,7 +438,7 @@ class basic_json
...
@@ -438,7 +438,7 @@ class basic_json
{
{
Allocator
<
array_t
>
alloc
;
Allocator
<
array_t
>
alloc
;
m_value
.
array
=
alloc
.
allocate
(
1
);
m_value
.
array
=
alloc
.
allocate
(
1
);
alloc
.
construct
(
m_value
.
array
,
value
.
begin
(),
value
.
end
(
));
alloc
.
construct
(
m_value
.
array
,
std
::
begin
(
value
),
std
::
end
(
value
));
}
}
/// create a string (explicit)
/// create a string (explicit)
...
@@ -3067,7 +3067,8 @@ class basic_json
...
@@ -3067,7 +3067,8 @@ class basic_json
@see <http://en.wikipedia.org/wiki/UTF-8#Sample_code>
@see <http://en.wikipedia.org/wiki/UTF-8#Sample_code>
*/
*/
inline
static
string_t
to_unicode
(
const
size_t
codepoint1
,
const
size_t
codepoint2
=
0
)
inline
static
string_t
to_unicode
(
const
size_t
codepoint1
,
const
size_t
codepoint2
=
0
)
{
{
string_t
result
;
string_t
result
;
...
@@ -3095,7 +3096,7 @@ class basic_json
...
@@ -3095,7 +3096,7 @@ class basic_json
if
(
codepoint
<=
0x7f
)
if
(
codepoint
<=
0x7f
)
{
{
// 1-byte characters: 0xxxxxxx (ASCI)
// 1-byte characters: 0xxxxxxx (ASCI
I
)
result
.
append
(
1
,
static_cast
<
typename
string_t
::
value_type
>
(
codepoint
));
result
.
append
(
1
,
static_cast
<
typename
string_t
::
value_type
>
(
codepoint
));
}
}
else
if
(
codepoint
<=
0x7ff
)
else
if
(
codepoint
<=
0x7ff
)
...
...
src/json.hpp.re2c
View file @
abc61370
...
@@ -410,7 +410,7 @@ class basic_json
...
@@ -410,7 +410,7 @@ class basic_json
{
{
Allocator<object_t> alloc;
Allocator<object_t> alloc;
m_value.object = alloc.allocate(1);
m_value.object = alloc.allocate(1);
alloc.construct(m_value.object,
value.begin(), value.end(
));
alloc.construct(m_value.object,
std::begin(value), std::end(value
));
}
}
/// create an array (explicit)
/// create an array (explicit)
...
@@ -438,7 +438,7 @@ class basic_json
...
@@ -438,7 +438,7 @@ class basic_json
{
{
Allocator<array_t> alloc;
Allocator<array_t> alloc;
m_value.array = alloc.allocate(1);
m_value.array = alloc.allocate(1);
alloc.construct(m_value.array,
value.begin(), value.end(
));
alloc.construct(m_value.array,
std::begin(value), std::end(value
));
}
}
/// create a string (explicit)
/// create a string (explicit)
...
...
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