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
bb740c43
Unverified
Commit
bb740c43
authored
Mar 05, 2017
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🔨
added user-defined exceptions 306
parent
aa842b4a
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
64 deletions
+87
-64
src/json.hpp
src/json.hpp
+4
-4
src/json.hpp.re2c
src/json.hpp.re2c
+4
-4
test/src/unit-element_access2.cpp
test/src/unit-element_access2.cpp
+79
-56
No files found.
src/json.hpp
View file @
bb740c43
...
@@ -4176,7 +4176,7 @@ class basic_json
...
@@ -4176,7 +4176,7 @@ class basic_json
@return copy of the element at key @a key or @a default_value if @a key
@return copy of the element at key @a key or @a default_value if @a key
is not found
is not found
@throw
std::domain_error
if JSON is not an object; example: `"cannot use
@throw
type_error.306
if JSON is not an object; example: `"cannot use
value() with null"`
value() with null"`
@complexity Logarithmic in the size of the container.
@complexity Logarithmic in the size of the container.
...
@@ -4209,7 +4209,7 @@ class basic_json
...
@@ -4209,7 +4209,7 @@ class basic_json
}
}
else
else
{
{
JSON_THROW
(
std
::
domain_error
(
"cannot use value() with "
+
type_name
()));
JSON_THROW
(
type_error
(
306
,
"cannot use value() with "
+
type_name
()));
}
}
}
}
...
@@ -4251,7 +4251,7 @@ class basic_json
...
@@ -4251,7 +4251,7 @@ class basic_json
@return copy of the element at key @a key or @a default_value if @a key
@return copy of the element at key @a key or @a default_value if @a key
is not found
is not found
@throw
std::domain_error
if JSON is not an object; example: `"cannot use
@throw
type_error.306
if JSON is not an object; example: `"cannot use
value() with null"`
value() with null"`
@complexity Logarithmic in the size of the container.
@complexity Logarithmic in the size of the container.
...
@@ -4281,7 +4281,7 @@ class basic_json
...
@@ -4281,7 +4281,7 @@ class basic_json
}
}
}
}
JSON_THROW
(
std
::
domain_error
(
"cannot use value() with "
+
type_name
()));
JSON_THROW
(
type_error
(
306
,
"cannot use value() with "
+
type_name
()));
}
}
/*!
/*!
...
...
src/json.hpp.re2c
View file @
bb740c43
...
@@ -4176,7 +4176,7 @@ class basic_json
...
@@ -4176,7 +4176,7 @@ class basic_json
@return copy of the element at key @a key or @a default_value if @a key
@return copy of the element at key @a key or @a default_value if @a key
is not found
is not found
@throw
std::domain_error
if JSON is not an object; example: `"cannot use
@throw
type_error.306
if JSON is not an object; example: `"cannot use
value() with null"`
value() with null"`
@complexity Logarithmic in the size of the container.
@complexity Logarithmic in the size of the container.
...
@@ -4209,7 +4209,7 @@ class basic_json
...
@@ -4209,7 +4209,7 @@ class basic_json
}
}
else
else
{
{
JSON_THROW(
std::domain_error(
"cannot use value() with " + type_name()));
JSON_THROW(
type_error(306,
"cannot use value() with " + type_name()));
}
}
}
}
...
@@ -4251,7 +4251,7 @@ class basic_json
...
@@ -4251,7 +4251,7 @@ class basic_json
@return copy of the element at key @a key or @a default_value if @a key
@return copy of the element at key @a key or @a default_value if @a key
is not found
is not found
@throw
std::domain_error
if JSON is not an object; example: `"cannot use
@throw
type_error.306
if JSON is not an object; example: `"cannot use
value() with null"`
value() with null"`
@complexity Logarithmic in the size of the container.
@complexity Logarithmic in the size of the container.
...
@@ -4281,7 +4281,7 @@ class basic_json
...
@@ -4281,7 +4281,7 @@ class basic_json
}
}
}
}
JSON_THROW(
std::domain_error(
"cannot use value() with " + type_name()));
JSON_THROW(
type_error(306,
"cannot use value() with " + type_name()));
}
}
/*!
/*!
...
...
test/src/unit-element_access2.cpp
View file @
bb740c43
This diff is collapsed.
Click to expand it.
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