llfixedbuffer.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLFIXEDBUFFER_H
00033 #define LL_LLFIXEDBUFFER_H
00034 
00035 #include "timer.h"
00036 #include <deque>
00037 #include <string>
00038 #include "llstring.h"
00039 
00040 // Fixed size buffer for console output and other things.
00041 
00042 class LLFixedBuffer
00043 {
00044 public:
00045         LLFixedBuffer(const U32 max_lines = 20);
00046         virtual ~LLFixedBuffer();
00047 
00048         LLTimer mTimer;
00049         U32             mMaxLines;
00050         std::deque<LLWString>   mLines;
00051         std::deque<F32>                 mAddTimes;
00052         std::deque<S32>                 mLineLengths;
00053 
00054         void clear(); // Clear the buffer, and reset it.
00055         virtual void addLine(const LLString& utf8line);
00056         virtual void addLine(const LLWString& line);
00057 
00058         // Get lines currently in the buffer, up to max_size chars, max_length lines
00059         char *getLines(U32 max_size = 0, U32 max_length = 0); 
00060         void setMaxLines(S32 max_lines);
00061 protected:
00062         virtual void removeExtraLines();
00063 };
00064 
00065 const U32 FIXED_BUF_MAX_LINE_LEN = 255; // Not including termnating 0
00066 
00067 #endif //LL_FIXED_BUFFER_H

Generated on Thu Jul 1 06:08:30 2010 for Second Life Viewer by  doxygen 1.4.7