|
JSON Voorhees
Killer JSON for C++
|
Represents a version used to extract and encode JSON objects from C++ classes. More...
#include <jsonv/version.hpp>
Public Types | |
| using | version_element = std::uint32_t |
Public Member Functions | |
| constexpr | version (version_element major=0, version_element minor=0) noexcept |
| Initialize an instance with the given major and minor version info. | |
| constexpr bool | empty () const noexcept |
Check if this version is an "empty" value – meaning major and minor are both 0. | |
| constexpr | operator std::uint64_t () const |
Convert this instance into a uint64_t. | |
| constexpr bool | operator== (const version &other) const |
| Test for equality with other. | |
| constexpr bool | operator!= (const version &other) const |
| Test for inequality with other. | |
| constexpr bool | operator< (const version &other) const |
| Check that this version is less than other. The comparison is done lexicographically. | |
| constexpr bool | operator<= (const version &other) const |
| Check that this version is less than or equal to other. The comparison is done lexicographically. | |
| constexpr bool | operator> (const version &other) const |
| Check that this version is greater than other. The comparison is done lexicographically. | |
| constexpr bool | operator>= (const version &other) const |
| Check that this version is greater than or equal to other. The comparison is done lexicographically. | |
Public Attributes | |
| version_element | major |
| version_element | minor |
Represents a version used to extract and encode JSON objects from C++ classes.
This is useful for API versioning: if you need certain fields to be serialized only after a certain version or only before a different one.
Definition at line 23 of file version.hpp.
| using jsonv::version::version_element = std::uint32_t |
Definition at line 26 of file version.hpp.
|
inlineconstexprnoexcept |
Initialize an instance with the given major and minor version info.
Definition at line 30 of file version.hpp.
Check if this version is an "empty" value – meaning major and minor are both 0.
Definition at line 36 of file version.hpp.
|
inlineexplicitconstexpr |
Convert this instance into a uint64_t.
The major version will be in the higher-order bits, while minor will be in the lower-order bits.
Definition at line 43 of file version.hpp.
Test for inequality with other.
Definition at line 56 of file version.hpp.
Check that this version is less than other. The comparison is done lexicographically.
Definition at line 62 of file version.hpp.
Check that this version is less than or equal to other. The comparison is done lexicographically.
Definition at line 68 of file version.hpp.
Test for equality with other.
Definition at line 50 of file version.hpp.
Check that this version is greater than other. The comparison is done lexicographically.
Definition at line 74 of file version.hpp.
Check that this version is greater than or equal to other. The comparison is done lexicographically.
Definition at line 80 of file version.hpp.
| version_element jsonv::version::major |
Definition at line 86 of file version.hpp.
| version_element jsonv::version::minor |
Definition at line 87 of file version.hpp.