Add more convenient method(s) to IIonReader for determining whether an annotation is present
pbcornell opened this issue · 3 comments
pbcornell commented
The IIonReader
interface currently provides:
IEnumerable<SymbolToken> GetTypeAnnotations()
which isn't particularly convenient when checking to see if a specific annotation is present. Also note that ion-java's equivalent of this method is called getTypeAnnotationSymbols()
.
Something like string[] GetTypeAnnotations()
or bool HasAnnotation(string annotation)
would be more helpful.
tgregg commented
Once this is added, use it in the Sparse Reads example in the cookbook, replacing the inline implementation that is currently there.
pbcornell commented
To clarify, I propose the following changes to the IIonReader
interface:
- rename the existing
GetTypeAnnotations()
method toGetTypeAnnotationSymbols()
- add
string[] GetTypeAnnotations()
- add
bool HasAnnotation(string annotation)
Note that the first two bullets represent breaking changes.