delpi  0.0.1
DElta-complete LP solver
Loading...
Searching...
No Matches
BufferLineSource.h
Go to the documentation of this file.
1
8#pragma once
9
10#include <string>
11#include <string_view>
12
13namespace delpi {
14
25class BufferLineSource {
26 public:
27 explicit BufferLineSource(const std::string_view data) : cur_(data.data()), end_(data.data() + data.size()) {}
28 BufferLineSource(const char *data, std::size_t length);
29
38 bool nextLine(std::string_view &out);
39
40 protected:
46 void initialize(const char *data, std::size_t length);
47
48 private:
49 const char *cur_;
50 const char *end_;
51};
52
53} // namespace delpi
const char * end_
Pointer to the end of the buffer.
const char * cur_
Pointer to the current position in the buffer.
void initialize(const char *data, std::size_t length)
Force a reinitialization of the object, setting cur_ and end_ to the new values.
bool nextLine(std::string_view &out)
Retrieve the next line from the buffer.
Global namespace for the delpi library.