15 #ifndef INCLUDE_NN_NLIB_MSGPACK_JSONSCHEMA_H_ 16 #define INCLUDE_NN_NLIB_MSGPACK_JSONSCHEMA_H_ 21 #include "nn/nlib/msgpack/JsonStreamParser.h" 22 #include "nn/nlib/Swap.h" 24 #if defined(_MSC_VER) && defined(nx_msgpack_EXPORTS) 25 #undef NLIB_VIS_PUBLIC 26 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT 31 class JsonSchemaValidatorPrivate;
54 JsonSchemaValidatorPrivate* prv_;
60 : encode_title(
false), encode_description(
false),
61 uri_mapper(
nullptr), parser_settings() {
69 class JsonSchemaConverterPrivate;
92 return Init(settings);
100 return Export(written, &buf[0], N);
102 #ifdef __cpp_rvalue_references 103 std::pair<Result, size_t>
104 Export(
nlib_byte_t* buf,
size_t bufsize)
const NLIB_NOEXCEPT {
105 std::pair<Result, size_t> rval;
106 rval.first = Export(&rval.second, buf, bufsize);
110 std::pair<Result, size_t>
111 Export(
nlib_byte_t (&buf)[N])
const NLIB_NOEXCEPT {
112 return Export(&buf[0], N);
117 JsonSchemaConverterPrivate* prv_;
124 NLIB_DEFINE_STD_SWAP(::nlib_ns::msgpack::JsonSchemaConverter)
125 NLIB_DEFINE_STD_SWAP(::nlib_ns::msgpack::JsonSchemaValidator)
127 #if defined(_MSC_VER) && defined(nx_msgpack_EXPORTS) 128 #undef NLIB_VIS_PUBLIC 129 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT 131 #endif // INCLUDE_NN_NLIB_MSGPACK_JSONSCHEMA_H_ ~JsonSchemaValidator() noexcept
Destructor.
Result Export(size_t *written, nlib_byte_t(&buf)[N]) const noexcept
Writes JSON Schema converted to byte-code.
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
Result
The result of the function executed.
Failed while reading the file.
JsonStreamParserSettings parser_settings
This setting is provided to parse JSON Schema.
bool encode_description
As of now, this variable is ignored.
constexpr JsonSchemaConverter() noexcept
Instantiates the object with default parameters (default constructor).
Specifies options for operating JsonSchemaConverter.
Result
The result of the function executed.
Object created when MessagePack or JSON is read.
An error occurred in processing the URI.
bool encode_title
As of now, this variable is ignored.
~JsonSchemaConverter() noexcept
Destructor.
Data structure used to store the JsonStreamParser settings parameters.
Object created when MessagePack, JSON, or CSV is read.
Failed to allocate memory.
If the validation with JSON Schema has failed, a string representing the location where the validatio...
The class for getting the native path string from the URI path notation that is not machine-dependent...
The validation with JSON Schema has failed.
Converts JSON Schema to a byte-code format available for JsonSchemaValidator.
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Result Init() noexcept
Initializes JsonSchemaConverterSettings with the default values.
#define NLIB_CEXPR
Defines constexpr if it is available for use. If not, holds an empty string.
The specified file could not be found.
Failed to allocate memory.
const NativePathMapper * uri_mapper
Sets the pointer to an object that is to be used to convert a URI to a file path. You can specify NUL...
Defines the class for getting the platform-specific path notation from the URI path notation...
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
If the conversion of JSON Schema has failed, a string representing the location where the conversion ...
These classes are used to validate JSON and msgpack using JSON Schema.
constexpr JsonSchemaValidator() noexcept
Instantiates the object with default parameters (default constructor).