UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
line_buffer.cpp
Go to the documentation of this file.
1#include <cassert>
2#include "line_buffer.hpp"
3
4void LineBuffer::write(std::string_view str){
5 reduceBuf();
6
7 buf += str;
8
9 if(!hasLine()){
10 pop();
11 }
12}
13
16 auto idx = buf.find('\n', endIdx);
17 if(idx != buf.npos){
18 endIdx = idx + 1;
19 }
20}
21
23 assert(startIdx <= endIdx);
24 buf.erase(0, startIdx);
26 startIdx = 0;
27}
size_t endIdx
bool hasLine() const
void write(std::string_view str)
std::string buf
size_t startIdx
void reduceBuf()