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
f1a2c28a
Commit
f1a2c28a
authored
Jun 25, 2014
by
Milo Yip
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14 from pah/fixes/misc
some minor fixes
parents
a56a0517
16029e6b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
allocators.h
include/rapidjson/allocators.h
+5
-0
document.h
include/rapidjson/document.h
+4
-4
filestream.h
include/rapidjson/filestream.h
+1
-1
No files found.
include/rapidjson/allocators.h
View file @
f1a2c28a
...
...
@@ -187,6 +187,11 @@ public:
static
void
Free
(
void
*
ptr
)
{
(
void
)
ptr
;
}
// Do nothing
private
:
//! Copy constructor is not permitted.
MemoryPoolAllocator
(
const
MemoryPoolAllocator
&
rhs
)
/* = delete */
;
//! Copy assignment operator is not permitted.
MemoryPoolAllocator
&
operator
=
(
const
MemoryPoolAllocator
&
rhs
)
/* = delete */
;
//! Creates a new chunk.
/*! \param capacity Capacity of the chunk in bytes.
*/
...
...
include/rapidjson/document.h
View file @
f1a2c28a
...
...
@@ -642,17 +642,17 @@ private:
};
// 12 bytes in 32-bit mode, 16 bytes in 64-bit mode
// Initialize this value as array with initial data, without calling destructor.
void
SetArrayRaw
(
GenericValue
*
values
,
SizeType
count
,
Allocator
&
alloc
ta
or
)
{
void
SetArrayRaw
(
GenericValue
*
values
,
SizeType
count
,
Allocator
&
alloc
at
or
)
{
flags_
=
kArrayFlag
;
data_
.
a
.
elements
=
(
GenericValue
*
)
alloc
ta
or
.
Malloc
(
count
*
sizeof
(
GenericValue
));
data_
.
a
.
elements
=
(
GenericValue
*
)
alloc
at
or
.
Malloc
(
count
*
sizeof
(
GenericValue
));
memcpy
(
data_
.
a
.
elements
,
values
,
count
*
sizeof
(
GenericValue
));
data_
.
a
.
size
=
data_
.
a
.
capacity
=
count
;
}
//! Initialize this value as object with initial data, without calling destructor.
void
SetObjectRaw
(
Member
*
members
,
SizeType
count
,
Allocator
&
alloc
ta
or
)
{
void
SetObjectRaw
(
Member
*
members
,
SizeType
count
,
Allocator
&
alloc
at
or
)
{
flags_
=
kObjectFlag
;
data_
.
o
.
members
=
(
Member
*
)
alloc
ta
or
.
Malloc
(
count
*
sizeof
(
Member
));
data_
.
o
.
members
=
(
Member
*
)
alloc
at
or
.
Malloc
(
count
*
sizeof
(
Member
));
memcpy
(
data_
.
o
.
members
,
members
,
count
*
sizeof
(
Member
));
data_
.
o
.
size
=
data_
.
o
.
capacity
=
count
;
}
...
...
include/rapidjson/filestream.h
View file @
f1a2c28a
...
...
@@ -16,7 +16,7 @@ class FileStream {
public
:
typedef
char
Ch
;
//!< Character type. Only support char.
FileStream
(
FILE
*
fp
)
:
fp_
(
fp
),
count_
(
0
)
{
Read
();
}
FileStream
(
FILE
*
fp
)
:
fp_
(
fp
),
c
urrent_
(
'\0'
),
c
ount_
(
0
)
{
Read
();
}
char
Peek
()
const
{
return
current_
;
}
char
Take
()
{
char
c
=
current_
;
Read
();
return
c
;
}
size_t
Tell
()
const
{
return
count_
;
}
...
...
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