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
a430d25f
Unverified
Commit
a430d25f
authored
Aug 16, 2020
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
📝
add more API documentation
parent
fb5c2013
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
140 additions
and
5 deletions
+140
-5
doc/docset/docSet.sql
doc/docset/docSet.sql
+2
-0
doc/mkdocs/docs/api/basic_json/index.md
doc/mkdocs/docs/api/basic_json/index.md
+5
-5
doc/mkdocs/docs/api/basic_json/operator<.md
doc/mkdocs/docs/api/basic_json/operator<.md
+73
-0
doc/mkdocs/docs/api/basic_json/operator>.md
doc/mkdocs/docs/api/basic_json/operator>.md
+58
-0
doc/mkdocs/mkdocs.yml
doc/mkdocs/mkdocs.yml
+2
-0
No files found.
doc/docset/docSet.sql
View file @
a430d25f
...
@@ -78,6 +78,8 @@ INSERT INTO searchIndex(name, type, path) VALUES ('operator!=', 'Operator', 'api
...
@@ -78,6 +78,8 @@ INSERT INTO searchIndex(name, type, path) VALUES ('operator!=', 'Operator', 'api
INSERT
INTO
searchIndex
(
name
,
type
,
path
)
VALUES
(
'operator+='
,
'Operator'
,
'api/basic_json/operator+=/index.html'
);
INSERT
INTO
searchIndex
(
name
,
type
,
path
)
VALUES
(
'operator+='
,
'Operator'
,
'api/basic_json/operator+=/index.html'
);
INSERT
INTO
searchIndex
(
name
,
type
,
path
)
VALUES
(
'operator='
,
'Operator'
,
'api/basic_json/operator=/index.html'
);
INSERT
INTO
searchIndex
(
name
,
type
,
path
)
VALUES
(
'operator='
,
'Operator'
,
'api/basic_json/operator=/index.html'
);
INSERT
INTO
searchIndex
(
name
,
type
,
path
)
VALUES
(
'operator=='
,
'Operator'
,
'api/basic_json/operator==/index.html'
);
INSERT
INTO
searchIndex
(
name
,
type
,
path
)
VALUES
(
'operator=='
,
'Operator'
,
'api/basic_json/operator==/index.html'
);
INSERT
INTO
searchIndex
(
name
,
type
,
path
)
VALUES
(
'operator<'
,
'Operator'
,
'api/basic_json/operator</index.html'
);
INSERT
INTO
searchIndex
(
name
,
type
,
path
)
VALUES
(
'operator>'
,
'Operator'
,
'api/basic_json/operator>/index.html'
);
INSERT
INTO
searchIndex
(
name
,
type
,
path
)
VALUES
(
'operator[]'
,
'Operator'
,
'api/basic_json/operator[]/index.html'
);
INSERT
INTO
searchIndex
(
name
,
type
,
path
)
VALUES
(
'operator[]'
,
'Operator'
,
'api/basic_json/operator[]/index.html'
);
INSERT
INTO
searchIndex
(
name
,
type
,
path
)
VALUES
(
'operator""_json'
,
'Literal'
,
'api/basic_json/operator_literal_json/index.html'
);
INSERT
INTO
searchIndex
(
name
,
type
,
path
)
VALUES
(
'operator""_json'
,
'Literal'
,
'api/basic_json/operator_literal_json/index.html'
);
INSERT
INTO
searchIndex
(
name
,
type
,
path
)
VALUES
(
'operator""_json_pointer'
,
'Literal'
,
'api/basic_json/operator_literal_json_pointer/index.html'
);
INSERT
INTO
searchIndex
(
name
,
type
,
path
)
VALUES
(
'operator""_json_pointer'
,
'Literal'
,
'api/basic_json/operator_literal_json_pointer/index.html'
);
...
...
doc/mkdocs/docs/api/basic_json/index.md
View file @
a430d25f
...
@@ -81,9 +81,9 @@ Todo
...
@@ -81,9 +81,9 @@ Todo
|
`const_pointer`
|
`#!cpp std::allocator_traits<allocator_type>::const_pointer`
|
|
`const_pointer`
|
`#!cpp std::allocator_traits<allocator_type>::const_pointer`
|
|
`iterator`
|
[
LegacyBidirectionalIterator
](
https://en.cppreference.com/w/cpp/named_req/BidirectionalIterator
)
|
|
`iterator`
|
[
LegacyBidirectionalIterator
](
https://en.cppreference.com/w/cpp/named_req/BidirectionalIterator
)
|
|
`const_iterator`
| constant
[
LegacyBidirectionalIterator
](
https://en.cppreference.com/w/cpp/named_req/BidirectionalIterator
)
|
|
`const_iterator`
| constant
[
LegacyBidirectionalIterator
](
https://en.cppreference.com/w/cpp/named_req/BidirectionalIterator
)
|
|
`reverse_iterator`
| |
|
`reverse_iterator`
|
reverse iterator, derived from
`iterator`
|
|
`const_reverse_iterator`
| |
|
`const_reverse_iterator`
|
reverse iterator, derived from
`const_iterator`
|
|
`iteration_proxy`
| |
|
`iteration_proxy`
|
helper type for
[
`items`
](
items.md
)
function
|
### JSON value data types
### JSON value data types
...
@@ -193,9 +193,9 @@ Access to the JSON value
...
@@ -193,9 +193,9 @@ Access to the JSON value
-
[
**operator==**
](
operator==.md
)
- comparison: equal
-
[
**operator==**
](
operator==.md
)
- comparison: equal
-
[
**operator!=**
](
operator!=.md
)
- comparison: not equal
-
[
**operator!=**
](
operator!=.md
)
- comparison: not equal
-
operator<
- comparison: less than
-
[
**operator<**
](
operator
<.md)
- comparison: less than
-
operator<= - comparison: less than or equal
-
operator<= - comparison: less than or equal
-
operator>
- comparison: greater than
-
[
**operator>**
](
operator>.md
)
- comparison: greater than
-
operator>= - comparison: greater than or equal
-
operator>= - comparison: greater than or equal
### Serialization
### Serialization
...
...
doc/mkdocs/docs/api/basic_json/operator<.md
0 → 100644
View file @
a430d25f
# basic_json::operator<
```
cpp
bool
operator
<
(
const_reference
lhs
,
const_reference
rhs
)
noexcept
,
template
<
typename
ScalarType
>
bool
operator
<
(
const_reference
lhs
,
const
ScalarType
rhs
)
noexcept
;
template
<
typename
ScalarType
>
bool
operator
<
(
ScalarType
lhs
,
const
const_reference
rhs
)
noexcept
;
```
Compares whether one JSON value
`lhs`
is less than another JSON value
`rhs`
according to the following rules:
-
If
`lhs`
and
`rhs`
have the same type, the values are compared using the default
`<`
operator.
-
Integer and floating-point numbers are automatically converted before comparison
-
Discarded values a
-
In case
`lhs`
and
`rhs`
have different types, the values are ignored and the order of the types is considered, which
is:
1.
null
2.
boolean
3.
number (all types)
4.
object
5.
array
6.
string
7.
binary
For instance, any boolean value is considered less than any string.
## Template parameters
`ScalarType`
: a scalar type according to
`std::is_scalar<ScalarType>::value`
## Parameters
`lhs`
(in)
: first value to consider
`rhs`
(in)
: second value to consider
## Return value
whether
`lhs`
is less than
`rhs`
## Exception safety
No-throw guarantee: this function never throws exceptions.
## Complexity
Linear.
## Example
??? example
The example demonstrates comparing several JSON types.
```cpp
--8<-- "examples/operator__less.cpp"
```
Output:
```json
--8<-- "examples/operator__less.output"
```
## Version history
-
Added in version 1.0.0.
doc/mkdocs/docs/api/basic_json/operator>.md
0 → 100644
View file @
a430d25f
# basic_json::operator>
```
cpp
bool
operator
>
(
const_reference
lhs
,
const_reference
rhs
)
noexcept
,
template
<
typename
ScalarType
>
bool
operator
>
(
const_reference
lhs
,
const
ScalarType
rhs
)
noexcept
;
template
<
typename
ScalarType
>
bool
operator
>
(
ScalarType
lhs
,
const
const_reference
rhs
)
noexcept
;
```
Compares whether one JSON value
`lhs`
is greater than another JSON value
`rhs`
by calculating
`#!cpp !(lhs <= rhs)`
.
## Template parameters
`ScalarType`
: a scalar type according to
`std::is_scalar<ScalarType>::value`
## Parameters
`lhs`
(in)
: first value to consider
`rhs`
(in)
: second value to consider
## Return value
whether
`lhs`
is greater than
`rhs`
## Exception safety
No-throw guarantee: this function never throws exceptions.
## Complexity
Linear.
## Example
??? example
The example demonstrates comparing several JSON types.
```cpp
--8<-- "examples/operator__greater.cpp"
```
Output:
```json
--8<-- "examples/operator__greater.output"
```
## Version history
-
Added in version 1.0.0.
doc/mkdocs/mkdocs.yml
View file @
a430d25f
...
@@ -146,6 +146,8 @@ nav:
...
@@ -146,6 +146,8 @@ nav:
-
api/basic_json/operator=.md
-
api/basic_json/operator=.md
-
api/basic_json/operator==.md
-
api/basic_json/operator==.md
-
api/basic_json/operator!=.md
-
api/basic_json/operator!=.md
-
api/basic_json/operator<.md
-
api/basic_json/operator>.md
-
api/basic_json/operator+=.md
-
api/basic_json/operator+=.md
-
api/basic_json/operator_literal_json.md
-
api/basic_json/operator_literal_json.md
-
api/basic_json/operator_literal_json_pointer.md
-
api/basic_json/operator_literal_json_pointer.md
...
...
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