Skip to content

Commit

Permalink
Add String(const uint8_t *, unsigned int) constructor
Browse files Browse the repository at this point in the history
This allows creating a String from a uint8_t[] or uint8_t* as well,
without having to add explicit casts.
  • Loading branch information
matthijskooijman committed Sep 19, 2019
1 parent bf78968 commit 3209e07
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api/String.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class String
// be false).
String(const char *cstr = "");
String(const char *cstr, unsigned int length);
String(const uint8_t *cstr, unsigned int length) : String((const char*)cstr, length) {}
String(const String &str);
String(const __FlashStringHelper *str);
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
Expand Down

0 comments on commit 3209e07

Please sign in to comment.