Ejemplo n.º 1
0
std::string XMPPSerializer::serializeHeader(const ProtocolHeader& header) const {
	std::string result = "<?xml version=\"1.0\"?><stream:stream xmlns=\"" + getDefaultNamespace() + "\" xmlns:stream=\"http://etherx.jabber.org/streams\"";
	if (!header.getFrom().empty()) {
		result += " from=\"" + header.getFrom() + "\"";
	}
	if (!header.getTo().empty()) {
		result += " to=\"" + header.getTo() + "\"";
	}
	if (!header.getID().empty()) {
		result += " id=\"" + header.getID() + "\"";
	}
	if (!header.getVersion().empty()) {
		result += " version=\"" + header.getVersion() + "\"";
	}
	result += ">";
	return result;
}
OplogBufferCollection::OplogBufferCollection(StorageInterface* storageInterface)
    : OplogBufferCollection(storageInterface, getDefaultNamespace()) {}