MCPcopy Create free account
hub / github.com/BruceDevices/firmware / fromString

Method fromString

src/core/scrollableTextArea.cpp:110–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110void ScrollableTextArea::fromString(const String &text) {
111 clear();
112 int startIdx = 0;
113 int endIdx = 0;
114
115 while (endIdx < text.length()) {
116 if (text[endIdx] == '\n') {
117 addLine(text.substring(startIdx, endIdx));
118 startIdx = endIdx + 1;
119 }
120
121 endIdx++;
122 }
123
124 // Add the last line if there’s remaining text (text does not ends with \n)
125 if (startIdx < text.length()) { addLine(text.substring(startIdx, endIdx)); }
126}
127
128// for devices it will act as a scrollable text area
129void ScrollableTextArea::addLine(const String &text) {

Callers 6

setupMethod · 0.80
native_dialogViewTextFunction · 0.80
validateEvilGatewayIpMethod · 0.80
parse_config_fileFunction · 0.80

Calls 1

clearFunction · 0.50

Tested by

no test coverage detected