From 316b2a40f0bd9ccdf8a2ff2f2e097011cbb5fedf Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Wed, 24 Jul 2013 09:01:28 +0200 Subject: Implemented Readline by using libedit. --- includes/BReadline.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'includes/BReadline.h') diff --git a/includes/BReadline.h b/includes/BReadline.h index 6f70f09..73756c4 100644 --- a/includes/BReadline.h +++ b/includes/BReadline.h @@ -1 +1,24 @@ #pragma once + +#include +#include +#include + +class Readline { + public: + Readline(const Balau::String & program, Balau::IO); + ~Readline(); + Balau::String gets(); + bool gotEOF() { return m_eof; } + void setPrompt(const Balau::String & prompt); + private: + EditLine * m_el = NULL; + Balau::IO m_in; + bool m_eof = false; + Balau::String m_prompt = "> "; + + static const char * elPrompt(EditLine *); + const char * elPrompt() { return m_prompt.to_charp(); } + static int elGetCFN(EditLine *, char * c); + int elGetCFN(char * c); +}; -- cgit v1.2.3