Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

add Stream::readStringUntil function that uses string terminator #9011

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

Merged
d-a-v merged 3 commits into esp8266:master from Arian8j2:master
Nov 7, 2023

Conversation

Copy link
Contributor

@Arian8j2 Arian8j2 commented Oct 28, 2023

currently there is a

String readStringUntil(char terminator)

function, but there is no equivalent of it that uses string terminator. this pr implements

String readStringUntil(const char* terminator, uint32_t count = 1)

i found this useful for small html parsing or truncating.

Copy link
Collaborator

d-a-v commented Nov 4, 2023

It is not a breaking change and does not override the Arduino API, so looks good.
However the count name is not intuitive.
Is it a int until_total_number_of_occurrences = 1 ?

Copy link
Contributor Author

Arian8j2 commented Nov 4, 2023

Is it a int until_total_number_of_occurrences = 1 ?

yes

Copy link
Collaborator

d-a-v commented Nov 6, 2023

Can you please add a comment or rename the variable ?

Copy link
Contributor Author

Arian8j2 commented Nov 7, 2023

Can you please add a comment or rename the variable ?

done

d-a-v reacted with thumbs up emoji

Copy link
Collaborator

@d-a-v d-a-v left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving: Next step is to simplify our calls to readStringUntil() from our libraries (especially but not only parsing-impl.h)

edit (or improve Stream::sendUntil() with this same new API) - see #9005)

@d-a-v d-a-v merged commit 31c1592 into esp8266:master Nov 7, 2023
hasenradball pushed a commit to hasenradball/Arduino that referenced this pull request Nov 18, 2024
...8266#9011)
* add readStringUntil function with string terminator
* rename count parameter to untilTotalNumberOfOccurrences
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@d-a-v d-a-v d-a-v approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /