#include <GetLine.h>
Inherits Object.
Inherited by FShGetLine.
Inheritance diagram for GetLine:


Public Member Functions | |
| GetLine () | |
| virtual | ~GetLine () |
| int | historyAdd (char *line) |
| int | setWidth (const int width) |
| int | setPrompt (const char *prompt) |
| int | pushChar (char c) |
Protected Member Functions | |
| virtual int | onTab (char *buffer, const int promptWidth, int *cursorLoc, int *i) |
| virtual int | onInput (const char *buffer) |
| virtual int | onOutput (const char *buf)=0 |
| virtual int | onPutc (const char c)=0 |
| virtual int | onPuts (const char *buf)=0 |
| virtual unsigned int | onStrlen (const char *str) |
| String | prompt () const |
Private Member Functions | |
| void | init () |
| void | cleanup () |
| void | charInit () |
| void | charCleanup () |
| void | addChar (int c) |
| void | del (int loc) |
| void | fixup (char *prompt, int change, int cursor) |
| void | kill (int pos) |
| void | newLine () |
| void | redraw () |
| void | transpose () |
| void | yank () |
| void | word (int dir) |
| void | histInit () |
| void | histCleanup () |
| char * | histNext () |
| char * | histPrev () |
| char * | histSave (char *p) |
| void | searchUpdate (int c) |
| void | searchAddChar (int c) |
| void | searchTerm () |
| void | searchBack (int n) |
| void | searchForw (int n) |
Private Attributes | |
| int | _prevNl |
| int | _prevCr |
| GlInputMode | _mode |
| int | _initDone |
| int | _termW |
| int | _scroll |
| int | _extent |
| int | _width |
| int | _extent0 |
| int | _overwrite |
| int | _pos |
| int | _cnt |
| char | _buf [GL_LIMIT_BUFFER_SIZE] |
| char | _killBuf [GL_LIMIT_BUFFER_SIZE] |
| char | _prompt [GL_LIMIT_PROMPT_SIZE] |
| int | _searchMode |
| int | _shift |
| int | _offRight |
| int | _offLeft |
| char | _lastPrompt [GL_LIMIT_PROMPT_SIZE] |
| int | _histPos |
| int | _histLast |
| char * | _histPrevEntry |
| char * | _histBuf [GL_LIMIT_HISTORY_SIZE] |
| char | _searchPrompt [GL_LIMIT_SEARCH_SIZE+1] |
| char | _searchString [GL_LIMIT_SEARCH_SIZE] |
| int | _searchPos |
| int | _searchForwFlg |
| int | _searchLast |
Definition at line 33 of file GetLine.h.
| GetLine::GetLine | ( | ) |
Definition at line 20 of file GetLine.cpp.
References _cnt, _extent, _histPrevEntry, _initDone, _mode, _overwrite, _pos, _scroll, _searchMode, _termW, GL_DEFAULT_SCROLL, GL_DEFAULT_TERM_WIDTH, GL_MODE_NORMAL, histInit(), and init().
| GetLine::~GetLine | ( | ) | [virtual] |
| int GetLine::historyAdd | ( | char * | line | ) |
Definition at line 44 of file GetLine.cpp.
References _histBuf, _histLast, _histPos, _histPrevEntry, _initDone, ERROR, GL_LIMIT_HISTORY_SIZE, histInit(), histSave(), MEM_FREE, MSG_NULL_POINTER, and OK.
Referenced by newLine().
| int GetLine::setWidth | ( | const int | width | ) |
Definition at line 78 of file GetLine.cpp.
References _scroll, _termW, ERROR, ERROR_GETLINE_WRONG_SCREEN_WIDTH, GL_LIMIT_MIN_SCREEN_WIDTH, and OK.
Referenced by Telnet::parse().
| int GetLine::setPrompt | ( | const char * | prompt | ) |
Definition at line 89 of file GetLine.cpp.
References _buf, _prompt, ERROR_BACKTRACE(), FAILED(), fixup(), GL_LIMIT_BUFFER_SIZE, OK, and onInput().
Referenced by FShGetLine::FShGetLine(), and FShGetLine::onOutput().
| int GetLine::pushChar | ( | char | c | ) |
Definition at line 105 of file GetLine.cpp.
References _buf, _cnt, _extent, _initDone, _mode, _overwrite, _pos, _prevCr, _prevNl, _prompt, _searchMode, addChar(), del(), ERROR_BACKTRACE(), FAILED(), fixup(), GL_LIMIT_BUFFER_SIZE, GL_MODE_ESC, GL_MODE_NORMAL, GL_MODE_SQ_PAR, histNext(), histPrev(), kill(), newLine(), OK, onInput(), onOutput(), onPutc(), onStrlen(), onTab(), redraw(), searchAddChar(), searchBack(), searchForw(), searchTerm(), transpose(), word(), and yank().
| int GetLine::onTab | ( | char * | buffer, | |
| const int | promptWidth, | |||
| int * | cursorLoc, | |||
| int * | i | |||
| ) | [protected, virtual] |
Reimplemented in FShGetLine.
Definition at line 801 of file GetLine.cpp.
References OK.
Referenced by pushChar().
| int GetLine::onInput | ( | const char * | buffer | ) | [protected, virtual] |
Definition at line 795 of file GetLine.cpp.
References OK.
Referenced by newLine(), pushChar(), searchTerm(), and setPrompt().
| virtual int GetLine::onOutput | ( | const char * | buf | ) | [protected, pure virtual] |
| virtual int GetLine::onPutc | ( | const char | c | ) | [protected, pure virtual] |
Implemented in FShGetLine.
Referenced by del(), fixup(), histNext(), histPrev(), kill(), newLine(), pushChar(), redraw(), searchBack(), searchForw(), searchUpdate(), transpose(), and yank().
| virtual int GetLine::onPuts | ( | const char * | buf | ) | [protected, pure virtual] |
| unsigned int GetLine::onStrlen | ( | const char * | str | ) | [protected, virtual] |
Reimplemented in FShGetLine.
Definition at line 816 of file GetLine.cpp.
Referenced by fixup(), and pushChar().
| String GetLine::prompt | ( | ) | const [protected] |
| void GetLine::init | ( | ) | [private] |
Definition at line 272 of file GetLine.cpp.
References _initDone, and histInit().
Referenced by GetLine().
| void GetLine::cleanup | ( | ) | [private] |
| void GetLine::charInit | ( | ) | [private] |
| void GetLine::charCleanup | ( | ) | [private] |
| void GetLine::addChar | ( | int | c | ) | [private] |
Definition at line 286 of file GetLine.cpp.
References _buf, _cnt, _extent, _overwrite, _pos, _prompt, ERROR, ERROR_GETLINE_INPUT_BUFFER_OVERFLOW, fixup(), and GL_LIMIT_BUFFER_SIZE.
Referenced by pushChar().
| void GetLine::del | ( | int | loc | ) | [private] |
Definition at line 377 of file GetLine.cpp.
References _buf, _cnt, _pos, _prompt, ERROR_BACKTRACE(), FAILED(), fixup(), and onPutc().
Referenced by pushChar().
| void GetLine::fixup | ( | char * | prompt, | |
| int | change, | |||
| int | cursor | |||
| ) | [private] |
Definition at line 449 of file GetLine.cpp.
References _buf, _cnt, _extent, _lastPrompt, _offLeft, _offRight, _pos, _prompt, _scroll, _shift, _termW, _width, ERROR_BACKTRACE(), FAILED(), GL_LIMIT_BUFFER_SIZE, onPutc(), onPuts(), and onStrlen().
Referenced by addChar(), del(), kill(), newLine(), pushChar(), redraw(), searchAddChar(), searchBack(), searchForw(), searchTerm(), setPrompt(), transpose(), word(), and yank().
| void GetLine::kill | ( | int | pos | ) | [private] |
Definition at line 392 of file GetLine.cpp.
References _buf, _cnt, _killBuf, _prompt, ERROR_BACKTRACE(), FAILED(), fixup(), and onPutc().
Referenced by FShGetLine::onOutput(), and pushChar().
| void GetLine::newLine | ( | ) | [private] |
Definition at line 355 of file GetLine.cpp.
References _buf, _cnt, _prompt, ERROR, ERROR_BACKTRACE(), ERROR_GETLINE_INPUT_BUFFER_OVERFLOW, FAILED(), fixup(), GL_LIMIT_BUFFER_SIZE, historyAdd(), onInput(), onOutput(), and onPutc().
Referenced by pushChar().
| void GetLine::redraw | ( | ) | [private] |
Definition at line 429 of file GetLine.cpp.
References _initDone, _pos, _prompt, ERROR_BACKTRACE(), FAILED(), fixup(), and onPutc().
Referenced by pushChar().
| void GetLine::transpose | ( | ) | [private] |
Definition at line 337 of file GetLine.cpp.
References _buf, _cnt, _extent, _pos, _prompt, ERROR_BACKTRACE(), FAILED(), fixup(), and onPutc().
Referenced by pushChar().
| void GetLine::yank | ( | ) | [private] |
Definition at line 305 of file GetLine.cpp.
References _buf, _cnt, _extent, _killBuf, _overwrite, _pos, _prompt, ERROR, ERROR_BACKTRACE(), ERROR_GETLINE_INPUT_BUFFER_OVERFLOW, FAILED(), fixup(), GL_LIMIT_BUFFER_SIZE, and onPutc().
Referenced by pushChar().
| void GetLine::word | ( | int | dir | ) | [private] |
Definition at line 406 of file GetLine.cpp.
References _buf, _cnt, _pos, _prompt, and fixup().
Referenced by pushChar().
| void GetLine::histInit | ( | ) | [private] |
Definition at line 569 of file GetLine.cpp.
References _histBuf, _histLast, _histPos, and GL_LIMIT_HISTORY_SIZE.
Referenced by GetLine(), historyAdd(), and init().
| void GetLine::histCleanup | ( | ) | [private] |
Definition at line 580 of file GetLine.cpp.
References _histBuf, GL_LIMIT_HISTORY_SIZE, and MEM_FREE.
Referenced by ~GetLine().
| char * GetLine::histNext | ( | ) | [private] |
Definition at line 609 of file GetLine.cpp.
References _histBuf, _histLast, _histPos, ERROR_BACKTRACE(), FAILED(), GL_LIMIT_HISTORY_SIZE, and onPutc().
Referenced by pushChar(), and searchForw().
| char * GetLine::histPrev | ( | ) | [private] |
Definition at line 590 of file GetLine.cpp.
References _histBuf, _histLast, _histPos, ERROR_BACKTRACE(), FAILED(), GL_LIMIT_HISTORY_SIZE, and onPutc().
Referenced by pushChar(), and searchBack().
| char * GetLine::histSave | ( | char * | p | ) | [private] |
Definition at line 627 of file GetLine.cpp.
References ERROR, MEM_ALLOC, and MSG_MEMORY_CANNOT_ALLOCATE.
Referenced by historyAdd().
| void GetLine::searchUpdate | ( | int | c | ) | [private] |
Definition at line 651 of file GetLine.cpp.
References _histLast, _histPos, _searchPos, _searchPrompt, _searchString, ERROR_BACKTRACE(), FAILED(), and onPutc().
Referenced by searchAddChar(), searchBack(), and searchForw().
| void GetLine::searchAddChar | ( | int | c | ) | [private] |
Definition at line 685 of file GetLine.cpp.
References _buf, _histBuf, _histLast, _histPos, _searchForwFlg, _searchLast, _searchPos, _searchPrompt, _searchString, fixup(), searchBack(), searchForw(), and searchUpdate().
Referenced by pushChar().
| void GetLine::searchTerm | ( | ) | [private] |
Definition at line 711 of file GetLine.cpp.
References _buf, _histLast, _histPos, _pos, _prompt, _searchMode, ERROR_BACKTRACE(), FAILED(), fixup(), and onInput().
Referenced by pushChar().
| void GetLine::searchBack | ( | int | n | ) | [private] |
Definition at line 723 of file GetLine.cpp.
References _buf, _histLast, _histPos, _searchForwFlg, _searchLast, _searchMode, _searchPos, _searchPrompt, _searchString, ERROR_BACKTRACE(), FAILED(), fixup(), histPrev(), onPutc(), and searchUpdate().
Referenced by pushChar(), and searchAddChar().
| void GetLine::searchForw | ( | int | n | ) | [private] |
Definition at line 758 of file GetLine.cpp.
References _buf, _histLast, _histPos, _searchForwFlg, _searchLast, _searchMode, _searchPos, _searchPrompt, _searchString, ERROR_BACKTRACE(), FAILED(), fixup(), histNext(), onPutc(), and searchUpdate().
Referenced by pushChar(), and searchAddChar().
int GetLine::_prevNl [private] |
int GetLine::_prevCr [private] |
GlInputMode GetLine::_mode [private] |
int GetLine::_initDone [private] |
Definition at line 91 of file GetLine.h.
Referenced by cleanup(), GetLine(), historyAdd(), init(), pushChar(), and redraw().
int GetLine::_termW [private] |
int GetLine::_scroll [private] |
int GetLine::_extent [private] |
Definition at line 94 of file GetLine.h.
Referenced by addChar(), fixup(), GetLine(), pushChar(), transpose(), and yank().
int GetLine::_width [private] |
int GetLine::_extent0 [private] |
int GetLine::_overwrite [private] |
int GetLine::_pos [private] |
Definition at line 98 of file GetLine.h.
Referenced by addChar(), del(), fixup(), GetLine(), pushChar(), redraw(), searchTerm(), transpose(), word(), and yank().
int GetLine::_cnt [private] |
char GetLine::_buf[GL_LIMIT_BUFFER_SIZE] [private] |
Definition at line 100 of file GetLine.h.
Referenced by addChar(), del(), fixup(), kill(), newLine(), pushChar(), searchAddChar(), searchBack(), searchForw(), searchTerm(), setPrompt(), transpose(), word(), and yank().
char GetLine::_killBuf[GL_LIMIT_BUFFER_SIZE] [private] |
char GetLine::_prompt[GL_LIMIT_PROMPT_SIZE] [private] |
Definition at line 102 of file GetLine.h.
Referenced by addChar(), del(), fixup(), kill(), newLine(), prompt(), pushChar(), redraw(), searchTerm(), setPrompt(), transpose(), word(), and yank().
int GetLine::_searchMode [private] |
Definition at line 103 of file GetLine.h.
Referenced by GetLine(), pushChar(), searchBack(), searchForw(), and searchTerm().
int GetLine::_shift [private] |
int GetLine::_offRight [private] |
int GetLine::_offLeft [private] |
char GetLine::_lastPrompt[GL_LIMIT_PROMPT_SIZE] [private] |
int GetLine::_histPos [private] |
Definition at line 109 of file GetLine.h.
Referenced by histInit(), histNext(), historyAdd(), histPrev(), searchAddChar(), searchBack(), searchForw(), searchTerm(), and searchUpdate().
int GetLine::_histLast [private] |
Definition at line 110 of file GetLine.h.
Referenced by histInit(), histNext(), historyAdd(), histPrev(), searchAddChar(), searchBack(), searchForw(), searchTerm(), and searchUpdate().
char* GetLine::_histPrevEntry [private] |
char* GetLine::_histBuf[GL_LIMIT_HISTORY_SIZE] [private] |
Definition at line 112 of file GetLine.h.
Referenced by histCleanup(), histInit(), histNext(), historyAdd(), histPrev(), and searchAddChar().
char GetLine::_searchPrompt[GL_LIMIT_SEARCH_SIZE+1] [private] |
Definition at line 114 of file GetLine.h.
Referenced by searchAddChar(), searchBack(), searchForw(), and searchUpdate().
char GetLine::_searchString[GL_LIMIT_SEARCH_SIZE] [private] |
Definition at line 115 of file GetLine.h.
Referenced by searchAddChar(), searchBack(), searchForw(), and searchUpdate().
int GetLine::_searchPos [private] |
Definition at line 116 of file GetLine.h.
Referenced by searchAddChar(), searchBack(), searchForw(), and searchUpdate().
int GetLine::_searchForwFlg [private] |
Definition at line 117 of file GetLine.h.
Referenced by searchAddChar(), searchBack(), and searchForw().
int GetLine::_searchLast [private] |
Definition at line 118 of file GetLine.h.
Referenced by searchAddChar(), searchBack(), and searchForw().
1.5.1