|
@@ -849,6 +849,18 @@ void FlushingStringBuffer::append(const char *data)
|
|
|
append(strlen(data), data);
|
|
|
}
|
|
|
|
|
|
+void FlushingStringBuffer::append(double data)
|
|
|
+{
|
|
|
+ if (isRaw)
|
|
|
+ append(sizeof(data), (char *)&data);
|
|
|
+ else
|
|
|
+ {
|
|
|
+ StringBuffer v;
|
|
|
+ v.append(data);
|
|
|
+ append(v.length(), v.str());
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void FlushingStringBuffer::append(unsigned len, const char *data)
|
|
|
{
|
|
|
try
|
|
@@ -888,7 +900,9 @@ void FlushingStringBuffer::encodeString(const char *x, unsigned len, bool utf8)
|
|
|
void FlushingStringBuffer::encodeData(const void *data, unsigned len)
|
|
|
{
|
|
|
static char hexchar[] = "0123456789ABCDEF";
|
|
|
- if (mlFmt==MarkupFmt_XML)
|
|
|
+ if (isRaw)
|
|
|
+ append(len, (const char *) data);
|
|
|
+ else
|
|
|
{
|
|
|
const byte *field = (const byte *) data;
|
|
|
for (int i = 0; i < len; i++)
|
|
@@ -897,8 +911,6 @@ void FlushingStringBuffer::encodeData(const void *data, unsigned len)
|
|
|
append(hexchar[field[i] & 0x0f]);
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- append(len, (const char *) data);
|
|
|
}
|
|
|
|
|
|
void FlushingStringBuffer::addPayload(StringBuffer &s, unsigned int reserve)
|
|
@@ -1117,6 +1129,12 @@ void FlushingStringBuffer::incrementRowCount()
|
|
|
rowCount++;
|
|
|
}
|
|
|
|
|
|
+void FlushingJsonBuffer::append(double data)
|
|
|
+{
|
|
|
+ CriticalBlock b(crit);
|
|
|
+ appendJSONRealValue(s, NULL, data);
|
|
|
+}
|
|
|
+
|
|
|
void FlushingJsonBuffer::encodeString(const char *x, unsigned len, bool utf8)
|
|
|
{
|
|
|
CriticalBlock b(crit);
|