tcbrindle / flux

A C++20 library for sequence-orientated programming
https://tristanbrindle.com/flux/
Boost Software License 1.0
479 stars 29 forks source link

Add getlines sequence #16

Closed tcbrindle closed 1 year ago

tcbrindle commented 1 year ago

Similar to range-v3, wraps std::getline() in the sequence protocol. Internally re-uses a std::string for each call to getline() to avoid allocations.

The element type of the sequence is std::string const&. Of all the options (prvalue string, string_view, non-const string& etc) it's the best default, as it allows users to make the choice of whether they want to take a copy of the buffer or not, but without many of the lifetime problems of string_view.

codecov[bot] commented 1 year ago

Codecov Report

Base: 96.92% // Head: 96.91% // Decreases project coverage by -0.00% :warning:

Coverage data is based on head (03d4d33) compared to base (c014f0f). Patch coverage: 95.23% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #16 +/- ## ========================================== - Coverage 96.92% 96.91% -0.01% ========================================== Files 45 47 +2 Lines 1364 1396 +32 ========================================== + Hits 1322 1353 +31 - Misses 42 43 +1 ``` | [Impacted Files](https://codecov.io/gh/tcbrindle/libflux/pull/16?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tristan+Brindle) | Coverage Δ | | |---|---|---| | [include/flux/op/equal.hpp](https://codecov.io/gh/tcbrindle/libflux/pull/16/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tristan+Brindle#diff-aW5jbHVkZS9mbHV4L29wL2VxdWFsLmhwcA==) | `90.00% <0.00%> (ø)` | | | [include/flux/source/getlines.hpp](https://codecov.io/gh/tcbrindle/libflux/pull/16/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tristan+Brindle#diff-aW5jbHVkZS9mbHV4L3NvdXJjZS9nZXRsaW5lcy5ocHA=) | `100.00% <100.00%> (ø)` | | | [include/flux/op/split\_string.hpp](https://codecov.io/gh/tcbrindle/libflux/pull/16/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tristan+Brindle#diff-aW5jbHVkZS9mbHV4L29wL3NwbGl0X3N0cmluZy5ocHA=) | `100.00% <0.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tristan+Brindle). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Tristan+Brindle)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.