blob: 1fd9fce865314112cd0e3d1e9ded2780c4e60c57 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
namespace config {
namespace sentinel {
class LineSplitter {
private:
int _fd;
int _size;
char *_buffer;
int _readPos;
int _writePos;
bool _eof;
LineSplitter();
LineSplitter& operator =(const LineSplitter&);
LineSplitter(const LineSplitter&);
bool resize();
bool fill();
public:
explicit LineSplitter(int fd);
char *getLine();
bool eof() const { return _eof && _readPos >= _writePos; }
~LineSplitter();
};
} // end namespace config::sentinel
} // end namespace config
|