Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg] Further JSON error improvements #13399

Merged
merged 19 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ab79d34
[vcpkg] Split vcpkg/base/json.h into vcpkg/base/jsonreader.h
ras0219-msft Sep 4, 2020
c15aaac
[vcpkg] Extract definitions of Configuration-Deserializer (& friends)
ras0219-msft Sep 6, 2020
3847643
[vcpkg] Introduce levenshtein-distance suggestions for json errors
ras0219-msft Sep 6, 2020
be965ca
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/…
ras0219-msft Sep 8, 2020
63352cc
[vcpkg] Fix regression in supports handling
ras0219-msft Sep 9, 2020
0122e0d
[vcpkg] Fix signed/unsigned mismatch
ras0219-msft Sep 9, 2020
e923d05
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/…
ras0219-msft Sep 10, 2020
e7e5724
[vcpkg] Address CR comments
ras0219-msft Sep 10, 2020
bbe2f77
[vcpkg] Address CR comments
ras0219-msft Sep 11, 2020
911a523
Merge remote-tracking branch 'origin/master' into dev/roschuma/json
BillyONeal Sep 11, 2020
72c0080
Fix compiler error from merge conflict.
BillyONeal Sep 11, 2020
ea2d7c9
Merge from master. Add explicit documentation that $comment's are not…
ras0219-msft Oct 9, 2020
47f9051
[vcpkg] Change parameters of Reader::check_for_unexpected_fields to b…
ras0219-msft Oct 9, 2020
bff7531
[vcpkg] Improve errors from features set
ras0219-msft Oct 9, 2020
ca2f83c
[vcpkg] Fix includes
ras0219-msft Oct 9, 2020
9ce5319
[vcpkg] Reuse code
ras0219-msft Oct 9, 2020
1e97c80
[vcpkg] Check the "name" field always to maximize error information
ras0219-msft Oct 9, 2020
6948a49
[docs] Improve english phrasing in manifests.md
ras0219-msft Oct 9, 2020
091b12e
[vcpkg] Correct docs link for manifests
ras0219-msft Oct 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions toolsrc/include/vcpkg/base/fwd/json.h
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;
};
}
3 changes: 3 additions & 0 deletions toolsrc/include/vcpkg/base/fwd/span.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ namespace vcpkg
{
template<class T>
struct Span;

template<class T>
using View = Span<const T>;
}
Loading