-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Let user specify in config (and cmd line) their preference for downloading release builds, betas, and alphas
IDEA : build_preference = "rba"
r -- release
b -- beta
a -- alpha
-
"rba" is their preference, so "rba" says to prefer a release build but
if there isnt one available then a beta is okay etc -
The user can also omit any one of these characters to opt out of that build
entirely: "rb" would not consider an alpha build, "b" would only look for betas etc -
The default if no build_preference was specified would be "rb"
(maybe just "r" but we can discuss that ) -
REPRESENTATION: An enum with associated values that correspond to bit positions (similar to unix file permissions)
0 0 0 0 0 0 0 1 -> 1 (0x1)
0 0 0 0 0 0 1 0 -> 2 (0x2)
0 0 0 0 0 1 0 0 -> 4 (0x4)
0 0 0 0 0 0 0 100 010 001 -> A 16-bit number
| | |
a b r -> "rba"
0 0 0 0 0 0 0 000 010 001 -> A 16-bit number
| |
b r -> "rb"
-
When parsing the configuration file we could iterate over the characters and
map the iterator to their corresponding enum values, then from there we can
do some bit shifting and bitwise operations to get our numberto get our number