summaryrefslogtreecommitdiffstats
path: root/logd/src/logd/cmdbuf.h
blob: 8a9bf8a1ec15b6abb3064078bae82fe13e29fdd3 (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
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
namespace logdemon {

class CmdBuf
{
private:
    int _size;
    char *_buf;
    char *_bp;
    int _left;
    void extend();

    CmdBuf(const CmdBuf& other);
    CmdBuf& operator= (const CmdBuf& other);
public:
    CmdBuf();
    ~CmdBuf();
    bool hasCmd();
    void doCmd(Performer &via);
    void maybeRead(int fd);
    bool readFile(int fd);
};

} // namespace