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

Expand String examples with explicit size concat and constructor #9239

Closed
wants to merge 1 commit into from

Conversation

matthijskooijman
Copy link
Collaborator

@matthijskooijman matthijskooijman commented Sep 19, 2019

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.

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.

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.
@per1234
Copy link
Collaborator

per1234 commented Sep 26, 2020

Moved to arduino/arduino-examples#18

@per1234 per1234 closed this Sep 26, 2020
@arduino arduino deleted a comment Dec 25, 2020
@per1234 per1234 added Component: Documentation Related to Arduino's documentation content feature request A request to make an enhancement (not a bug fix) labels Sep 3, 2022
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation Related to Arduino's documentation content feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants