Changeset 5173 in orxonox.OLD for trunk/src/lib/shell
- Timestamp:
- Sep 8, 2005, 1:46:26 AM (19 years ago)
- Location:
- trunk/src/lib/shell
- Files:
-
- 4 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/Makefile.am
r5170 r5173 5 5 6 6 libORXshell_a_SOURCES = shell.cc \ 7 shell_buffer.cc \ 7 8 shell_command.cc \ 8 9 shell_completion.cc … … 10 11 11 12 noinst_HEADERS= shell.h \ 13 shell_buffer.h \ 12 14 shell_command.h \ 13 15 shell_completion.h -
trunk/src/lib/shell/Makefile.in
r5170 r5173 54 54 libORXshell_a_AR = $(AR) $(ARFLAGS) 55 55 libORXshell_a_LIBADD = 56 am_libORXshell_a_OBJECTS = shell.$(OBJEXT) shell_ command.$(OBJEXT) \57 shell_com pletion.$(OBJEXT)56 am_libORXshell_a_OBJECTS = shell.$(OBJEXT) shell_buffer.$(OBJEXT) \ 57 shell_command.$(OBJEXT) shell_completion.$(OBJEXT) 58 58 libORXshell_a_OBJECTS = $(am_libORXshell_a_OBJECTS) 59 59 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) … … 61 61 am__depfiles_maybe = depfiles 62 62 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/shell.Po \ 63 @AMDEP_TRUE@ ./$(DEPDIR)/shell_buffer.Po \ 63 64 @AMDEP_TRUE@ ./$(DEPDIR)/shell_command.Po \ 64 65 @AMDEP_TRUE@ ./$(DEPDIR)/shell_completion.Po … … 185 186 noinst_LIBRARIES = libORXshell.a 186 187 libORXshell_a_SOURCES = shell.cc \ 188 shell_buffer.cc \ 187 189 shell_command.cc \ 188 190 shell_completion.cc 189 191 190 192 noinst_HEADERS = shell.h \ 193 shell_buffer.h \ 191 194 shell_command.h \ 192 195 shell_completion.h … … 240 243 241 244 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell.Po@am__quote@ 245 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_buffer.Po@am__quote@ 242 246 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_command.Po@am__quote@ 243 247 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shell_completion.Po@am__quote@ -
trunk/src/lib/shell/shell.cc
r5172 r5173 34 34 SHELL_COMMAND(clear, Shell, clear)->describe("Clears the shell from unwanted lines (empties all buffers)"); 35 35 SHELL_COMMAND(deactivate, Shell, deactivate)->describe("Deactivates the Shell. (moves it into background)"); 36 37 36 38 37 /** -
trunk/src/lib/shell/shell.h
r5166 r5173 9 9 #include "element_2d.h" 10 10 #include "event_listener.h" 11 #include "shell_buffer.h" 11 12 12 13 #include <stdarg.h> 13 14 #define SHELL_BUFFER_SIZE 16384 //!< The Size of the input-buffers (should be large enough to carry any kind of input)15 14 16 15 // FORWARD DECLARATION -
trunk/src/lib/shell/shell_buffer.cc
r5171 r5173 16 16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ 17 17 18 #include "shell_ completion.h"18 #include "shell_buffer.h" 19 19 20 20 using namespace std; … … 25 25 * @todo this constructor is not jet implemented - do it 26 26 */ 27 Shell Completion::ShellCompletion()27 ShellBuffer::ShellBuffer () 28 28 { 29 29 // this->setClassID(CL_PROTO_ID, "ProtoClass"); … … 45 45 * standard deconstructor 46 46 */ 47 Shell Completion::~ShellCompletion()47 ShellBuffer::~ShellBuffer () 48 48 { 49 49 // delete what has to be deleted here -
trunk/src/lib/shell/shell_buffer.h
r5171 r5173 1 1 /*! 2 * @file shell_ completion.h3 * @brief The Shell CompletionTasks2 * @file shell_buffer.h 3 * @brief The Shell buffer Tasks 4 4 */ 5 5 6 #ifndef _SHELL_COMPLETION_H 7 #define _SHELL_COMPLETION_H 6 #ifndef _SHELL_BUFFER_H 7 #define _SHELL_BUFFER_H 8 9 #include <stdarg.h> 10 11 #define SHELL_BUFFER_SIZE 16384 //!< The Size of the input-buffers (should be large enough to carry any kind of input) 8 12 9 13 // FORWARD DECLARATION 14 template<class T> class tList; 15 template<class T> class tIterator; 16 class Text; 17 18 //! A class for ... 19 class ShellBuffer { 20 21 public: 22 ShellBuffer(); 23 virtual ~ShellBuffer(); 10 24 11 25 12 //! A class for ... 13 class ShellCompletion { 14 15 public: 16 ShellCompletion(); 17 virtual ~ShellCompletion(); 26 // BUFFER // 27 /** @param bufferSize the new Buffer-Size */ 28 void setBufferSize(unsigned int bufferSize) { this->bufferSize = bufferSize; }; 29 void setBufferDisplaySize(unsigned int bufferDisplaySize); 30 void flushBuffers(); 31 static bool addBufferLineStatic(const char* line, ...); 32 void addBufferLine(const char* line, va_list arg); 33 void printToDisplayBuffer(const char* text); 34 void moveBuffer(unsigned int lineCount); 35 // void moveBufferTo(unsigned int lineNumber); 36 const char* getBufferLine(unsigned int lineNumber); 18 37 19 38 20 39 private: 40 unsigned int bufferSize; //!< The Size of the buffer 41 unsigned int bufferDisplaySize; //!< The Size of the Display-buffer, in lines (not in characters) 42 tList<char>* buffer; //!< A list of stored char-arrays(strings) to store the history 43 tIterator<char>* bufferIterator; //!< An iterator for the Shells main buffer. 44 45 Text** bufferText; //!< A list of stored bufferTexts for the display of the buffer 46 char bufferArray[SHELL_BUFFER_SIZE]; //!< a BUFFER for fast writing 47 char keepBufferArray[SHELL_BUFFER_SIZE]; //!< a BUFFER to have multi-non-newLine commands be copied into the shell. 48 bool keepBuffer; //!< if the keepbuffer contains unfinished lines. 21 49 22 50 }; 23 51 24 #endif /* _SHELL_ COMPLETION_H */52 #endif /* _SHELL_BUFFER_H */
Note: See TracChangeset
for help on using the changeset viewer.