FastLED 3.9.15
Loading...
Searching...
No Matches

◆ putback()

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

Definition at line 384 of file istream.cpp.

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

References istream_real(), buffer_, buffer_len_, BUFFER_SIZE, and pos_.

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

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