FastLED 3.10.8
Loading...
Searching...
No Matches

◆ putback()

istream_real & fl::istream_real::putback ( char c)

Definition at line 386 of file istream.cpp.hpp.

386 {
387 if (mPos > 0) {
388 mPos--;
389 mBuffer[mPos] = c;
390 } else {
391 // Insert at beginning of buffer - shift existing data
392 if (mBufferLen < BUFFER_SIZE - 1) {
393 for (fl::size i = mBufferLen; i > 0; --i) {
394 mBuffer[i] = mBuffer[i-1];
395 }
396 mBuffer[0] = c;
397 mBufferLen++;
398 mBuffer[mBufferLen] = '\0';
399 }
400 }
401 return *this;
402}
fl::size mBufferLen
Definition istream.h:32
fl::size mPos
Definition istream.h:33
char mBuffer[BUFFER_SIZE]
Definition istream.h:31
static const fl::size BUFFER_SIZE
Definition istream.h:25

References istream_real(), BUFFER_SIZE, fl::FL_NO_EXCEPT, mBuffer, mBufferLen, and mPos.

Referenced by fl::istream::putback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: