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

Appearance settings

Commit 3607525

Browse filesBrowse files
everslickme-no-dev
authored andcommitted
WString explicit converters to reduce Flash size (espressif#3497)
* WString explicit converters to reduce Flash size This is a port from the same patch for ESP8266: https://github.com/esp8266/Arduino/pull/6759/files
1 parent 7de1717 commit 3607525
Copy full SHA for 3607525

File tree

Expand file treeCollapse file tree

1 file changed

+28
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+28
-1
lines changed

‎cores/esp32/WString.h

Copy file name to clipboardExpand all lines: cores/esp32/WString.h
+28-1Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,20 @@ class String {
203203
unsigned char equalsIgnoreCase(const String &s) const;
204204
unsigned char equalsConstantTime(const String &s) const;
205205
unsigned char startsWith(const String &prefix) const;
206+
unsigned char startsWith(const char *prefix) const {
207+
return this->startsWith(String(prefix));
208+
}
209+
unsigned char startsWith(const __FlashStringHelper *prefix) const {
210+
return this->startsWith(String(prefix));
211+
}
206212
unsigned char startsWith(const String &prefix, unsigned int offset) const;
207213
unsigned char endsWith(const String &suffix) const;
214+
unsigned char endsWith(const char *suffix) const {
215+
return this->endsWith(String(suffix));
216+
}
217+
unsigned char endsWith(const __FlashStringHelper * suffix) const {
218+
return this->endsWith(String(suffix));
219+
}
208220

209221
// character access
210222
char charAt(unsigned int index) const;
@@ -238,7 +250,22 @@ class String {
238250

239251
// modification
240252
void replace(char find, char replace);
241-
void replace(const String& find, const String& replace);
253+
void replace(const String &find, const String &replace);
254+
void replace(const char *find, const String &replace) {
255+
this->replace(String(find), replace);
256+
}
257+
void replace(const __FlashStringHelper *find, const String &replace) {
258+
this->replace(String(find), replace);
259+
}
260+
void replace(const char *find, const char *replace) {
261+
this->replace(String(find), String(replace));
262+
}
263+
void replace(const __FlashStringHelper *find, const char *replace) {
264+
this->replace(String(find), String(replace));
265+
}
266+
void replace(const __FlashStringHelper *find, const __FlashStringHelper *replace) {
267+
this->replace(String(find), String(replace));
268+
}
242269
void remove(unsigned int index);
243270
void remove(unsigned int index, unsigned int count);
244271
void toLowerCase(void);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.