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
635a4fc3
Commit
635a4fc3
authored
Dec 12, 2018
by
Jonathan Dumaresq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use namespace std when possible. Change the name of private variable.
parent
cf31193d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
include/nlohmann/detail/input/input_adapters.hpp
include/nlohmann/detail/input/input_adapters.hpp
+4
-4
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+4
-4
test/src/unit-testsuites.cpp
test/src/unit-testsuites.cpp
+5
-5
No files found.
include/nlohmann/detail/input/input_adapters.hpp
View file @
635a4fc3
...
...
@@ -53,17 +53,17 @@ Input adapter for stdio file access. This adapter read only 1 byte and do not us
class
file_input_adapter
:
public
input_adapter_protocol
{
public:
explicit
file_input_adapter
(
FILE
*
file
)
noexcept
:
file
(
file
)
explicit
file_input_adapter
(
std
::
FILE
*
f
)
noexcept
:
m_file
(
f
)
{}
std
::
char_traits
<
char
>::
int_type
get_character
()
noexcept
override
{
return
fgetc
(
file
);
return
std
::
fgetc
(
m_
file
);
}
private:
/// the file pointer to read from
FILE
*
file
;
std
::
FILE
*
m_
file
;
};
...
...
single_include/nlohmann/json.hpp
View file @
635a4fc3
...
...
@@ -2102,17 +2102,17 @@ Input adapter for stdio file access. This adapter read only 1 byte and do not us
class
file_input_adapter
:
public
input_adapter_protocol
{
public:
explicit
file_input_adapter
(
FILE
*
file
)
noexcept
:
file
(
file
)
explicit
file_input_adapter
(
std
::
FILE
*
f
)
noexcept
:
m_file
(
f
)
{}
std
::
char_traits
<
char
>::
int_type
get_character
()
noexcept
override
{
return
fgetc
(
file
);
return
std
::
fgetc
(
m_
file
);
}
private:
/// the file pointer to read from
FILE
*
file
;
std
::
FILE
*
m_
file
;
};
...
...
test/src/unit-testsuites.cpp
View file @
635a4fc3
...
...
@@ -386,35 +386,35 @@ TEST_CASE("json.org examples")
}
SECTION
(
"FILE 1.json"
)
{
std
::
unique_ptr
<
FILE
,
decltype
(
&
fclose
)
>
f
(
fopen
(
"test/data/json.org/1.json"
,
"r"
),
&
fclose
);
std
::
unique_ptr
<
std
::
FILE
,
decltype
(
&
std
::
fclose
)
>
f
(
std
::
fopen
(
"test/data/json.org/1.json"
,
"r"
),
&
std
::
fclose
);
json
j
;
CHECK_NOTHROW
(
j
.
parse
(
f
.
get
()));
}
SECTION
(
"FILE 2.json"
)
{
std
::
unique_ptr
<
FILE
,
decltype
(
&
fclose
)
>
f
(
fopen
(
"test/data/json.org/2.json"
,
"r"
),
&
fclose
);
std
::
unique_ptr
<
std
::
FILE
,
decltype
(
&
std
::
fclose
)
>
f
(
std
::
fopen
(
"test/data/json.org/2.json"
,
"r"
),
&
std
::
fclose
);
json
j
;
CHECK_NOTHROW
(
j
.
parse
(
f
.
get
()));
}
SECTION
(
"FILE 3.json"
)
{
std
::
unique_ptr
<
FILE
,
decltype
(
&
fclose
)
>
f
(
fopen
(
"test/data/json.org/3.json"
,
"r"
),
&
fclose
);
std
::
unique_ptr
<
std
::
FILE
,
decltype
(
&
std
::
fclose
)
>
f
(
std
::
fopen
(
"test/data/json.org/3.json"
,
"r"
),
&
std
::
fclose
);
json
j
;
CHECK_NOTHROW
(
j
.
parse
(
f
.
get
()));
}
SECTION
(
"FILE 4.json"
)
{
std
::
unique_ptr
<
FILE
,
decltype
(
&
fclose
)
>
f
(
fopen
(
"test/data/json.org/4.json"
,
"r"
),
&
fclose
);
std
::
unique_ptr
<
std
::
FILE
,
decltype
(
&
std
::
fclose
)
>
f
(
std
::
fopen
(
"test/data/json.org/4.json"
,
"r"
),
&
std
::
fclose
);
json
j
;
CHECK_NOTHROW
(
j
.
parse
(
f
.
get
()));
}
SECTION
(
"FILE 5.json"
)
{
std
::
unique_ptr
<
FILE
,
decltype
(
&
fclose
)
>
f
(
fopen
(
"test/data/json.org/5.json"
,
"r"
),
&
fclose
);
std
::
unique_ptr
<
std
::
FILE
,
decltype
(
&
std
::
fclose
)
>
f
(
std
::
fopen
(
"test/data/json.org/5.json"
,
"r"
),
&
std
::
fclose
);
json
j
;
CHECK_NOTHROW
(
j
.
parse
(
f
.
get
()));
}
...
...
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