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
87c250d8
Commit
87c250d8
authored
Feb 07, 2015
by
Niels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
another commit to trigger coverage
parent
cc274f81
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
326 additions
and
657 deletions
+326
-657
src/json.hpp
src/json.hpp
+316
-654
src/json.hpp.re2c
src/json.hpp.re2c
+10
-3
No files found.
src/json.hpp
View file @
87c250d8
This diff is collapsed.
Click to expand it.
src/json.hpp.re2c
View file @
87c250d8
...
@@ -909,31 +909,37 @@ class basic_json
...
@@ -909,31 +909,37 @@ class basic_json
{
{
break;
break;
}
}
case (value_t::number_integer):
case (value_t::number_integer):
{
{
m_value.number_integer = 0;
m_value.number_integer = 0;
break;
break;
}
}
case (value_t::number_float):
case (value_t::number_float):
{
{
m_value.number_float = 0.0;
m_value.number_float = 0.0;
break;
break;
}
}
case (value_t::boolean):
case (value_t::boolean):
{
{
m_value.boolean = false;
m_value.boolean = false;
break;
break;
}
}
case (value_t::string):
case (value_t::string):
{
{
m_value.string->clear();
m_value.string->clear();
break;
break;
}
}
case (value_t::array):
case (value_t::array):
{
{
m_value.array->clear();
m_value.array->clear();
break;
break;
}
}
case (value_t::object):
case (value_t::object):
{
{
m_value.object->clear();
m_value.object->clear();
...
@@ -2730,7 +2736,7 @@ class basic_json
...
@@ -2730,7 +2736,7 @@ class basic_json
@todo Take care of Unicode.
@todo Take care of Unicode.
*/
*/
std::string get_string() const
inline
std::string get_string() const
{
{
return std::string(
return std::string(
reinterpret_cast<const char*>(current_re2c + 1),
reinterpret_cast<const char*>(current_re2c + 1),
...
@@ -2738,6 +2744,7 @@ class basic_json
...
@@ -2738,6 +2744,7 @@ class basic_json
);
);
}
}
private:
/// the buffer
/// the buffer
std::string buffer;
std::string buffer;
/// a pointer to the next character to read from the buffer
/// a pointer to the next character to read from the buffer
...
@@ -2785,7 +2792,7 @@ template <>
...
@@ -2785,7 +2792,7 @@ template <>
struct hash<nlohmann::json>
struct hash<nlohmann::json>
{
{
/// return a hash value for a JSON object
/// return a hash value for a JSON object
size_t operator()(const nlohmann::json& j) const
inline
size_t operator()(const nlohmann::json& j) const
{
{
// a naive hashing via the string representation
// a naive hashing via the string representation
return hash<std::string>()(j.dump());
return hash<std::string>()(j.dump());
...
@@ -2801,7 +2808,7 @@ no parse error occurred.
...
@@ -2801,7 +2808,7 @@ no parse error occurred.
@param s a string representation of a JSON object
@param s a string representation of a JSON object
@return a JSON object
@return a JSON object
*/
*/
nlohmann::json operator "" _json(const char* s, std::size_t)
inline
nlohmann::json operator "" _json(const char* s, std::size_t)
{
{
return nlohmann::json::parse(s);
return nlohmann::json::parse(s);
}
}
...
...
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