ion-c
ion-c copied to clipboard
Determine desired behavior of ion_reader_get_value_length for text readers.
Currently, text readers always provide -1 for this function because text values are not length-prefixed like they are in binary. Implementing this properly for text readers would require probing forward to find the end of the value, which would be expensive.
A cleaner alternative is to instruct the user to calculate the length of the desired value by subtracting the current value's offset (see ion_reader_get_value_offset
) from the next value's offset. This works for both text and binary.