Changeset 5174 in orxonox.OLD for trunk/src/lib/shell/shell_buffer.h
- Timestamp:
- Sep 11, 2005, 10:30:38 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_buffer.h
r5173 r5174 14 14 template<class T> class tList; 15 15 template<class T> class tIterator; 16 class Text;17 16 18 17 //! A class for ... … … 20 19 21 20 public: 22 ShellBuffer();23 21 virtual ~ShellBuffer(); 24 22 /** @returns a Pointer to the only object of this Class */ 23 inline static ShellBuffer* getInstance() { if (!ShellBuffer::singletonRef) ShellBuffer::singletonRef = new ShellBuffer(); return ShellBuffer::singletonRef; }; 25 24 26 25 // BUFFER // 27 26 /** @param bufferSize the new Buffer-Size */ 28 27 void setBufferSize(unsigned int bufferSize) { this->bufferSize = bufferSize; }; 29 void setBufferDisplaySize(unsigned int bufferDisplaySize);30 28 void flushBuffers(); 31 29 static bool addBufferLineStatic(const char* line, ...); 32 30 void addBufferLine(const char* line, va_list arg); 33 void printToDisplayBuffer(const char* text);34 31 void moveBuffer(unsigned int lineCount); 35 32 // void moveBufferTo(unsigned int lineNumber); 36 33 const char* getBufferLine(unsigned int lineNumber); 37 34 35 private: 36 ShellBuffer(); 38 37 39 private:40 unsigned int bufferSize; //!< The Size of the buffer41 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 history43 tIterator<char>* bufferIterator; //!< An iterator for the Shells main buffer.44 38 45 Text** bufferText; //!< A list of stored bufferTexts for the display of the buffer 39 private: 40 static ShellBuffer* singletonRef; //!< The singleton-reference to the only memeber of this class. 41 unsigned int bufferSize; //!< The Size of the buffer 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 46 45 char bufferArray[SHELL_BUFFER_SIZE]; //!< a BUFFER for fast writing 47 46 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.47 bool keepBuffer; //!< if the keepbuffer contains unfinished lines. 49 48 49 unsigned long lineCount; //!< how many Lines have been written out so far. 50 50 }; 51 51
Note: See TracChangeset
for help on using the changeset viewer.