|
|
delpi
0.0.1
DElta-complete LP solver
|
A class that provides a source for lines of text buffered in memory. More...
#include <BufferLineSource.h>
Public Member Functions | |
| bool | nextLine (std::string_view &out) |
| Retrieve the next line from the buffer. | |
Protected Member Functions | |
| void | initialize (const char *data, std::size_t length) |
| Force a reinitialization of the object, setting cur_ and end_ to the new values. | |
Private Attributes | |
| const char * | cur_ |
| Pointer to the current position in the buffer. | |
| const char * | end_ |
| Pointer to the end of the buffer. | |
A class that provides a source for lines of text buffered in memory.
It keeps track of the current position in the buffer and allows retrieving lines one by one. The buffer is represented as a contiguous block of memory, and the class provides methods to access the lines without copying the data, using std::string_view. The class also stores a name for the source, which can be used for error reporting or debugging purposes.
Definition at line 25 of file BufferLineSource.h.
|
protected |
Force a reinitialization of the object, setting cur_ and end_ to the new values.
| data | new buffer of data |
| length | length of the new buffer |
Definition at line 28 of file BufferLineSource.cpp.
| bool delpi::BufferLineSource::nextLine | ( | std::string_view & | out | ) |
Retrieve the next line from the buffer.
A line terminates with an '\n' or the end of the buffer. Moreover, if an '\r' character precedes the '\n' character, it is removed from the returned view.
| out | view of a line in the buffer, stripped of any newline characters |
Definition at line 16 of file BufferLineSource.cpp.