Update JsonNew for IReference+cleaner optionals, and better Mappers#6890
Merged
1 commit merged intomasterfrom Jul 13, 2020
Merged
Update JsonNew for IReference+cleaner optionals, and better Mappers#68901 commit merged intomasterfrom
1 commit merged intomasterfrom
Conversation
This commit updates JsonUtilsNew to support winrt Windows::Foundation::IReference<T> as an option type, and cleans up the optional support code by removing the optional overload on GetValue(...). Instead of using an overload with a partial specialization, we're using a constexpr if with a type trait to determine option-type-ness. In addition, Carlos reported an issue with deriving from FlagMapper (itself templated) and referring to the base type's members without fully qualifying them. To make derivation easier, `EnumMapper` and `FlagMapper` now provide `BaseEnumMapper` and `BaseFlagMapper` type aliases. Lastly, in casual use, I found out that I'd written the til::color convreter wrong: it supports color strings of length 7 (#rrggbb) and length 4 (#rgb). I mistyped (and failed to test) support for 4-length color strings by pretending they were only 3 characters long.
|
Hello @DHowett! Because this pull request has the Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours. No worries though, I will be back when the time is right! 😉 p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
zadjii-msft
approved these changes
Jul 13, 2020
This pull request was closed.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit updates JsonUtilsNew to support winrt
Windows::Foundation::IReference<T>as an option type, and cleans up theoptional support code by removing the optional overload on
GetValue(...). Instead of using an overload with a partialspecialization, we're using a constexpr if with a type trait to
determine option-type-ness.
In addition, Carlos reported an issue with deriving from
FlagMapper(itself templated) and referring to the base type's members without
fully qualifying them. To make derivation easier,
EnumMapperandFlagMappernow provideBaseEnumMapperandBaseFlagMappertypealiases.
I've taken the opportunity to add a
winrt::hstringconversiontrait.
Lastly, in casual use, I found out that I'd written the til::color
converter wrong: it supports color strings of length 7 (
#rrggbb) andlength 4 (
#rgb). I mistyped (and failed to test) support for 4-lengthcolor strings by pretending they were only 3 characters long.
References
Merged JsonUtils changes from #6004 and #6590.
PR Checklist