mirror of
https://github.com/tristanpenman/valijson.git
synced 2024-12-12 10:13:51 +01:00
Merge pull request #188 from Rail-Connected/pullreq1
Various cosmetic fixes.
This commit is contained in:
commit
6599e8b33a
@ -135,7 +135,7 @@ Valijson's JSON Reference implementation requires that two callback functions ar
|
||||
|
||||
## Test Suite
|
||||
|
||||
Valijson's' test suite currently contains several hand-crafted tests and uses the standard [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) to test support for parts of the JSON Schema feature set that have been implemented.
|
||||
Valijson's test suite currently contains several hand-crafted tests and uses the standard [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) to test support for parts of the JSON Schema feature set that have been implemented.
|
||||
|
||||
### cmake
|
||||
|
||||
@ -152,7 +152,7 @@ make
|
||||
```
|
||||
## How to add this library to your cmake target
|
||||
|
||||
Valijson can be integrated either as git submodule or with find_package().
|
||||
Valijson can be integrated either as git submodule or with `find_package()`.
|
||||
|
||||
### Valijson as git submodule
|
||||
|
||||
@ -210,7 +210,7 @@ This can then be used in your project with a single `#include`:
|
||||
|
||||
#include "valijson_nlohmann_bundled.hpp"
|
||||
|
||||
An example can be found in [examples/valijson_nlohmann_bundled_test.cpp](examples/valijson_nlohmann_bundled_test.cpp).
|
||||
An example can be found in [examples/valijson\_nlohmann\_bundled\_test.cpp](examples/valijson_nlohmann_bundled_test.cpp).
|
||||
|
||||
Note: the bundled version of Valijson always embeds a compatibility header in place of `std::optional`.
|
||||
|
||||
@ -270,7 +270,7 @@ When building the test suite, Boost 1.54, Qt 5 and Poco are optional dependencie
|
||||
|
||||
Valijson supports JSON documents loaded using various JSON parser libraries. It has been tested against the following versions of these libraries:
|
||||
|
||||
- [boost::property_tree 1.54](http://www.boost.org/doc/libs/1_54_0/doc/html/boost_propertytree/synopsis.html)
|
||||
- [boost::property\_tree 1.54](http://www.boost.org/doc/libs/1_54_0/doc/html/boost_propertytree/synopsis.html)
|
||||
- [Boost.JSON 1.75](https://www.boost.org/doc/libs/1_75_0/libs/json/doc/html/index.html)
|
||||
- [json11 (commit afcc8d0)](https://github.com/dropbox/json11/tree/afcc8d0d82b1ce2df587a7a0637d05ba493bf5e6)
|
||||
- [jsoncpp 1.9.4](https://github.com/open-source-parsers/jsoncpp/archive/1.9.4.tar.gz)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -7,8 +7,8 @@
|
||||
// The idea and interface is based on Boost.Optional library
|
||||
// authored by Fernando Luis Cacciola Carballal
|
||||
|
||||
# ifndef ___OPTIONAL_HPP___
|
||||
# define ___OPTIONAL_HPP___
|
||||
# ifndef OPTIONAL_HPP
|
||||
# define OPTIONAL_HPP
|
||||
|
||||
# include <utility>
|
||||
# include <type_traits>
|
||||
@ -270,7 +270,7 @@ namespace std{
|
||||
unsigned char dummy_;
|
||||
T value_;
|
||||
|
||||
constexpr storage_t( trivial_init_t ) noexcept : dummy_() {};
|
||||
constexpr storage_t( trivial_init_t ) noexcept : dummy_() {}
|
||||
|
||||
template <class... Args>
|
||||
constexpr storage_t( Args&&... args ) : value_(constexpr_forward<Args>(args)...) {}
|
||||
@ -285,7 +285,7 @@ namespace std{
|
||||
unsigned char dummy_;
|
||||
T value_;
|
||||
|
||||
constexpr constexpr_storage_t( trivial_init_t ) noexcept : dummy_() {};
|
||||
constexpr constexpr_storage_t( trivial_init_t ) noexcept : dummy_() {}
|
||||
|
||||
template <class... Args>
|
||||
constexpr constexpr_storage_t( Args&&... args ) : value_(constexpr_forward<Args>(args)...) {}
|
||||
@ -300,7 +300,7 @@ namespace std{
|
||||
bool init_;
|
||||
storage_t<T> storage_;
|
||||
|
||||
constexpr optional_base() noexcept : init_(false), storage_(trivial_init) {};
|
||||
constexpr optional_base() noexcept : init_(false), storage_(trivial_init) {}
|
||||
|
||||
explicit constexpr optional_base(const T& v) : init_(true), storage_(v) {}
|
||||
|
||||
@ -323,7 +323,7 @@ namespace std{
|
||||
bool init_;
|
||||
constexpr_storage_t<T> storage_;
|
||||
|
||||
constexpr constexpr_optional_base() noexcept : init_(false), storage_(trivial_init) {};
|
||||
constexpr constexpr_optional_base() noexcept : init_(false), storage_(trivial_init) {}
|
||||
|
||||
explicit constexpr constexpr_optional_base(const T& v) : init_(true), storage_(v) {}
|
||||
|
||||
@ -398,8 +398,8 @@ namespace std{
|
||||
typedef T value_type;
|
||||
|
||||
// 20.5.5.1, constructors
|
||||
constexpr optional() noexcept : OptionalBase<T>() {};
|
||||
constexpr optional(nullopt_t) noexcept : OptionalBase<T>() {};
|
||||
constexpr optional() noexcept : OptionalBase<T>() {}
|
||||
constexpr optional(nullopt_t) noexcept : OptionalBase<T>() {}
|
||||
|
||||
optional(const optional& rhs)
|
||||
: OptionalBase<T>()
|
||||
@ -1040,4 +1040,4 @@ namespace std
|
||||
# undef TR2_OPTIONAL_REQUIRES
|
||||
# undef TR2_OPTIONAL_ASSERTED_EXPRESSION
|
||||
|
||||
# endif //___OPTIONAL_HPP___
|
||||
# endif //OPTIONAL_HPP
|
||||
|
@ -145,7 +145,7 @@ public:
|
||||
{
|
||||
result = 0;
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
StdStringObject asObject() const
|
||||
{
|
||||
@ -181,67 +181,67 @@ public:
|
||||
return new StdStringFrozenValue(m_value);
|
||||
}
|
||||
|
||||
static StdStringArray getArray()
|
||||
VALIJSON_NORETURN static StdStringArray getArray()
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
size_t getArraySize() const override
|
||||
VALIJSON_NORETURN size_t getArraySize() const override
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
bool getArraySize(size_t &) const override
|
||||
VALIJSON_NORETURN bool getArraySize(size_t &) const override
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
bool getBool() const override
|
||||
VALIJSON_NORETURN bool getBool() const override
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
bool getBool(bool &) const override
|
||||
VALIJSON_NORETURN bool getBool(bool &) const override
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
double getDouble() const override
|
||||
VALIJSON_NORETURN double getDouble() const override
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
bool getDouble(double &) const override
|
||||
VALIJSON_NORETURN bool getDouble(double &) const override
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
int64_t getInteger() const override
|
||||
VALIJSON_NORETURN int64_t getInteger() const override
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
bool getInteger(int64_t &) const override
|
||||
VALIJSON_NORETURN bool getInteger(int64_t &) const override
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
double getNumber() const override
|
||||
VALIJSON_NORETURN double getNumber() const override
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
bool getNumber(double &) const override
|
||||
VALIJSON_NORETURN bool getNumber(double &) const override
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
size_t getObjectSize() const override
|
||||
VALIJSON_NORETURN size_t getObjectSize() const override
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
bool getObjectSize(size_t &) const override
|
||||
VALIJSON_NORETURN bool getObjectSize(size_t &) const override
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
@ -360,12 +360,12 @@ public:
|
||||
using pointer = StdStringAdapter*;
|
||||
using reference = StdStringAdapter&;
|
||||
|
||||
StdStringAdapter operator*() const
|
||||
VALIJSON_NORETURN StdStringAdapter operator*() const
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
DerefProxy<StdStringAdapter> operator->() const
|
||||
VALIJSON_NORETURN DerefProxy<StdStringAdapter> operator->() const
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
@ -380,22 +380,22 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
const StdStringArrayValueIterator& operator++()
|
||||
VALIJSON_NORETURN const StdStringArrayValueIterator& operator++()
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
StdStringArrayValueIterator operator++(int)
|
||||
VALIJSON_NORETURN StdStringArrayValueIterator operator++(int)
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
const StdStringArrayValueIterator& operator--()
|
||||
VALIJSON_NORETURN const StdStringArrayValueIterator& operator--()
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
void advance(std::ptrdiff_t)
|
||||
VALIJSON_NORETURN void advance(std::ptrdiff_t)
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
@ -420,12 +420,12 @@ public:
|
||||
using pointer = StdStringObjectMember*;
|
||||
using reference = StdStringObjectMember&;
|
||||
|
||||
StdStringObjectMember operator*() const
|
||||
VALIJSON_NORETURN StdStringObjectMember operator*() const
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
DerefProxy<StdStringObjectMember> operator->() const
|
||||
VALIJSON_NORETURN DerefProxy<StdStringObjectMember> operator->() const
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
@ -440,17 +440,17 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
const StdStringObjectMemberIterator& operator++()
|
||||
VALIJSON_NORETURN const StdStringObjectMemberIterator& operator++()
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
StdStringObjectMemberIterator operator++(int)
|
||||
VALIJSON_NORETURN StdStringObjectMemberIterator operator++(int)
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
||||
const StdStringObjectMemberIterator& operator--()
|
||||
VALIJSON_NORETURN const StdStringObjectMemberIterator& operator--()
|
||||
{
|
||||
throwNotSupported();
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ namespace json_reference {
|
||||
* @brief Extract URI from JSON Reference relative to the current schema
|
||||
*
|
||||
* @param jsonRef JSON Reference to extract from
|
||||
* @param schema Schema that JSON Reference URI is relative to
|
||||
*
|
||||
* @return Optional string containing URI
|
||||
*/
|
||||
|
@ -348,7 +348,7 @@ private:
|
||||
* @param currentScope URI for current resolution scope
|
||||
* @param nodePath JSON Pointer representing path to current node
|
||||
* @param fetchDoc Function to fetch remote JSON documents (optional)
|
||||
* @param parentSchema Optional pointer to the parent schema, used to
|
||||
* @param parentSubschema Optional pointer to the parent schema, used to
|
||||
* support required keyword in Draft 3
|
||||
* @param ownName Optional pointer to a node name, used to support
|
||||
* the 'required' keyword in Draft 3
|
||||
@ -514,7 +514,7 @@ private:
|
||||
* @param currentScope URI for current resolution scope
|
||||
* @param nodePath JSON Pointer representing path to current node
|
||||
* @param fetchDoc Function to fetch remote JSON documents (optional)
|
||||
* @param parentSchema Optional pointer to the parent schema, used to
|
||||
* @param parentSubschema Optional pointer to the parent schema, used to
|
||||
* support required keyword in Draft 3
|
||||
* @param ownName Optional pointer to a node name, used to support
|
||||
* the 'required' keyword in Draft 3
|
||||
@ -556,7 +556,7 @@ private:
|
||||
* will be resolved when they refer to the current
|
||||
* document
|
||||
* @param node Reference to node to parse
|
||||
* @param schema Reference to Schema to populate
|
||||
* @param subschema Reference to Schema to populate
|
||||
* @param currentScope URI for current resolution scope
|
||||
* @param nodePath JSON Pointer representing path to current node
|
||||
* @param fetchDoc Optional function to fetch remote JSON documents
|
||||
@ -1173,7 +1173,7 @@ private:
|
||||
* a schema that will be used when the conditional
|
||||
* evaluates to false.
|
||||
* @param currentScope URI for current resolution scope
|
||||
* @param containsPath JSON Pointer representing the path to
|
||||
* @param nodePath JSON Pointer representing the path to
|
||||
* the 'contains' node
|
||||
* @param fetchDoc Function to fetch remote JSON documents
|
||||
* (optional)
|
||||
@ -1564,14 +1564,9 @@ private:
|
||||
* @param items Optional pointer to a JSON node containing
|
||||
* an object mapping property names to
|
||||
* schemas.
|
||||
* @param additionalItems Optional pointer to a JSON node containing
|
||||
* an additional properties schema or a
|
||||
* boolean value.
|
||||
* @param currentScope URI for current resolution scope
|
||||
* @param itemsPath JSON Pointer representing the path to
|
||||
* the 'items' node
|
||||
* @param additionalItemsPath JSON Pointer representing the path to
|
||||
* the 'additionalItems' node
|
||||
* @param fetchDoc Function to fetch remote JSON documents
|
||||
* (optional)
|
||||
* @param docCache Cache of resolved and fetched remote
|
||||
@ -1623,13 +1618,6 @@ private:
|
||||
/**
|
||||
* @brief Make a new MaximumConstraint object (draft 3 and 4).
|
||||
*
|
||||
* @param rootSchema The Schema instance, and root subschema,
|
||||
* through which other subschemas can be
|
||||
* created and modified
|
||||
* @param rootNode Reference to the node from which JSON
|
||||
* References will be resolved when they refer
|
||||
* to the current document; used for recursive
|
||||
* parsing of schemas
|
||||
* @param node JSON node containing the maximum value.
|
||||
* @param exclusiveMaximum Optional pointer to a JSON boolean value that
|
||||
* indicates whether maximum value is excluded
|
||||
@ -1665,9 +1653,6 @@ private:
|
||||
*
|
||||
* @param node JSON node containing an integer, representing the maximum value.
|
||||
*
|
||||
* @param exclusive Optional pointer to a JSON boolean value that indicates whether the
|
||||
* maximum value is excluded from the range of permitted values.
|
||||
*
|
||||
* @return pointer to a new Maximum that belongs to the caller
|
||||
*/
|
||||
template<typename AdapterType>
|
||||
@ -1763,7 +1748,7 @@ private:
|
||||
* @param node JSON node containing an integer, representing
|
||||
* the minimum value.
|
||||
*
|
||||
* @param exclusiveMaximum Optional pointer to a JSON boolean value that
|
||||
* @param exclusiveMinimum Optional pointer to a JSON boolean value that
|
||||
* indicates whether the minimum value is
|
||||
* excluded from the range of permitted values.
|
||||
*
|
||||
@ -1797,9 +1782,6 @@ private:
|
||||
*
|
||||
* @param node JSON node containing an integer, representing the minimum value.
|
||||
*
|
||||
* @param exclusive Optional pointer to a JSON boolean value that indicates whether the
|
||||
* minimum value is excluded from the range of permitted values.
|
||||
*
|
||||
* @return pointer to a new MinimumConstraint that belongs to the caller
|
||||
*/
|
||||
template<typename AdapterType>
|
||||
|
Loading…
Reference in New Issue
Block a user