I am sure this exists, and I believe I did something similar in C quite a while back with bit fields, but I cannot think of how I should do this.
Basically I will have a series of options that can either be on or off. These options describe the operations an application can perform on a file e.g.
STRUCTURE
{
EXECUTE
READ
WRITE
}
If this structure were a bit field I would like to be able to set structure to a value that represents both READ and WRITE but not execute (e.g. 3). If I were to read this structure it could give me 3 thus I would know that given this value execute should be denied. A bit field solution may not necessarily be the best solution in this case though.
Definitely an EnumSet, as 'zapl' recommended.
Or have a List of Enum, but the latter makes more sense.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With