Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
R
rapidjson
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
rapidjson
Commits
a576a0f5
Commit
a576a0f5
authored
May 09, 2015
by
miloyip
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into schema
parents
74f1bc58
63a1db09
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
pointer.h
include/rapidjson/pointer.h
+5
-4
No files found.
include/rapidjson/pointer.h
View file @
a576a0f5
...
...
@@ -205,7 +205,7 @@ public:
GenericPointer
Append
(
const
Token
&
token
,
Allocator
*
allocator
=
0
)
const
{
GenericPointer
r
;
r
.
allocator_
=
allocator
;
Ch
*
p
=
r
.
CopyFromRaw
(
*
this
,
1
,
(
token
.
length
+
1
)
*
sizeof
(
Ch
)
);
Ch
*
p
=
r
.
CopyFromRaw
(
*
this
,
1
,
token
.
length
+
1
);
std
::
memcpy
(
p
,
token
.
name
,
(
token
.
length
+
1
)
*
sizeof
(
Ch
));
r
.
tokens_
[
tokenCount_
].
name
=
p
;
r
.
tokens_
[
tokenCount_
].
length
=
token
.
length
;
...
...
@@ -284,6 +284,7 @@ public:
return
Append
(
token
.
GetString
(),
token
.
GetStringLength
(),
allocator
);
else
{
RAPIDJSON_ASSERT
(
token
.
IsUint64
());
RAPIDJSON_ASSERT
(
token
.
GetUint64
()
<=
SizeType
(
~
0
));
return
Append
(
static_cast
<
SizeType
>
(
token
.
GetUint64
()),
allocator
);
}
}
...
...
@@ -724,7 +725,7 @@ private:
/*!
\param rhs Source pointer.
\param extraToken Extra tokens to be allocated.
\param extraNameBufferSize Extra name buffer size to be allocated.
\param extraNameBufferSize Extra name buffer size
(in number of Ch)
to be allocated.
\return Start of non-occupied name buffer, for storing extra names.
*/
Ch
*
CopyFromRaw
(
const
GenericPointer
&
rhs
,
size_t
extraToken
=
0
,
size_t
extraNameBufferSize
=
0
)
{
...
...
@@ -734,7 +735,7 @@ private:
size_t
nameBufferSize
=
rhs
.
tokenCount_
;
// null terminators for tokens
for
(
Token
*
t
=
rhs
.
tokens_
;
t
!=
rhs
.
tokens_
+
rhs
.
tokenCount_
;
++
t
)
nameBufferSize
+=
t
->
length
;
nameBuffer_
=
(
Ch
*
)
allocator_
->
Malloc
(
nameBufferSize
*
sizeof
(
Ch
)
+
extraNameBufferSize
);
nameBuffer_
=
(
Ch
*
)
allocator_
->
Malloc
(
(
nameBufferSize
+
extraNameBufferSize
)
*
sizeof
(
Ch
)
);
std
::
memcpy
(
nameBuffer_
,
rhs
.
nameBuffer_
,
nameBufferSize
*
sizeof
(
Ch
));
tokenCount_
=
rhs
.
tokenCount_
+
extraToken
;
...
...
@@ -746,7 +747,7 @@ private:
for
(
Token
*
t
=
tokens_
;
t
!=
tokens_
+
rhs
.
tokenCount_
;
++
t
)
t
->
name
+=
diff
;
return
nameBuffer_
+
nameBufferSize
*
sizeof
(
Ch
)
;
return
nameBuffer_
+
nameBufferSize
;
}
//! Check whether a character should be percent-encoded.
...
...
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