Changeset 5246 in orxonox.OLD for trunk/src/lib/shell/shell_buffer.cc
- Timestamp:
- Sep 24, 2005, 9:20:49 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/shell/shell_buffer.cc
r5215 r5246 10 10 11 11 ### File Specific: 12 main-programmer: ...12 main-programmer: Benjamin Grauer 13 13 co-programmer: ... 14 14 */ … … 40 40 this->keepBuffer = false; 41 41 this->buffer = new tList<char>; 42 this->bufferIterator = this->buffer->getIterator();43 42 44 43 this->setBufferSize(100); … … 55 54 delete this->shell; 56 55 57 this->flushBuffers(); 58 delete bufferIterator; 56 this->flush(); 59 57 delete buffer; 60 58 … … 89 87 * deletes all the Buffers 90 88 */ 91 void ShellBuffer::flush Buffers()89 void ShellBuffer::flush() 92 90 { 93 91 // delete all the Chars in the Buffers 92 tIterator<char>* bufferIterator = this->buffer->getIterator(); 94 93 char* charElem = bufferIterator->firstElement(); 95 94 while (charElem != NULL) … … 98 97 charElem = bufferIterator->nextElement(); 99 98 } 100 delete this->bufferIterator;99 delete bufferIterator; 101 100 delete this->buffer; 102 101 this->buffer = new tList<char>; 103 this->bufferIterator = this->buffer->getIterator();104 105 102 } 106 103 … … 193 190 194 191 /** 195 * moves the buffer around lineCount lines upwards (negative values move down) 196 * @param lineCount the Count of lines to move upwards 197 * 198 * @todo 199 */ 200 void ShellBuffer::moveBuffer(unsigned int lineCount) 201 { 202 } 203 204 /** 205 * @param lineNumber the n-th line from the bottom 206 * @returns the Buffer at Line lineNumber 207 */ 208 const char* ShellBuffer::getBufferLine(unsigned int lineNumber) 209 { 192 * displays some nice output from the Shell 193 */ 194 void ShellBuffer::debug() const 195 { 196 PRINT(3)("Debugging output to console (not this shell)\n"); 197 210 198 tIterator<char>* charIterator = this->buffer->getIterator(); 211 char* charElem = charIterator->firstElement(); 212 213 int i = 1; 214 while (charElem != NULL) 215 { 216 if (i++ < lineNumber) 217 { 218 delete charIterator; 219 return charElem; 220 } 221 222 charElem = charIterator->nextElement(); 199 char* tmpChar = charIterator->firstElement(); 200 while(tmpChar != NULL) 201 { 202 printf(tmpChar); 203 tmpChar = charIterator->nextElement(); 223 204 } 224 205 delete charIterator; 225 206 } 226 227 /**228 * displays some nice output from the Shell229 */230 void ShellBuffer::debug() const231 {232 PRINT(3)("Debugging output to console (not this shell)\n");233 234 char* tmpChar = bufferIterator->firstElement();235 while(tmpChar != NULL)236 {237 printf(tmpChar);238 tmpChar = bufferIterator->nextElement();239 }240 }
Note: See TracChangeset
for help on using the changeset viewer.