Expand String examples with explicit size concat and constructor - #9239
Closed
matthijskooijman wants to merge 1 commit into
Closed
Expand String examples with explicit size concat and constructor#9239matthijskooijman wants to merge 1 commit into
matthijskooijman wants to merge 1 commit into
Conversation
This expands examples to show the newly added APIs: String::concat(const char *, unsigned int) String::String(const char *, unsigned int) Since not all cores versions will support this right away, a version check is added against ARDUINO_CORE_API.
Contributor
|
✅ Build completed. Please test this code using one of the following: ⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-9239-BUILD-893-linux32.tar.xz ℹ️ The |
Collaborator
|
Moved to arduino/arduino-examples#18 |
mysterywolf
pushed a commit
to RTduino/RTduino
that referenced
this pull request
Sep 15, 2024
When working with the Arduino String class, I've found that I couldn't efficiently combine it with some external libraries that explicitely pass char* and length around, without nul-terminating their strings. This prompted me to modify and expose the concat (const char* cstr, unsigned int length) method, add a new String(const char* cstr, unsigned int length) constructor. While I was going over the string class, I found some other minor improvements, which are included here. This is a port of arduino/Arduino#1936. The commits are identical, except for some improved commit messages and one commit was dropped since that change was already made by someone else in the meantime. I've provided some testcases by updating the string examples: arduino/Arduino#9239 If this is ok to merge, I'll also provide a PR for the reference documentation. cherry-pick from: arduino/ArduinoCore-API#97
mysterywolf
pushed a commit
to RTduino/RTduino
that referenced
this pull request
Sep 15, 2024
When working with the Arduino String class, I've found that I couldn't efficiently combine it with some external libraries that explicitely pass char* and length around, without nul-terminating their strings. This prompted me to modify and expose the concat (const char* cstr, unsigned int length) method, add a new String(const char* cstr, unsigned int length) constructor. While I was going over the string class, I found some other minor improvements, which are included here. This is a port of arduino/Arduino#1936. The commits are identical, except for some improved commit messages and one commit was dropped since that change was already made by someone else in the meantime. I've provided some testcases by updating the string examples: arduino/Arduino#9239 If this is ok to merge, I'll also provide a PR for the reference documentation. cherry-pick from: arduino/ArduinoCore-API#97
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This expands examples to show the newly added APIs:
Since not all cores versions will support this right away, a version
check is added against ARDUINO_CORE_API.
These APIs are added to ArduinoCore-API in arduino/ArduinoCore-API#97. Before merging these examples, the version check must be updated to the first API version that includes these new APIs.