forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vcpkg] Further JSON error improvements (microsoft#13399)
* [vcpkg] Split vcpkg/base/json.h into vcpkg/base/jsonreader.h * [vcpkg] Extract definitions of Configuration-Deserializer (& friends) These types are only used by VcpkgPaths during the initial parse. * [vcpkg] Introduce levenshtein-distance suggestions for json errors * [vcpkg] Fix regression in supports handling * [vcpkg] Fix signed/unsigned mismatch * [vcpkg] Address CR comments * [vcpkg] Address CR comments * Fix compiler error from merge conflict. * [vcpkg] Change parameters of Reader::check_for_unexpected_fields to better match declaration * [vcpkg] Improve errors from features set * [vcpkg] Fix includes * [vcpkg] Reuse code * [vcpkg] Check the "name" field always to maximize error information * [docs] Improve english phrasing in manifests.md * [vcpkg] Correct docs link for manifests Co-authored-by: Robert Schumacher <[email protected]> Co-authored-by: Billy Robert O'Neal III <[email protected]>
- Loading branch information
1 parent
d6b5fbf
commit d1ba685
Showing
21 changed files
with
730 additions
and
576 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,10 @@ | ||
#pragma once | ||
|
||
#include <vcpkg/base/fwd/optional.h> | ||
#include <vcpkg/base/fwd/span.h> | ||
#include <vcpkg/base/fwd/stringview.h> | ||
|
||
namespace vcpkg::Json | ||
{ | ||
struct JsonStyle; | ||
enum class ValueKind : int; | ||
struct Value; | ||
struct Object; | ||
struct Array; | ||
|
||
struct ReaderError; | ||
struct BasicReaderError; | ||
struct Reader; | ||
|
||
// This is written all the way out so that one can include a subclass in a header | ||
template<class Type> | ||
struct IDeserializer | ||
{ | ||
using type = Type; | ||
virtual StringView type_name() const = 0; | ||
|
||
virtual Span<const StringView> valid_fields() const; | ||
|
||
virtual Optional<Type> visit_null(Reader&); | ||
virtual Optional<Type> visit_boolean(Reader&, bool); | ||
virtual Optional<Type> visit_integer(Reader& r, int64_t i); | ||
virtual Optional<Type> visit_number(Reader&, double); | ||
virtual Optional<Type> visit_string(Reader&, StringView); | ||
virtual Optional<Type> visit_array(Reader&, const Array&); | ||
virtual Optional<Type> visit_object(Reader&, const Object&); | ||
|
||
protected: | ||
IDeserializer() = default; | ||
IDeserializer(const IDeserializer&) = default; | ||
IDeserializer& operator=(const IDeserializer&) = default; | ||
IDeserializer(IDeserializer&&) = default; | ||
IDeserializer& operator=(IDeserializer&&) = default; | ||
virtual ~IDeserializer() = default; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,7 @@ namespace vcpkg | |
{ | ||
template<class T> | ||
struct Span; | ||
|
||
template<class T> | ||
using View = Span<const T>; | ||
} |
Oops, something went wrong.