bool InboundXMLCLIProtocol::SendMessage(Variant &message) { string xml; #if (defined(HAS_TINYXML)) if (!message.SerializeToXml(xml, true)) { FATAL("Unable to serialize to XML"); return false; } xml += "\r\n\r\n"; if (_useLengthPadding) { uint32_t size = EHTONL((uint32_t) xml.length()); _outputBuffer.ReadFromBuffer((uint8_t *) & size, 4); } _outputBuffer.ReadFromString(xml); return EnqueueForOutbound(); #else FATAL("Unable to serialize to XML, must enable tinyXML"); return false; #endif }
bool XmlVariantProtocol::Serialize(string &rawData, Variant &variant) { return variant.SerializeToXml(rawData, false); }