#pragma once #include #include #include class JSonElement; template class Optional; class CurseOutput { public: CurseOutput(JSonElement *rootData); virtual ~CurseOutput(); void run(); private: typedef Optional, const JSonElement *> > t_nextKey; protected: void init(); void shutdown(); void redraw(); void redraw(std::pair &, const std::pair&, const JSonElement *); bool readInput(); void getScreenSize(std::pair &); static CurseOutput::t_nextKey findNext(const JSonElement *); void write(const int &x, const int &y, JSonElement *item); void write(const int &x, const int &y, const std::string &item); void writeKey(const std::string &key, std::pair &cursor); const JSonElement *data, *selection; const JSonElement *select_up, *select_down; SCREEN *screen; FILE *screen_fd; bool selectFound; bool selected; std::pair, const JSonElement *> topleft; const unsigned int indentLevel; };