-
Notifications
You must be signed in to change notification settings - Fork 10
/
EditLineReader.h
43 lines (29 loc) · 830 Bytes
/
EditLineReader.h
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
34
35
36
37
38
39
40
41
42
43
#ifndef CCONS_EDIT_LINE_READER_H
#define CCONS_EDIT_LINE_READER_H
//
// EditLineReader is a LineReader that uses the libedit library to read
// input from the user.
//
// Part of ccons, the interactive console for the C programming language.
//
// Copyright (c) 2009 Alexei Svitkine. This file is distributed under the
// terms of MIT Open Source License. See file LICENSE for details.
//
#include <string>
#include <histedit.h>
#include "LineReader.h"
namespace ccons {
class EditLineReader : public LineReader {
public:
EditLineReader();
virtual ~EditLineReader();
const char * readLine(const char *prompt, const char *input);
const char * getPrompt() const;
private:
std::string _prompt;
HistEvent _event;
History *_history;
EditLine *_editLine;
};
} // namespace ccons
#endif // CCONS_EDIT_LINE_READER_H