Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement read_text - a method that returns a text between two tags #455

merged 4 commits into from Aug 15, 2022


Copy link

@Mingun Mingun commented Aug 14, 2022

This method introduces Reader::read_text and NsReader::read_text methods, that returns text between open and closed tags.

At the same time it removes Reader::read_text_into, because:

  • it is have the name similar to the newly added method, but behaves totally different
  • it is trivially to implement it manually
  • as was noted in skips events on failed read_text #154, the behavior of this method should be changed to match the behavior of the new method, but this is hard to implement currently, because when we read events, we store in the user-provided buffer only data, that required for event content, but omitting the part corresponding to markup. But new method requires that bytes too. Implementing this behavior requires further investigations, therefore, I have decided so far to make an implementation only for the borrowing reader.

Because those methods usually used on events returned by reader, which
always borrow content from input / buffer, actual allocation count does
not changed
Copy link

codecov-commenter commented Aug 14, 2022

Codecov Report

Merging #455 (792d23d) into master (2bf2d2d) will increase coverage by 0.03%.
The diff coverage is 19.14%.

@@            Coverage Diff             @@
##           master     #455      +/-   ##
+ Coverage   52.35%   52.38%   +0.03%     
  Files          29       29              
  Lines       13565    13562       -3     
+ Hits         7102     7105       +3     
+ Misses       6463     6457       -6     
Flag Coverage Δ
unittests 52.38% <19.14%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
examples/ 0.00% <0.00%> (ø)
src/events/ 93.90% <0.00%> (-0.20%) ⬇️
src/reader/ 45.61% <0.00%> (ø)
src/reader/ 86.24% <0.00%> (+4.83%) ⬆️
src/reader/ 90.38% <ø> (+0.13%) ⬆️
src/reader/ 63.39% <0.00%> (-1.75%) ⬇️
src/reader/ 94.82% <37.50%> (-5.18%) ⬇️
src/de/ 82.55% <50.00%> (-0.02%) ⬇️
src/events/ 68.51% <80.00%> (-0.09%) ⬇️
... and 6 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@dralley dralley merged commit 87d241a into tafia:master Aug 15, 2022
3 checks passed
@Mingun Mingun deleted the read-text branch August 15, 2022 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants