window: use readline for handling line input

This commit is contained in:
Andrzej Rybczak
2013-12-25 23:31:27 +01:00
parent 819d8baebd
commit 70945596ef
8 changed files with 203 additions and 272 deletions

View File

@@ -71,27 +71,28 @@ namespace Helpers {//
void mpd();
/// called each time user types another character while inside Window::getString
bool getString(const std::wstring &);
bool getString(const char *);
/// called each time user changes current filter (while being inside Window::getString)
struct ApplyFilterImmediately
{
ApplyFilterImmediately(Filterable *f, const std::wstring &filter)
: m_f(f), m_ws(filter) { }
template <typename StringT>
ApplyFilterImmediately(Filterable *f, StringT &&filter)
: m_f(f), m_s(std::forward<StringT>(filter)) { }
bool operator()(const std::wstring &ws);
bool operator()(const char *s);
private:
Filterable *m_f;
std::wstring m_ws;
std::string m_s;
};
struct TryExecuteImmediateCommand
{
bool operator()(const std::wstring &ws);
bool operator()(const char *s);
private:
std::wstring m_ws;
std::string m_s;
};
}