Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
jsonpointer_error.h
1#ifndef SOURCEMETA_CORE_JSONPOINTER_ERROR_H_
2#define SOURCEMETA_CORE_JSONPOINTER_ERROR_H_
3
4#ifndef SOURCEMETA_CORE_JSONPOINTER_EXPORT
5#include <sourcemeta/core/jsonpointer_export.h>
6#endif
7
8#include <sourcemeta/core/json.h>
9
10#include <cstdint> // std::uint64_t
11
12namespace sourcemeta::core {
13
16class SOURCEMETA_CORE_JSONPOINTER_EXPORT PointerParseError
17 // TODO: It makes no sense for a JSON Pointer error to inherit from a JSON
18 // error. Make them independent
19 : public JSONParseError {
20public:
22 PointerParseError(const std::uint64_t column) : JSONParseError{1, column} {}
23
24 [[nodiscard]] auto what() const noexcept -> const char * override {
25 return "The input is not a valid JSON Pointer";
26 }
27};
28
29} // namespace sourcemeta::core
30
31#endif
auto column() const noexcept -> std::uint64_t
Get the column number of the error.
Definition json_error.h:54
JSONParseError(const std::uint64_t line, const std::uint64_t column)
Create a parsing error.
Definition json_error.h:29
PointerParseError(const std::uint64_t column)
Create a parsing error.
Definition jsonpointer_error.h:22