MCPcopy Create free account
hub / github.com/FastLED/FastLED / readLine

Method readLine

src/fl/stl/istream.cpp.hpp:136–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136bool istream_real::readLine() {
137 // If we have no more data available and no buffered data, we're at EOF
138 if (mPos >= mBufferLen && fl::available() == 0) {
139 return false;
140 }
141
142 // Read characters until newline or no more data
143 mBufferLen = 0;
144 while (fl::available() > 0 && mBufferLen < BUFFER_SIZE - 1) {
145 int c = fl::read();
146 if (c == -1) break;
147 if (c == '\n') break;
148 if (c == '\r') continue; // Skip carriage return
149 mBuffer[mBufferLen++] = static_cast<char>(c);
150 }
151
152 // Null terminate the buffer
153 mBuffer[mBufferLen] = '\0';
154 mPos = 0;
155 return true;
156}
157
158void istream_real::skipWhitespace() {
159 while (mPos < mBufferLen &&

Callers

nothing calls this directly

Calls 2

availableFunction · 0.70
readFunction · 0.70

Tested by

no test coverage detected