blob: 5ccf7690fdaf1181400c6b497fc44016433cf20d (
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 2016 Yahoo Inc. 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
|