feat(encoding): write Flags as the names of its cases #402
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/47-flags-as-names"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #47
EncoderandDecoderget a defaultedflagsAsNames(): Bool(false, likewritesPrivateFields());Json(flagsAsNames: true),Yaml(flagsAsNames: true)andValueDecoder.of(..., flagsAsNames: true)answer true.Flags<Case>gets a hand-writtenEncode/Decodeinstd/encoding: the default stays the mask as a number, with the option it is a sequence of case names, lowest bit first, each by the case's own encode/decode.DecodeErrorwith position and field chain. A name twice is the flag once.DescribeforFlagsis unchanged (still the number).std/json/tests/flags.test.trb,std/yaml/tests/flags.test.trb.No seed change needed.
Checklist (head
c182d16):Non-blocking:
Flags#47