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
dd45ba6f
Commit
dd45ba6f
authored
Jan 08, 2017
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🚧
renamed `version()` to `meta()`
parent
e1b89dd1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
9 deletions
+10
-9
json.hpp
src/json.hpp
+4
-4
json.hpp.re2c
src/json.hpp.re2c
+4
-4
unit-version.cpp
test/src/unit-version.cpp
+2
-1
No files found.
src/json.hpp
View file @
dd45ba6f
...
...
@@ -284,11 +284,11 @@ class basic_json
/*!
@brief returns version information on the library
*/
static
basic_json
version
()
static
basic_json
meta
()
{
basic_json
result
;
result
[
"copyright"
]
=
"(C) 2013-201
6
Niels Lohmann"
;
result
[
"copyright"
]
=
"(C) 2013-201
7
Niels Lohmann"
;
result
[
"name"
]
=
"JSON for Modern C++"
;
result
[
"url"
]
=
"https://github.com/nlohmann/json"
;
result
[
"version"
]
=
...
...
@@ -312,11 +312,11 @@ class basic_json
#endif
#if defined(__clang__)
result
[
"compiler"
]
=
{{
"family"
,
"clang"
},
{
"version"
,
CLANG_VERSION
}};
result
[
"compiler"
]
=
{{
"family"
,
"clang"
},
{
"version"
,
__clang_version__
}};
#elif defined(__ICC) || defined(__INTEL_COMPILER)
result
[
"compiler"
]
=
{{
"family"
,
"icc"
},
{
"version"
,
__INTEL_COMPILER
}};
#elif defined(__GNUC__) || defined(__GNUG__)
result
[
"compiler"
]
=
{{
"family"
,
"gcc"
},
{
"version"
,
GCC_VERSION
}};
result
[
"compiler"
]
=
{{
"family"
,
"gcc"
},
{
"version"
,
std
::
to_string
(
__GNUC__
)
+
"."
+
std
::
to_string
(
__GNUC_MINOR__
)
+
"."
+
std
::
to_string
(
__GNUC_PATCHLEVEL__
)
}};
#elif defined(__HP_cc) || defined(__HP_aCC)
result
[
"compiler"
]
=
"hp"
#elif defined(__IBMCPP__)
...
...
src/json.hpp.re2c
View file @
dd45ba6f
...
...
@@ -284,11 +284,11 @@ class basic_json
/*!
@brief returns version information on the library
*/
static basic_json
version
()
static basic_json
meta
()
{
basic_json result;
result["copyright"] = "(C) 2013-201
6
Niels Lohmann";
result["copyright"] = "(C) 2013-201
7
Niels Lohmann";
result["name"] = "JSON for Modern C++";
result["url"] = "https://github.com/nlohmann/json";
result["version"] =
...
...
@@ -312,11 +312,11 @@ class basic_json
#endif
#if defined(__clang__)
result["compiler"] = {{"family", "clang"}, {"version",
CLANG_VERSION
}};
result["compiler"] = {{"family", "clang"}, {"version",
__clang_version__
}};
#elif defined(__ICC) || defined(__INTEL_COMPILER)
result["compiler"] = {{"family", "icc"}, {"version", __INTEL_COMPILER}};
#elif defined(__GNUC__) || defined(__GNUG__)
result["compiler"] = {{"family", "gcc"}, {"version",
GCC_VERSION
}};
result["compiler"] = {{"family", "gcc"}, {"version",
std::to_string(__GNUC__) + "." + std::to_string(__GNUC_MINOR__) + "." + std::to_string(__GNUC_PATCHLEVEL__)
}};
#elif defined(__HP_cc) || defined(__HP_aCC)
result["compiler"] = "hp"
#elif defined(__IBMCPP__)
...
...
test/src/unit-version.cpp
View file @
dd45ba6f
...
...
@@ -35,6 +35,7 @@ TEST_CASE("version information")
{
SECTION
(
"version()"
)
{
CHECK
(
json
::
version
()[
"name"
]
==
"JSON for Modern C++"
);
CHECK
(
json
::
meta
()[
"name"
]
==
"JSON for Modern C++"
);
CHECK
(
json
::
meta
()[
"compiler"
]
==
"JSON for Modern C++"
);
}
}
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