|
@@ -150,146 +150,3 @@ extern thorhelper_decl void convertRowToJSON(size32_t & lenResult, char * & resu
|
|
|
rtlStrToStrX(sizeResult, result, writer.length(), writer.str());
|
|
|
lenResult = rtlUtf8Length(sizeResult, result);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-//=============================================================================================
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputLiteralString(size32_t size, const char *value, const char *fieldname)
|
|
|
-{
|
|
|
- //Horrible that there is no interface for adding a (len, data) string
|
|
|
- StringBuffer temp;
|
|
|
- temp.append(size, value);
|
|
|
- root->addProp(fieldname, temp.str());
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputInlineXml(const char *text)
|
|
|
-{
|
|
|
- throwUnexpected();
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputQuoted(const char *text)
|
|
|
-{
|
|
|
- throwUnexpected();
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputQString(unsigned len, const char *value, const char *fieldname)
|
|
|
-{
|
|
|
- MemoryAttr tempBuffer;
|
|
|
- char * temp = (char *)tempBuffer.allocate(len);
|
|
|
- rtlQStrToStr(len, temp, len, value);
|
|
|
- outputString(len, temp, fieldname);
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputString(unsigned len, const char *value, const char *fieldname)
|
|
|
-{
|
|
|
- size32_t resultLen;
|
|
|
- rtlDataAttr result;
|
|
|
- rtlStrToUtf8X(resultLen, result.refstr(), len, value);
|
|
|
-
|
|
|
- size32_t size = rtlUtf8Size(resultLen, result.getstr());
|
|
|
- outputLiteralString(size, result.getstr(), fieldname);
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputBool(bool value, const char *fieldname)
|
|
|
-{
|
|
|
- root->setPropBool(fieldname, value);
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputData(unsigned len, const void *value, const char *fieldname)
|
|
|
-{
|
|
|
- root->setPropBin(fieldname, len, value);
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputInt(__int64 value, unsigned size, const char *fieldname)
|
|
|
-{
|
|
|
- root->setPropInt64(fieldname, value);
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputUInt(unsigned __int64 value, unsigned size, const char *fieldname)
|
|
|
-{
|
|
|
- //Convert to string first?
|
|
|
- root->setPropInt64(fieldname, value);
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputReal(double value, const char *fieldname)
|
|
|
-{
|
|
|
- StringAttr temp;
|
|
|
- temp.setown(rtlRealToVStrX(value));
|
|
|
- root->setProp(fieldname, temp);
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputDecimal(const void *value, unsigned size, unsigned precision, const char *fieldname)
|
|
|
-{
|
|
|
- Decimal temp;
|
|
|
- char text[50];
|
|
|
- temp.setDecimal(size, precision, value);
|
|
|
- temp.getCString(sizeof(text), text);
|
|
|
- root->setProp(fieldname, text);
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputUDecimal(const void *value, unsigned size, unsigned precision, const char *fieldname)
|
|
|
-{
|
|
|
- Decimal temp;
|
|
|
- char text[50];
|
|
|
- temp.setUDecimal(size, precision, value);
|
|
|
- temp.getCString(sizeof(text), text);
|
|
|
- root->setProp(fieldname, text);
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputUnicode(unsigned len, const UChar *value, const char *fieldname)
|
|
|
-{
|
|
|
- size32_t resultLen;
|
|
|
- rtlDataAttr result;
|
|
|
- rtlUnicodeToUtf8X(resultLen, result.refstr(), len, value);
|
|
|
-
|
|
|
- size32_t size = rtlUtf8Size(resultLen, result.getstr());
|
|
|
- outputLiteralString(size, result.getstr(), fieldname);
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputUtf8(unsigned len, const char *value, const char *fieldname)
|
|
|
-{
|
|
|
- size32_t size = rtlUtf8Size(len, value);
|
|
|
- outputLiteralString(size, value, fieldname);
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputBeginDataset(const char *fieldname, bool nestChildren)
|
|
|
-{
|
|
|
- stack.append(*root);
|
|
|
- root = root->setPropTree(fieldname);
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputEndDataset(const char *fieldname)
|
|
|
-{
|
|
|
- root = &stack.popGet();
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputBeginNested(const char *fieldname, bool nestChildren)
|
|
|
-{
|
|
|
- stack.append(*root);
|
|
|
- root = root->setPropTree(fieldname);
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputEndNested(const char *fieldname)
|
|
|
-{
|
|
|
- root = &stack.popGet();
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputBeginArray(const char *fieldname) //repeated elements are inline for xml
|
|
|
-{
|
|
|
- throwUnexpected();
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputEndArray(const char *fieldname)
|
|
|
-{
|
|
|
- throwUnexpected();
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputSetAll()
|
|
|
-{
|
|
|
- throwUnexpected();
|
|
|
-}
|
|
|
-
|
|
|
-void PropertyTreeXmlWriter::outputXmlns(const char *name, const char *uri)
|
|
|
-{
|
|
|
- throwUnexpected();
|
|
|
-}
|