diff options
author | Kevin Smith <git@kismith.co.uk> | 2018-07-27 13:39:18 (GMT) |
---|---|---|
committer | Kevin Smith <kevin.smith@isode.com> | 2018-07-27 13:53:55 (GMT) |
commit | 48596613cfe0f45c0916beabbcc3a27e01752c4b (patch) | |
tree | f8137f72b599d02eb1bc4f6dbc833c416f4e0295 | |
parent | 1bcdcbd4c8e1c6c971087f049422d3bd52be2a6b (diff) | |
download | swift-48596613cfe0f45c0916beabbcc3a27e01752c4b.zip swift-48596613cfe0f45c0916beabbcc3a27e01752c4b.tar.bz2 |
Autofix boost-use-to-string clang-tidy warnings
Done by adding --fix --fix-errors to the clang-tidy args in
the Makefile
Test-Information:
Unit tests pass (macOS)
Change-Id: I3a4df955ac3553afeb9384f23f9d8b2ef01117e2
32 files changed, 83 insertions, 83 deletions
diff --git a/Slimber/MainController.cpp b/Slimber/MainController.cpp index cd36132..93eb4e7 100644 --- a/Slimber/MainController.cpp +++ b/Slimber/MainController.cpp @@ -104,3 +104,3 @@ void MainController::handleServerStopped(boost::optional<ServerError> error) { case ServerError::C2SPortConflict: - message = std::string("Error: Port ") + boost::lexical_cast<std::string>(server->getClientToServerPort()) + std::string(" in use"); + message = std::string("Error: Port ") + std::to_string(server->getClientToServerPort()) + std::string(" in use"); break; @@ -110,3 +110,3 @@ void MainController::handleServerStopped(boost::optional<ServerError> error) { case ServerError::LinkLocalPortConflict: - message = std::string("Error: Port ") + boost::lexical_cast<std::string>(server->getLinkLocalPort()) + std::string(" in use"); + message = std::string("Error: Port ") + std::to_string(server->getLinkLocalPort()) + std::string(" in use"); break; diff --git a/Swift/Controllers/AccountController.cpp b/Swift/Controllers/AccountController.cpp index fe7c200..ec914a6 100644 --- a/Swift/Controllers/AccountController.cpp +++ b/Swift/Controllers/AccountController.cpp @@ -690,3 +690,3 @@ void AccountController::handleDisconnected(const boost::optional<ClientError>& e if (lastDisconnectError_) { - message = str(format(QT_TRANSLATE_NOOP("", "Reconnect to %1% failed: %2%. Will retry in %3% seconds.")) % jid_.getDomain() % message % boost::lexical_cast<std::string>(timeBeforeNextReconnect_)); + message = str(format(QT_TRANSLATE_NOOP("", "Reconnect to %1% failed: %2%. Will retry in %3% seconds.")) % jid_.getDomain() % message % std::to_string(timeBeforeNextReconnect_)); lastDisconnectError_->conclude(); diff --git a/Swift/QtUI/QtCachedImageScaler.cpp b/Swift/QtUI/QtCachedImageScaler.cpp index e1f540b..445d113 100644 --- a/Swift/QtUI/QtCachedImageScaler.cpp +++ b/Swift/QtUI/QtCachedImageScaler.cpp @@ -23,3 +23,3 @@ boost::filesystem::path QtCachedImageScaler::getScaledImage(const boost::filesys boost::filesystem::path scaledImagePath(imagePath); - std::string suffix = "." + boost::lexical_cast<std::string>(size); + std::string suffix = "." + std::to_string(size); scaledImagePath = stringToPath(pathToString(scaledImagePath) + suffix); diff --git a/Swift/QtUI/QtFormWidget.cpp b/Swift/QtUI/QtFormWidget.cpp index 96c2da0..860ddfa 100644 --- a/Swift/QtUI/QtFormWidget.cpp +++ b/Swift/QtUI/QtFormWidget.cpp @@ -149,3 +149,3 @@ QWidget* QtFormWidget::createWidget(FormField::ref field, const FormField::Type /* for multi-item forms we need to distinguish between the different rows */ - indexString = boost::lexical_cast<std::string>(index); + indexString = std::to_string(index); } diff --git a/Swift/QtUI/QtHistoryWindow.cpp b/Swift/QtUI/QtHistoryWindow.cpp index 983d0e9..0e7e89d 100644 --- a/Swift/QtUI/QtHistoryWindow.cpp +++ b/Swift/QtUI/QtHistoryWindow.cpp @@ -133,3 +133,3 @@ void QtHistoryWindow::addMessage(const std::string &message, const std::string & - std::string id = "id" + boost::lexical_cast<std::string>(idCounter_++); + std::string id = "id" + std::to_string(idCounter_++); diff --git a/Swift/QtUI/QtPlainChatView.cpp b/Swift/QtUI/QtPlainChatView.cpp index 3d67091..cdee1e6 100644 --- a/Swift/QtUI/QtPlainChatView.cpp +++ b/Swift/QtUI/QtPlainChatView.cpp @@ -180,3 +180,3 @@ std::string QtPlainChatView::addFileTransfer(const std::string& senderName, cons { - const std::string ftId = "ft" + boost::lexical_cast<std::string>(idGenerator_++); + const std::string ftId = "ft" + std::to_string(idGenerator_++); const std::string sizeString = formatSize(sizeInBytes); diff --git a/Swift/QtUI/QtWebKitChatView.cpp b/Swift/QtUI/QtWebKitChatView.cpp index f2effa8..bca9e2e 100644 --- a/Swift/QtUI/QtWebKitChatView.cpp +++ b/Swift/QtUI/QtWebKitChatView.cpp @@ -582,3 +582,3 @@ std::string QtWebKitChatView::addMessage( QString qAvatarPath = scaledAvatarPath.isEmpty() ? "qrc:/icons/avatar.svg" : QUrl::fromLocalFile(scaledAvatarPath).toEncoded(); - std::string id = "id" + boost::lexical_cast<std::string>(idCounter_++); + std::string id = "id" + std::to_string(idCounter_++); addMessageBottom(std::make_shared<MessageSnippet>(htmlString, QtUtilities::htmlEscape(P2QSTRING(senderName)), B2QDATE(time), qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), direction)); @@ -660,3 +660,3 @@ std::string QtWebKitChatView::addFileTransfer(const std::string& senderName, con QString qAvatarPath = scaledAvatarPath.isEmpty() ? "qrc:/icons/avatar.svg" : QUrl::fromLocalFile(scaledAvatarPath).toEncoded(); - std::string id = "ftmessage" + boost::lexical_cast<std::string>(idCounter_++); + std::string id = "ftmessage" + std::to_string(idCounter_++); addMessageBottom(std::make_shared<MessageSnippet>(htmlString, QtUtilities::htmlEscape(P2QSTRING(senderName)), B2QDATE(boost::posix_time::second_clock::universal_time()), qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id), ChatSnippet::getDirection(actionText))); @@ -694,3 +694,3 @@ std::string QtWebKitChatView::addWhiteboardRequest(const QString& contact, bool QString qAvatarPath = "qrc:/icons/avatar.svg"; - std::string id = "wbmessage" + boost::lexical_cast<std::string>(idCounter_++); + std::string id = "wbmessage" + std::to_string(idCounter_++); addMessageBottom(std::make_shared<MessageSnippet>(htmlString, QtUtilities::htmlEscape(contact), B2QDATE(boost::posix_time::second_clock::universal_time()), qAvatarPath, false, false, theme_, P2QSTRING(id), ChatSnippet::getDirection(actionText))); @@ -851,3 +851,3 @@ void QtWebKitChatView::addErrorMessage(const ChatWindow::ChatMessage& errorMessa QString errorMessageHTML(chatMessageToHTML(errorMessage)); - std::string id = "id" + boost::lexical_cast<std::string>(idCounter_++); + std::string id = "id" + std::to_string(idCounter_++); addMessageBottom(std::make_shared<SystemMessageSnippet>("<span class=\"error\">" + errorMessageHTML + "</span>", QDateTime::currentDateTime(), false, theme_, P2QSTRING(id), ChatSnippet::getDirection(errorMessage))); @@ -864,3 +864,3 @@ std::string QtWebKitChatView::addSystemMessage(const ChatWindow::ChatMessage& me QString messageHTML = chatMessageToHTML(message); - std::string id = "id" + boost::lexical_cast<std::string>(idCounter_++); + std::string id = "id" + std::to_string(idCounter_++); addMessageBottom(std::make_shared<SystemMessageSnippet>(messageHTML, QDateTime::currentDateTime(), false, theme_, P2QSTRING(id), getActualDirection(message, direction))); @@ -930,3 +930,3 @@ void QtWebKitChatView::addPresenceMessage(const ChatWindow::ChatMessage& message QString messageHTML = chatMessageToHTML(message); - std::string id = "id" + boost::lexical_cast<std::string>(idCounter_++); + std::string id = "id" + std::to_string(idCounter_++); addMessageBottom(std::make_shared<SystemMessageSnippet>(messageHTML, QDateTime::currentDateTime(), false, theme_, P2QSTRING(id), getActualDirection(message, direction))); diff --git a/Swiften/Base/URL.cpp b/Swiften/Base/URL.cpp index 4a47a11..3bc97ba 100644 --- a/Swiften/Base/URL.cpp +++ b/Swiften/Base/URL.cpp @@ -134,3 +134,3 @@ std::string URL::toString() const { result += ":"; - result += boost::lexical_cast<std::string>(*port); + result += std::to_string(*port); } diff --git a/Swiften/LinkLocal/LinkLocalServiceInfo.cpp b/Swiften/LinkLocal/LinkLocalServiceInfo.cpp index 7a7ed3b..771251a 100644 --- a/Swiften/LinkLocal/LinkLocalServiceInfo.cpp +++ b/Swiften/LinkLocal/LinkLocalServiceInfo.cpp @@ -37,3 +37,3 @@ ByteArray LinkLocalServiceInfo::toTXTRecord() const { if (port) { - append(result, getEncoded("port.p2pj=" + std::string(boost::lexical_cast<std::string>(*port)))); + append(result, getEncoded("port.p2pj=" + std::string(std::to_string(*port)))); } diff --git a/Swiften/Network/HostAddressPort.cpp b/Swiften/Network/HostAddressPort.cpp index 76c276e..401ddec 100644 --- a/Swiften/Network/HostAddressPort.cpp +++ b/Swiften/Network/HostAddressPort.cpp @@ -23,3 +23,3 @@ std::string HostAddressPort::toString() const { try { - portAsString = boost::lexical_cast<std::string>(getPort()); + portAsString = std::to_string(getPort()); } catch (boost::bad_lexical_cast&) { diff --git a/Swiften/Network/MiniUPnPInterface.cpp b/Swiften/Network/MiniUPnPInterface.cpp index dbe8bcd..2c61ad3 100644 --- a/Swiften/Network/MiniUPnPInterface.cpp +++ b/Swiften/Network/MiniUPnPInterface.cpp @@ -82,5 +82,5 @@ boost::optional<NATPortMapping> MiniUPnPInterface::addPortForward(int actualLoca - std::string publicPort = boost::lexical_cast<std::string>(mapping.getPublicPort()); - std::string localPort = boost::lexical_cast<std::string>(mapping.getLocalPort()); - std::string leaseSeconds = boost::lexical_cast<std::string>(mapping.getLeaseInSeconds()); + std::string publicPort = std::to_string(mapping.getPublicPort()); + std::string localPort = std::to_string(mapping.getLocalPort()); + std::string leaseSeconds = std::to_string(mapping.getLeaseInSeconds()); @@ -109,5 +109,5 @@ bool MiniUPnPInterface::removePortForward(const NATPortMapping& mapping) { - std::string publicPort = boost::lexical_cast<std::string>(mapping.getPublicPort()); - std::string localPort = boost::lexical_cast<std::string>(mapping.getLocalPort()); - std::string leaseSeconds = boost::lexical_cast<std::string>(mapping.getLeaseInSeconds()); + std::string publicPort = std::to_string(mapping.getPublicPort()); + std::string localPort = std::to_string(mapping.getLocalPort()); + std::string leaseSeconds = std::to_string(mapping.getLeaseInSeconds()); diff --git a/Swiften/Network/StaticDomainNameResolver.cpp b/Swiften/Network/StaticDomainNameResolver.cpp index b8f4c7a..5a38fc4 100644 --- a/Swiften/Network/StaticDomainNameResolver.cpp +++ b/Swiften/Network/StaticDomainNameResolver.cpp @@ -104,3 +104,3 @@ void StaticDomainNameResolver::addXMPPClientService(const std::string& domain, c static int hostid = 0; - std::string hostname(std::string("host-") + boost::lexical_cast<std::string>(hostid)); + std::string hostname(std::string("host-") + std::to_string(hostid)); hostid++; diff --git a/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp b/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp index 5d6fedd..4aeaf24 100644 --- a/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp +++ b/Swiften/Network/UnitTest/BOSHConnectionPoolTest.cpp @@ -196,3 +196,3 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture { c1 = connectionFactory->connections[1]; - std::string fullBody = "<body rid='" + boost::lexical_cast<std::string>(rid) + "' sid='" + sid + "' xmlns='http://jabber.org/protocol/httpbind'><blah/></body>"; /* check empty write */ + std::string fullBody = "<body rid='" + std::to_string(rid) + "' sid='" + sid + "' xmlns='http://jabber.org/protocol/httpbind'><blah/></body>"; /* check empty write */ CPPUNIT_ASSERT_EQUAL(fullBody, lastBody()); @@ -312,3 +312,3 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture { CPPUNIT_ASSERT_EQUAL(st(3), boshDataWritten.size()); - std::string fullBody = "<body rid='" + boost::lexical_cast<std::string>(initialRID + 2) + "' sid='" + sid + "' xmlns='http://jabber.org/protocol/httpbind'></body>"; + std::string fullBody = "<body rid='" + std::to_string(initialRID + 2) + "' sid='" + sid + "' xmlns='http://jabber.org/protocol/httpbind'></body>"; std::string response = boshDataWritten[2]; @@ -429,3 +429,3 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture { connection->onDataRead(data1); - std::shared_ptr<SafeByteArray> data2 = std::make_shared<SafeByteArray>(createSafeByteArray(boost::lexical_cast<std::string>(response.size()))); + std::shared_ptr<SafeByteArray> data2 = std::make_shared<SafeByteArray>(createSafeByteArray(std::to_string(response.size()))); connection->onDataRead(data2); @@ -442,3 +442,3 @@ class BOSHConnectionPoolTest : public CppUnit::TestFixture { + "Content-Type: text/xml; charset=utf-8\r\n" - + "Content-Length: " + boost::lexical_cast<std::string>(body.size()) + "\r\n\r\n" + + "Content-Length: " + std::to_string(body.size()) + "\r\n\r\n" + body; diff --git a/Swiften/Network/UnitTest/BOSHConnectionTest.cpp b/Swiften/Network/UnitTest/BOSHConnectionTest.cpp index e34cb96..17d8333 100644 --- a/Swiften/Network/UnitTest/BOSHConnectionTest.cpp +++ b/Swiften/Network/UnitTest/BOSHConnectionTest.cpp @@ -320,3 +320,3 @@ class BOSHConnectionTest : public CppUnit::TestFixture { connection->onDataRead(data1); - std::shared_ptr<SafeByteArray> data2 = std::make_shared<SafeByteArray>(createSafeByteArray(boost::lexical_cast<std::string>(response.size()))); + std::shared_ptr<SafeByteArray> data2 = std::make_shared<SafeByteArray>(createSafeByteArray(std::to_string(response.size()))); connection->onDataRead(data2); diff --git a/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp index 78bb0eb..37a9c03 100644 --- a/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/BytestreamsSerializer.cpp @@ -27,3 +27,3 @@ std::string BytestreamsSerializer::serializePayload(std::shared_ptr<Bytestreams> streamHostElement->setAttribute("jid", streamHost.jid.toString()); - streamHostElement->setAttribute("port", boost::lexical_cast<std::string>(streamHost.port)); + streamHostElement->setAttribute("port", std::to_string(streamHost.port)); queryElement.addNode(streamHostElement); diff --git a/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp b/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp index e41ff8c..74a8e7b 100644 --- a/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/IBBSerializer.cpp @@ -28,3 +28,3 @@ std::string IBBSerializer::serializePayload(std::shared_ptr<IBB> ibb) const { if (ibb->getSequenceNumber() >= 0) { - ibbElement.setAttribute("seq", boost::lexical_cast<std::string>(ibb->getSequenceNumber())); + ibbElement.setAttribute("seq", std::to_string(ibb->getSequenceNumber())); } @@ -41,3 +41,3 @@ std::string IBBSerializer::serializePayload(std::shared_ptr<IBB> ibb) const { assert(ibb->getBlockSize() > 0); - ibbElement.setAttribute("block-size", boost::lexical_cast<std::string>(ibb->getBlockSize())); + ibbElement.setAttribute("block-size", std::to_string(ibb->getBlockSize())); return ibbElement.serialize(); diff --git a/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.cpp index 35a0a6e..95996c7 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/JingleFileTransferFileInfoSerializer.cpp @@ -46,3 +46,3 @@ std::string JingleFileTransferFileInfoSerializer::serializePayload(std::shared_p if (fileInfo->getRangeOffset() != 0) { - range->setAttribute("offset", boost::lexical_cast<std::string>(fileInfo->getRangeOffset())); + range->setAttribute("offset", std::to_string(fileInfo->getRangeOffset())); } @@ -52,3 +52,3 @@ std::string JingleFileTransferFileInfoSerializer::serializePayload(std::shared_p if (fileInfo->getSize() > 0) { - fileElement.addNode(std::make_shared<XMLElement>("size", "", boost::lexical_cast<std::string>(fileInfo->getSize()))); + fileElement.addNode(std::make_shared<XMLElement>("size", "", std::to_string(fileInfo->getSize()))); } diff --git a/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.cpp index 9930e44..c5c45e1 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/JingleIBBTransportPayloadSerializer.cpp @@ -30,3 +30,3 @@ std::string JingleIBBTransportPayloadSerializer::serializePayload(std::shared_pt if (payload->getBlockSize()) { - payloadXML.setAttribute("block-size", boost::lexical_cast<std::string>(*payload->getBlockSize())); + payloadXML.setAttribute("block-size", std::to_string(*payload->getBlockSize())); } diff --git a/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp index 5e74d8e..f9a1832 100644 --- a/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/JingleS5BTransportPayloadSerializer.cpp @@ -41,4 +41,4 @@ std::string JingleS5BTransportPayloadSerializer::serializePayload(std::shared_pt candidateXML->setAttribute("jid", candidate.jid.toString()); - candidateXML->setAttribute("port", boost::lexical_cast<std::string>(candidate.hostPort.getPort())); - candidateXML->setAttribute("priority", boost::lexical_cast<std::string>(candidate.priority)); + candidateXML->setAttribute("port", std::to_string(candidate.hostPort.getPort())); + candidateXML->setAttribute("priority", std::to_string(candidate.priority)); candidateXML->setAttribute("type", typeToString(candidate.type)); diff --git a/Swiften/Serializer/PayloadSerializers/LastSerializer.h b/Swiften/Serializer/PayloadSerializers/LastSerializer.h index 1710bc0..719eff5 100644 --- a/Swiften/Serializer/PayloadSerializers/LastSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/LastSerializer.h @@ -20,3 +20,3 @@ namespace Swift { virtual std::string serializePayload(std::shared_ptr<Last> last) const { - return "<query xmlns='jabber:iq:last' seconds='" + boost::lexical_cast<std::string>(last->getSeconds()) + "'/>"; + return "<query xmlns='jabber:iq:last' seconds='" + std::to_string(last->getSeconds()) + "'/>"; } diff --git a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp index 4f0f637..cde129e 100644 --- a/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/MUCPayloadSerializer.cpp @@ -27,3 +27,3 @@ std::string MUCPayloadSerializer::serializePayload(std::shared_ptr<MUCPayload> m if (muc->getMaxChars() >= 0) { - historyElement->setAttribute("maxchars", boost::lexical_cast<std::string>(muc->getMaxChars())); + historyElement->setAttribute("maxchars", std::to_string(muc->getMaxChars())); history = true; @@ -31,3 +31,3 @@ std::string MUCPayloadSerializer::serializePayload(std::shared_ptr<MUCPayload> m if (muc->getMaxStanzas() >= 0) { - historyElement->setAttribute("maxstanzas", boost::lexical_cast<std::string>(muc->getMaxStanzas())); + historyElement->setAttribute("maxstanzas", std::to_string(muc->getMaxStanzas())); history = true; @@ -35,3 +35,3 @@ std::string MUCPayloadSerializer::serializePayload(std::shared_ptr<MUCPayload> m if (muc->getSeconds() >= 0) { - historyElement->setAttribute("seconds", boost::lexical_cast<std::string>(muc->getSeconds())); + historyElement->setAttribute("seconds", std::to_string(muc->getSeconds())); history = true; diff --git a/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h b/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h index 687d07f..fa2cef0 100644 --- a/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h +++ b/Swiften/Serializer/PayloadSerializers/PrioritySerializer.h @@ -20,3 +20,3 @@ namespace Swift { virtual std::string serializePayload(std::shared_ptr<Priority> priority) const { - return "<priority>" + boost::lexical_cast<std::string>(priority->getPriority()) + "</priority>"; + return "<priority>" + std::to_string(priority->getPriority()) + "</priority>"; } diff --git a/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.cpp b/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.cpp index 9786f51..b2c7326 100644 --- a/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/PubSubItemsSerializer.cpp @@ -39,3 +39,3 @@ std::string PubSubItemsSerializer::serializePayload(std::shared_ptr<PubSubItems> if (payload->getMaximumItems()) { - element.setAttribute("max_items", boost::lexical_cast<std::string>(*payload->getMaximumItems())); + element.setAttribute("max_items", std::to_string(*payload->getMaximumItems())); } diff --git a/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp b/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp index 3302863..3d13ce3 100644 --- a/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/ResultSetSerializer.cpp @@ -31,3 +31,3 @@ std::string ResultSetSerializer::serializePayload(std::shared_ptr<ResultSet> pay if (payload->getMaxItems()) { - element.addNode(std::make_shared<XMLElement>("max", "", boost::lexical_cast<std::string>(*payload->getMaxItems()))); + element.addNode(std::make_shared<XMLElement>("max", "", std::to_string(*payload->getMaxItems()))); } @@ -35,3 +35,3 @@ std::string ResultSetSerializer::serializePayload(std::shared_ptr<ResultSet> pay if (payload->getCount()) { - element.addNode(std::make_shared<XMLElement>("count", "", boost::lexical_cast<std::string>(*payload->getCount()))); + element.addNode(std::make_shared<XMLElement>("count", "", std::to_string(*payload->getCount()))); } @@ -39,3 +39,3 @@ std::string ResultSetSerializer::serializePayload(std::shared_ptr<ResultSet> pay if (payload->getIndex()) { - element.addNode(std::make_shared<XMLElement>("index", "", boost::lexical_cast<std::string>(*payload->getIndex()))); + element.addNode(std::make_shared<XMLElement>("index", "", std::to_string(*payload->getIndex()))); } @@ -45,3 +45,3 @@ std::string ResultSetSerializer::serializePayload(std::shared_ptr<ResultSet> pay if (payload->getFirstIDIndex()) { - firstElement->setAttribute("index", boost::lexical_cast<std::string>(*payload->getFirstIDIndex())); + firstElement->setAttribute("index", std::to_string(*payload->getFirstIDIndex())); } diff --git a/Swiften/Serializer/PayloadSerializers/S5BProxyRequestSerializer.h b/Swiften/Serializer/PayloadSerializers/S5BProxyRequestSerializer.h index 14cbd14..e992f72 100644 --- a/Swiften/Serializer/PayloadSerializers/S5BProxyRequestSerializer.h +++ b/Swiften/Serializer/PayloadSerializers/S5BProxyRequestSerializer.h @@ -31,3 +31,3 @@ namespace Swift { streamHost->setAttribute("host", s5bProxyRequest->getStreamHost().get().host); - streamHost->setAttribute("port", boost::lexical_cast<std::string>(s5bProxyRequest->getStreamHost().get().port)); + streamHost->setAttribute("port", std::to_string(s5bProxyRequest->getStreamHost().get().port)); streamHost->setAttribute("jid", s5bProxyRequest->getStreamHost().get().jid.toString()); diff --git a/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.cpp b/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.cpp index ba296f9..718e550 100644 --- a/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/StreamInitiationFileInfoSerializer.cpp @@ -42,3 +42,3 @@ std::string StreamInitiationFileInfoSerializer::serializePayload(std::shared_ptr if (fileInfo->getSize() != 0) { - fileElement.setAttribute("size", boost::lexical_cast<std::string>(fileInfo->getSize())); + fileElement.setAttribute("size", std::to_string(fileInfo->getSize())); } @@ -51,3 +51,3 @@ std::string StreamInitiationFileInfoSerializer::serializePayload(std::shared_ptr if (fileInfo->getRangeOffset() != 0) { - range->setAttribute("offset", boost::lexical_cast<std::string>(fileInfo->getRangeOffset())); + range->setAttribute("offset", std::to_string(fileInfo->getRangeOffset())); } diff --git a/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp b/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp index 3faa5b7..813edb4 100644 --- a/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/StreamInitiationSerializer.cpp @@ -40,3 +40,3 @@ std::string StreamInitiationSerializer::serializePayload(std::shared_ptr<StreamI if (file.getSize() != 0) { - fileElement->setAttribute("size", boost::lexical_cast<std::string>(file.getSize())); + fileElement->setAttribute("size", std::to_string(file.getSize())); } diff --git a/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp b/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp index 687b566..8bb3a4b 100644 --- a/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/UserTuneSerializer.cpp @@ -28,3 +28,3 @@ std::string UserTuneSerializer::serializePayload(std::shared_ptr<UserTune> paylo if (payload->getRating()) { - element.addNode(std::make_shared<XMLElement>("rating", "", boost::lexical_cast<std::string>(*payload->getRating()))); + element.addNode(std::make_shared<XMLElement>("rating", "", std::to_string(*payload->getRating()))); } @@ -46,3 +46,3 @@ std::string UserTuneSerializer::serializePayload(std::shared_ptr<UserTune> paylo if (payload->getLength()) { - element.addNode(std::make_shared<XMLElement>("length", "", boost::lexical_cast<std::string>(*payload->getLength()))); + element.addNode(std::make_shared<XMLElement>("length", "", std::to_string(*payload->getLength()))); } diff --git a/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp index 34fd149..4743089 100644 --- a/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp +++ b/Swiften/Serializer/PayloadSerializers/WhiteboardSerializer.cpp @@ -28,9 +28,9 @@ namespace Swift { try { - element->setAttribute("x1", boost::lexical_cast<std::string>(line.x1())); - element->setAttribute("y1", boost::lexical_cast<std::string>(line.y1())); - element->setAttribute("x2", boost::lexical_cast<std::string>(line.x2())); - element->setAttribute("y2", boost::lexical_cast<std::string>(line.y2())); + element->setAttribute("x1", std::to_string(line.x1())); + element->setAttribute("y1", std::to_string(line.y1())); + element->setAttribute("x2", std::to_string(line.x2())); + element->setAttribute("y2", std::to_string(line.y2())); element->setAttribute("id", line.getID()); element->setAttribute("stroke", line.getColor().toHex()); - element->setAttribute("stroke-width", boost::lexical_cast<std::string>(line.getPenWidth())); + element->setAttribute("stroke-width", std::to_string(line.getPenWidth())); element->setAttribute("opacity", alphaToOpacity(line.getColor().getAlpha())); @@ -45,3 +45,3 @@ namespace Swift { try { - element->setAttribute("stroke-width", boost::lexical_cast<std::string>(path.getPenWidth())); + element->setAttribute("stroke-width", std::to_string(path.getPenWidth())); element->setAttribute("opacity", alphaToOpacity(path.getColor().getAlpha())); @@ -50,5 +50,5 @@ namespace Swift { std::vector<std::pair<int, int> >::const_iterator it = path.getPoints().begin(); - pathData = "M"+boost::lexical_cast<std::string>(it->first)+" "+boost::lexical_cast<std::string>(it->second)+"L"; + pathData = "M"+std::to_string(it->first)+" "+std::to_string(it->second)+"L"; for (; it != path.getPoints().end(); ++it) { - pathData += boost::lexical_cast<std::string>(it->first)+" "+boost::lexical_cast<std::string>(it->second)+" "; + pathData += std::to_string(it->first)+" "+std::to_string(it->second)+" "; } @@ -63,6 +63,6 @@ namespace Swift { try { - element->setAttribute("x", boost::lexical_cast<std::string>(rect.getX())); - element->setAttribute("y", boost::lexical_cast<std::string>(rect.getY())); - element->setAttribute("width", boost::lexical_cast<std::string>(rect.getWidth())); - element->setAttribute("height", boost::lexical_cast<std::string>(rect.getHeight())); + element->setAttribute("x", std::to_string(rect.getX())); + element->setAttribute("y", std::to_string(rect.getY())); + element->setAttribute("width", std::to_string(rect.getWidth())); + element->setAttribute("height", std::to_string(rect.getHeight())); element->setAttribute("id", rect.getID()); @@ -70,3 +70,3 @@ namespace Swift { element->setAttribute("fill", rect.getBrushColor().toHex());; - element->setAttribute("stroke-width", boost::lexical_cast<std::string>(rect.getPenWidth())); + element->setAttribute("stroke-width", std::to_string(rect.getPenWidth())); element->setAttribute("opacity", alphaToOpacity(rect.getPenColor().getAlpha())); @@ -83,3 +83,3 @@ namespace Swift { element->setAttribute("fill", polygon.getBrushColor().toHex());; - element->setAttribute("stroke-width", boost::lexical_cast<std::string>(polygon.getPenWidth())); + element->setAttribute("stroke-width", std::to_string(polygon.getPenWidth())); element->setAttribute("opacity", alphaToOpacity(polygon.getPenColor().getAlpha())); @@ -89,3 +89,3 @@ namespace Swift { for (; it != polygon.getPoints().end(); ++it) { - points += boost::lexical_cast<std::string>(it->first)+","+boost::lexical_cast<std::string>(it->second)+" "; + points += std::to_string(it->first)+","+std::to_string(it->second)+" "; } @@ -99,5 +99,5 @@ namespace Swift { try { - element->setAttribute("x", boost::lexical_cast<std::string>(text.getX())); - element->setAttribute("y", boost::lexical_cast<std::string>(text.getY())); - element->setAttribute("font-size", boost::lexical_cast<std::string>(text.getSize())); + element->setAttribute("x", std::to_string(text.getX())); + element->setAttribute("y", std::to_string(text.getY())); + element->setAttribute("font-size", std::to_string(text.getSize())); element->setAttribute("id", text.getID()); @@ -113,6 +113,6 @@ namespace Swift { try { - element->setAttribute("cx", boost::lexical_cast<std::string>(ellipse.getCX())); - element->setAttribute("cy", boost::lexical_cast<std::string>(ellipse.getCY())); - element->setAttribute("rx", boost::lexical_cast<std::string>(ellipse.getRX())); - element->setAttribute("ry", boost::lexical_cast<std::string>(ellipse.getRY())); + element->setAttribute("cx", std::to_string(ellipse.getCX())); + element->setAttribute("cy", std::to_string(ellipse.getCY())); + element->setAttribute("rx", std::to_string(ellipse.getRX())); + element->setAttribute("ry", std::to_string(ellipse.getRY())); element->setAttribute("id", ellipse.getID()); @@ -120,3 +120,3 @@ namespace Swift { element->setAttribute("fill", ellipse.getBrushColor().toHex());; - element->setAttribute("stroke-width", boost::lexical_cast<std::string>(ellipse.getPenWidth())); + element->setAttribute("stroke-width", std::to_string(ellipse.getPenWidth())); element->setAttribute("opacity", alphaToOpacity(ellipse.getPenColor().getAlpha())); @@ -136,3 +136,3 @@ namespace Swift { } else { - return "."+boost::lexical_cast<std::string>(opacity); + return "."+std::to_string(opacity); } @@ -150,3 +150,3 @@ namespace Swift { operationNode->setAttribute("type", "insert"); - operationNode->setAttribute("pos", boost::lexical_cast<std::string>(insertOp->getPos())); + operationNode->setAttribute("pos", std::to_string(insertOp->getPos())); operationNode->setAttribute("id", insertOp->getID()); @@ -162,6 +162,6 @@ namespace Swift { operationNode->setAttribute("type", "update"); - operationNode->setAttribute("pos", boost::lexical_cast<std::string>(updateOp->getPos())); + operationNode->setAttribute("pos", std::to_string(updateOp->getPos())); operationNode->setAttribute("id", updateOp->getID()); operationNode->setAttribute("parentid", updateOp->getParentID()); - operationNode->setAttribute("newpos", boost::lexical_cast<std::string>(updateOp->getNewPos())); + operationNode->setAttribute("newpos", std::to_string(updateOp->getNewPos())); } catch (boost::bad_lexical_cast&) { @@ -177,3 +177,3 @@ namespace Swift { operationNode->setAttribute("type", "delete"); - operationNode->setAttribute("pos", boost::lexical_cast<std::string>(deleteOp->getPos())); + operationNode->setAttribute("pos", std::to_string(deleteOp->getPos())); operationNode->setAttribute("id", deleteOp->getID()); diff --git a/Swiften/Serializer/StanzaAckSerializer.h b/Swiften/Serializer/StanzaAckSerializer.h index f5a27dc..228d67b 100644 --- a/Swiften/Serializer/StanzaAckSerializer.h +++ b/Swiften/Serializer/StanzaAckSerializer.h @@ -27,3 +27,3 @@ namespace Swift { XMLElement result("a", "urn:xmpp:sm:2"); - result.setAttribute("h", std::string(boost::lexical_cast<std::string>(stanzaAck->getHandledStanzasCount()))); + result.setAttribute("h", std::string(std::to_string(stanzaAck->getHandledStanzasCount()))); return createSafeByteArray(result.serialize()); diff --git a/Swiften/Serializer/StreamResumeSerializer.cpp b/Swiften/Serializer/StreamResumeSerializer.cpp index 619ac9c..e4a40c9 100644 --- a/Swiften/Serializer/StreamResumeSerializer.cpp +++ b/Swiften/Serializer/StreamResumeSerializer.cpp @@ -25,3 +25,3 @@ SafeByteArray StreamResumeSerializer::serialize(std::shared_ptr<ToplevelElement> if (e->getHandledStanzasCount()) { - element.setAttribute("h", boost::lexical_cast<std::string>(e->getHandledStanzasCount().get())); + element.setAttribute("h", std::to_string(e->getHandledStanzasCount().get())); } diff --git a/Swiften/Serializer/StreamResumedSerializer.cpp b/Swiften/Serializer/StreamResumedSerializer.cpp index 5b88ded..2398335 100644 --- a/Swiften/Serializer/StreamResumedSerializer.cpp +++ b/Swiften/Serializer/StreamResumedSerializer.cpp @@ -25,3 +25,3 @@ SafeByteArray StreamResumedSerializer::serialize(std::shared_ptr<ToplevelElement if (e->getHandledStanzasCount()) { - element.setAttribute("h", boost::lexical_cast<std::string>(e->getHandledStanzasCount().get())); + element.setAttribute("h", std::to_string(e->getHandledStanzasCount().get())); } |