Skip to content

Suggestion: use basic_staj_event::length_ for arrays/objects of known size #375

Answered by danielaparker
ecorm asked this question in Ideas
Discussion options

You must be logged in to vote

That's a good suggestion, it was easy to implement, and is currently on master.

I've added a size() accessor function to basic_staj_event. If the event type is a key or a string_value or a byte_string_value,
it returns the size of the key or string or byte string value. If the event type is a begin_object or a begin_array, it returns the size of the object or array if known, otherwise 0. For all other event types, it returns 0.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ecorm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants