mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-12 02:23:14 +00:00
35 lines
868 B
C++
35 lines
868 B
C++
#pragma once
|
|
|
|
#include "LineReader.h"
|
|
|
|
#include <replxx.hxx>
|
|
|
|
|
|
class ReplxxLineReader : public LineReader
|
|
{
|
|
public:
|
|
ReplxxLineReader(
|
|
const Suggest & suggest,
|
|
const String & history_file_path,
|
|
bool multiline,
|
|
Patterns extenders_,
|
|
Patterns delimiters_,
|
|
replxx::Replxx::highlighter_callback_t highlighter_);
|
|
~ReplxxLineReader() override;
|
|
|
|
void enableBracketedPaste() override;
|
|
|
|
private:
|
|
InputStatus readOneLine(const String & prompt) override;
|
|
void addToHistory(const String & line) override;
|
|
int execute(const std::string & command);
|
|
void openEditor();
|
|
|
|
replxx::Replxx rx;
|
|
replxx::Replxx::highlighter_callback_t highlighter;
|
|
|
|
// used to call flock() to synchronize multiple clients using same history file
|
|
int history_file_fd = -1;
|
|
bool bracketed_paste_enabled = false;
|
|
};
|