Menu

[r329]: / framework / trunk / textstream.cpp  Maximize  Restore  History

Download this file

26 lines (21 with data), 413 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "textstream.h"
#include <stdarg.h>
#include <fcgiapp.h>
void Text_Stream::printf(char *format,...)
{
va_list ap;
va_start(ap,format);
int size=vsnprintf(buffer,TS_BUFFER_SIZE,format,ap);
va_end(ap);
if(size>TS_BUFFER_SIZE) {
char *str=new char[size+1];
va_start(ap,format);
vsnprintf(str,size+1,format,ap);
va_end(ap);
text += str;
delete [] str;
}
else {
text += buffer;
}
}
MongoDB Logo MongoDB