Removed shitty Arduino String
This commit is contained in:
1 parent
c586a87ebe
commit
975db87adc
9 files changed
+31
-72
No files matched your search
@@ -47,7 +47,7 @@ void TFT_eSPI_Button::setLabelDatum(int16_t x_delta, int16_t y_delta, uint8_t da
|
||||
_textdatum = datum;
|
||||
}
|
||||
|
||||
void TFT_eSPI_Button::drawButton(bool inverted, String long_name) {
|
||||
void TFT_eSPI_Button::drawButton(bool inverted, std::string_view long_name) {
|
||||
uint16_t fill, outline, text;
|
||||
|
||||
if(!inverted) {
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ class TFT_eSPI_Button : public TFT_eSPI {
|
||||
// Adjust text datum and x, y deltas
|
||||
void setLabelDatum(int16_t x_delta, int16_t y_delta, uint8_t datum = MC_DATUM);
|
||||
|
||||
void drawButton(bool inverted = false, String long_name = "");
|
||||
void drawButton(bool inverted = false, std::string_view long_name = "");
|
||||
bool contains(int16_t x, int16_t y);
|
||||
|
||||
void press(bool p);
|
||||
|
||||
@@ -22,7 +22,7 @@ void TFT_eSPI::loadFont(const uint8_t array[])
|
||||
** Function name: loadFont
|
||||
** Description: loads parameters from a font vlw file
|
||||
*************************************************************************************x*/
|
||||
void TFT_eSPI::loadFont(String fontName, fs::FS &ffs)
|
||||
void TFT_eSPI::loadFont(std::string_view fontName, fs::FS &ffs)
|
||||
{
|
||||
fontFS = ffs;
|
||||
loadFont(fontName, false);
|
||||
@@ -33,7 +33,7 @@ void TFT_eSPI::loadFont(String fontName, fs::FS &ffs)
|
||||
** Function name: loadFont
|
||||
** Description: loads parameters from a font vlw file
|
||||
*************************************************************************************x*/
|
||||
void TFT_eSPI::loadFont(String fontName, bool flash)
|
||||
void TFT_eSPI::loadFont(std::string_view fontName, bool flash)
|
||||
{
|
||||
/*
|
||||
The vlw font format does not appear to be documented anywhere, so some reverse
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
// These are for the new anti-aliased fonts
|
||||
void loadFont(const uint8_t array[]);
|
||||
#ifdef FONT_FS_AVAILABLE
|
||||
void loadFont(String fontName, fs::FS &ffs);
|
||||
void loadFont(std::string_view fontName, fs::FS &ffs);
|
||||
#endif
|
||||
void loadFont(String fontName, bool flash = true);
|
||||
void loadFont(std::string_view fontName, bool flash = true);
|
||||
void unloadFont( void );
|
||||
bool getUnicodeIndex(uint16_t unicode, uint16_t *index);
|
||||
|
||||
|
||||
@@ -2607,10 +2607,10 @@ void TFT_eSprite::drawGlyph(uint16_t code)
|
||||
** Function name: printToSprite
|
||||
** Description: Write a string to the sprite cursor position
|
||||
***************************************************************************************/
|
||||
void TFT_eSprite::printToSprite(String string)
|
||||
void TFT_eSprite::printToSprite(std::string_view string)
|
||||
{
|
||||
if(!fontLoaded) return;
|
||||
printToSprite((char*)string.c_str(), string.length());
|
||||
printToSprite(string.data(), string.size());
|
||||
}
|
||||
|
||||
|
||||
@@ -2618,7 +2618,7 @@ void TFT_eSprite::printToSprite(String string)
|
||||
** Function name: printToSprite
|
||||
** Description: Write a string to the sprite cursor position
|
||||
***************************************************************************************/
|
||||
void TFT_eSprite::printToSprite(char *cbuffer, uint16_t len) //String string)
|
||||
void TFT_eSprite::printToSprite(char *cbuffer, uint16_t len) //std::string_view string)
|
||||
{
|
||||
if(!fontLoaded) return;
|
||||
|
||||
|
||||
+1
-3
@@ -142,9 +142,7 @@ class TFT_eSprite : public TFT_eSPI {
|
||||
// Draw a single unicode character using the loaded font
|
||||
void drawGlyph(uint16_t code);
|
||||
// Print string to sprite using loaded font at cursor position
|
||||
void printToSprite(String string);
|
||||
// Print char array to sprite using loaded font at cursor position
|
||||
void printToSprite(char *cbuffer, uint16_t len);
|
||||
void printToSprite(std::string_view string);
|
||||
// Print indexed glyph to sprite using loaded font at x,y
|
||||
int16_t printToSprite(int16_t x, int16_t y, uint16_t index);
|
||||
|
||||
|
||||
Reference in new issue
Block a user