00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef CSTREAMBUFFER_H
00016 #define CSTREAMBUFFER_H
00017
00018 #include "BasicTypes.h"
00019 #include "stdlist.h"
00020 #include "stdvector.h"
00021
00023
00026 class CStreamBuffer {
00027 public:
00028 CStreamBuffer();
00029 ~CStreamBuffer();
00030
00032
00033
00035
00040 const void* peek(UInt32 n);
00041
00043
00047 void pop(UInt32 n);
00048
00050
00053 void write(const void* data, UInt32 n);
00054
00056
00057
00058
00060
00063 UInt32 getSize() const;
00064
00066
00067 private:
00068 static const UInt32 kChunkSize;
00069
00070 typedef std::vector<UInt8> Chunk;
00071 typedef std::list<Chunk> ChunkList;
00072
00073 ChunkList m_chunks;
00074 UInt32 m_size;
00075 UInt32 m_headUsed;
00076 };
00077
00078 #endif