mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-17 22:23:10 +03:00
Added function on WString class to export char ptr
This commit is contained in:
@ -53,11 +53,8 @@ size_t Print::print(const __FlashStringHelper *ifsh)
|
|||||||
|
|
||||||
size_t Print::print(const String &s)
|
size_t Print::print(const String &s)
|
||||||
{
|
{
|
||||||
size_t n = 0;
|
write((const uint8_t*)s.c_str(), s.length());
|
||||||
for (uint16_t i = 0; i < s.length(); i++) {
|
return s.length();
|
||||||
n += write(s[i]);
|
|
||||||
}
|
|
||||||
return n;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Print::print(const char str[])
|
size_t Print::print(const char str[])
|
||||||
|
@ -642,4 +642,8 @@ long String::toInt(void) const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char* String::c_str() const
|
||||||
|
{
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -169,6 +169,7 @@ public:
|
|||||||
|
|
||||||
// parsing/conversion
|
// parsing/conversion
|
||||||
long toInt(void) const;
|
long toInt(void) const;
|
||||||
|
char* c_str() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
char *buffer; // the actual char array
|
char *buffer; // the actual char array
|
||||||
|
Reference in New Issue
Block a user