mirror of
https://github.com/monero-project/monero.git
synced 2025-05-06 11:04:58 -04:00
Simplify readline support
And don't use std::mutex
This commit is contained in:
parent
4466b6d1b0
commit
c088d38a57
3 changed files with 88 additions and 143 deletions
|
@ -8,25 +8,25 @@
|
|||
|
||||
namespace rdln
|
||||
{
|
||||
typedef enum { empty, partial, full } linestatus;
|
||||
class readline_buffer : public std::stringbuf
|
||||
{
|
||||
public:
|
||||
readline_buffer();
|
||||
void start();
|
||||
void stop();
|
||||
int process();
|
||||
bool is_running() const
|
||||
{
|
||||
return m_cout_buf != NULL;
|
||||
}
|
||||
void get_line(std::string& line) const;
|
||||
linestatus get_line(std::string& line) const;
|
||||
void set_prompt(const std::string& prompt);
|
||||
static void add_completion(const std::string& command);
|
||||
static const std::vector<std::string>& get_completions();
|
||||
|
||||
protected:
|
||||
virtual int sync();
|
||||
|
||||
|
||||
private:
|
||||
std::streambuf* m_cout_buf;
|
||||
static std::vector<std::string>& completion_commands();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue