-
Notifications
You must be signed in to change notification settings - Fork 60
querying valid values for enums #149
Copy link
Copy link
Open
Labels
SemanticChange in the semantic interepretationChange in the semantic interepretationabi-breakbreaks the ABI (e.g. programs linked against the library have to be recompiled)breaks the ABI (e.g. programs linked against the library have to be recompiled)enhancement
Metadata
Metadata
Assignees
Labels
SemanticChange in the semantic interepretationChange in the semantic interepretationabi-breakbreaks the ABI (e.g. programs linked against the library have to be recompiled)breaks the ABI (e.g. programs linked against the library have to be recompiled)enhancement
Type
Fields
Give feedbackNo fields configured for issues without a type.
Looking at #148 which embeds the information about the minimum & maximum version number an element is valid for in libMatroska, I thought about also having the information available which values are valid for the various enums we have in the specs. At the moment we only have C-style
enumfor them, which means we can use them in the code via their names, but there's no way to have the program query the library if a given value is valid or not.For example, it would be nice to be able to query libMatroska & ask if the value 1 is valid for the "color primaries" element (it is) or if 14 is (it isn't).
On top of that it would be nice if the library simply provided a list of valid value/description pairs that an application can use for selection or to translate what a given value refers to (think
mkvinfooutputting the name of the "color primaries" along with the numeric value).I'm thinking about two or three functions, the example being for an unsigned integer-based enum:
I'm trying to avoid the word "valid" here as these functions are all static; they only provide information straight from the specs. Not really happy with the names, though…