1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Made a lot of the functions that used to return a raw XmlElement* instead return a std::unique_ptr<XmlElement> to make it safer and more concise to capture them. Also added new methods to XmlElement for generating text, and deprecated the old ones

This commit is contained in:
jules 2018-10-16 15:37:55 +01:00
parent bb5b534ab8
commit 2e2cfb5f6c
48 changed files with 373 additions and 362 deletions

View file

@ -65,7 +65,7 @@ void NetworkServiceDiscovery::Advertiser::sendBroadcast()
auto localAddress = IPAddress::getLocalAddress();
message.setAttribute ("address", localAddress.toString());
auto broadcastAddress = IPAddress::getInterfaceBroadcastAddress (localAddress);
auto data = message.createDocument ({}, true, false);
auto data = message.toString (XmlElement::TextFormat().singleLine().withoutHeader());
socket.write (broadcastAddress.toString(), broadcastPort, data.toRawUTF8(), (int) data.getNumBytesAsUTF8());
}