📄 resizeablestringformatter.h
字号:
/* File: ResizeableStringFormatter.h Contains: Derived from StringFormatter, this transparently grows the output buffer if the original buffer is too small to hold all the data being placed in it */#ifndef __RESIZEABLE_STRING_FORMATTER_H__#define __RESIZEABLE_STRING_FORMATTER_H__#include "StringFormatter.h"class ResizeableStringFormatter : public StringFormatter{ public: // Pass in inBuffer=NULL and inBufSize=0 to dynamically allocate the initial buffer. ResizeableStringFormatter(char* inBuffer = NULL, UInt32 inBufSize = 0) : StringFormatter(inBuffer, inBufSize), fOriginalBuffer(inBuffer) {} //If we've been forced to increase the buffer size, fStartPut WILL be a dynamically allocated //buffer, and it WON'T be equal to fOriginalBuffer (obviously). virtual ~ResizeableStringFormatter() { if (fStartPut != fOriginalBuffer) delete [] fStartPut; } private: // This function will get called by StringFormatter if the current // output buffer is full. This object allocates a buffer that's twice // as big as the old one. virtual void BufferIsFull(char* inBuffer, UInt32 inBufferLen); char* fOriginalBuffer; };#endif //__RESIZEABLE_STRING_FORMATTER_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -