Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5173 in orxonox.OLD for trunk/src/lib/shell/shell_buffer.h


Ignore:
Timestamp:
Sep 8, 2005, 1:46:26 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: added new Class ShellBuffer, that only handles the main shell's buffer

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell_buffer.h

    r5171 r5173  
    11/*!
    2  * @file shell_completion.h
    3  * @brief The Shell Completion Tasks
     2 * @file shell_buffer.h
     3 * @brief The Shell buffer Tasks
    44*/
    55
    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)
    812
    913// FORWARD DECLARATION
     14template<class T> class tList;
     15template<class T> class tIterator;
     16class Text;
     17
     18//! A class for ...
     19class ShellBuffer {
     20
     21 public:
     22  ShellBuffer();
     23  virtual ~ShellBuffer();
    1024
    1125
    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);
    1837
    1938
    2039 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.
    2149
    2250};
    2351
    24 #endif /* _SHELL_COMPLETION_H */
     52#endif /* _SHELL_BUFFER_H */
Note: See TracChangeset for help on using the changeset viewer.