diff options
author | Thomas Preud'homme <robotux@celest.fr> | 2018-02-24 00:13:45 +0000 |
---|---|---|
committer | Thomas Preud'homme <robotux@celest.fr> | 2018-02-24 00:13:46 +0000 |
commit | 0fa6fb5a53789434e6ef57af39ab9024b7ec7d50 (patch) | |
tree | 9854613566cca815292f6fcad8e4d678afa30a9a /plugins/Listener/catchcopy-v0002/catchcopy-api-0002 | |
parent | 2124f782c35cd832460d070186eaf72d935c1bdb (diff) | |
parent | b00b0c864574c3842effe1705b66066fa228f950 (diff) |
merge patched into master
Diffstat (limited to 'plugins/Listener/catchcopy-v0002/catchcopy-api-0002')
5 files changed, 444 insertions, 407 deletions
diff --git a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp index d7492d0..c466630 100644 --- a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ClientCatchcopy.cpp @@ -10,370 +10,370 @@ ClientCatchcopy::ClientCatchcopy() { - disconnectedFromSocket(); - error_string="Unknown error"; - detectTimeOut.setSingleShot(true); - detectTimeOut.setInterval(CATCHCOPY_COMMUNICATION_TIMEOUT); // the max time to without send packet - connect(&socket, SIGNAL(connected()), this, SIGNAL(connected())); - connect(&socket, SIGNAL(disconnected()), this, SIGNAL(disconnected())); - connect(&socket, SIGNAL(disconnected()), this, SLOT(disconnectedFromSocket())); - connect(&socket, SIGNAL(stateChanged(QLocalSocket::LocalSocketState)), this, SIGNAL(stateChanged(QLocalSocket::LocalSocketState))); - connect(&socket, SIGNAL(error(QLocalSocket::LocalSocketError)), this, SIGNAL(errorSocket(QLocalSocket::LocalSocketError))); - connect(&socket, SIGNAL(readyRead()), this, SLOT(readyRead())); - connect(&detectTimeOut, SIGNAL(timeout()), this, SLOT(checkTimeOut())); - connect(&socket, SIGNAL(connected()), this, SLOT(socketIsConnected())); + disconnectedFromSocket(); + error_string="Unknown error"; + detectTimeOut.setSingleShot(true); + detectTimeOut.setInterval(CATCHCOPY_COMMUNICATION_TIMEOUT); // the max time to without send packet + connect(&socket, SIGNAL(connected()), this, SIGNAL(connected())); + connect(&socket, SIGNAL(disconnected()), this, SIGNAL(disconnected())); + connect(&socket, SIGNAL(disconnected()), this, SLOT(disconnectedFromSocket())); + connect(&socket, SIGNAL(stateChanged(QLocalSocket::LocalSocketState)), this, SIGNAL(stateChanged(QLocalSocket::LocalSocketState))); + connect(&socket, SIGNAL(error(QLocalSocket::LocalSocketError)), this, SIGNAL(errorSocket(QLocalSocket::LocalSocketError))); + connect(&socket, SIGNAL(readyRead()), this, SLOT(readyRead())); + connect(&detectTimeOut, SIGNAL(timeout()), this, SLOT(checkTimeOut())); + connect(&socket, SIGNAL(connected()), this, SLOT(socketIsConnected())); } void ClientCatchcopy::checkTimeOut() { - if(haveData) - { - error_string="The server is too long to send the next part of the reply"; - emit error(error_string); - disconnectFromServer(); - } + if(haveData) + { + error_string="The server is too long to send the next part of the reply"; + emit error(error_string); + disconnectFromServer(); + } } const QString ClientCatchcopy::errorString() { - return error_string; + return error_string; } void ClientCatchcopy::socketIsConnected() { - orderIdFirstSendProtocol=sendProtocol(); + orderIdFirstSendProtocol=sendProtocol(); } void ClientCatchcopy::connectToServer() { - socket.connectToServer(ExtraSocketCatchcopy::pathSocket()); + socket.connectToServer(QString::fromStdString(ExtraSocketCatchcopy::pathSocket())); } void ClientCatchcopy::disconnectFromServer() { - socket.abort(); - socket.disconnectFromServer(); + socket.abort(); + socket.disconnectFromServer(); } const QString ClientCatchcopy::errorStringSocket() { - return socket.errorString(); + return socket.errorString(); } /// \brief to send stream of string list quint32 ClientCatchcopy::sendRawOrderList(const QStringList & order) { - if(!socket.isValid()) - { - error_string="Socket is not valid, try send: "+order.join(";"); - emit error(error_string); - return -1; - } - if(socket.state()!=QLocalSocket::ConnectedState) - { - error_string="Socket is not connected "+QString::number(socket.state()); - emit error(error_string); - return -1; - } - do - { - idNextOrder++; - if(idNextOrder>2000000000) - idNextOrder=0; - } while(notRepliedQuery.contains(idNextOrder)); - notRepliedQuery << idNextOrder; - QByteArray block; - QDataStream out(&block, QIODevice::WriteOnly); - out.setVersion(QDataStream::Qt_4_4); - out << int(0); - out << idNextOrder; - out << order; - out.device()->seek(0); - out << block.size(); - if(idNextOrder!=1) // drop if internal protocol send - { - emit dataSend(idNextOrder,block); - emit dataSend(idNextOrder,order); - } - do //cut string list and send it as block of 32KB - { - QByteArray blockToSend; - int byteWriten; - blockToSend=block.left(32*1024);//32KB - block.remove(0,blockToSend.size()); - byteWriten = socket.write(blockToSend); - if(!socket.isValid()) - { - error_string="Socket is not valid"; - emit error(error_string); - return -1; - } - if(socket.errorString()!="Unknown error" && socket.errorString()!="") - { - error_string=socket.errorString(); - emit error(error_string); - return -1; - } - if(blockToSend.size()!=byteWriten) - { - error_string="All the bytes have not be written"; - emit error(error_string); - return -1; - } - } - while(block.size()); - return idNextOrder; + if(!socket.isValid()) + { + error_string="Socket is not valid, try send: "+order.join(";"); + emit error(error_string); + return -1; + } + if(socket.state()!=QLocalSocket::ConnectedState) + { + error_string="Socket is not connected "+QString::number(socket.state()); + emit error(error_string); + return -1; + } + do + { + idNextOrder++; + if(idNextOrder>2000000000) + idNextOrder=0; + } while(notRepliedQuery.contains(idNextOrder)); + notRepliedQuery << idNextOrder; + QByteArray block; + QDataStream out(&block, QIODevice::WriteOnly); + out.setVersion(QDataStream::Qt_4_4); + out << int(0); + out << idNextOrder; + out << order; + out.device()->seek(0); + out << block.size(); + if(idNextOrder!=1) // drop if internal protocol send + { + emit dataSend(idNextOrder,block); + emit dataSend(idNextOrder,order); + } + do //cut string list and send it as block of 32KB + { + QByteArray blockToSend; + int byteWriten; + blockToSend=block.left(32*1024);//32KB + block.remove(0,blockToSend.size()); + byteWriten = socket.write(blockToSend); + if(!socket.isValid()) + { + error_string="Socket is not valid"; + emit error(error_string); + return -1; + } + if(socket.errorString()!="Unknown error" && socket.errorString()!="") + { + error_string=socket.errorString(); + emit error(error_string); + return -1; + } + if(blockToSend.size()!=byteWriten) + { + error_string="All the bytes have not be written"; + emit error(error_string); + return -1; + } + } + while(block.size()); + return idNextOrder; } void ClientCatchcopy::readyRead() { - while(socket.bytesAvailable()>0) - { - if(!haveData) - { - if(socket.bytesAvailable()<(int)sizeof(int))//int of size cuted - { - /* error_string="Bytes available is not sufficient to do a int"; - emit error(error_string); - disconnectFromServer();*/ - return; - } - QDataStream in(&socket); - in.setVersion(QDataStream::Qt_4_4); - in >> dataSize; - dataSize-=sizeof(int); - if(dataSize>64*1024*1024) // 64MB - { - error_string="Reply size is >64MB, seam corrupted"; - emit error(error_string); - disconnectFromServer(); - return; - } - if(dataSize<(int)(sizeof(int) //orderId - + sizeof(quint32) //returnCode - + sizeof(quint32) //string list size - )) - { - error_string="Reply size is too small to have correct code"; - emit error(error_string); - disconnectFromServer(); - return; - } - } - if(dataSize<(data.size()+socket.bytesAvailable())) - data.append(socket.read(dataSize-data.size())); - else - data.append(socket.readAll()); - if(dataSize==data.size()) - { - if(!checkDataIntegrity(data)) - { - data.clear(); - qWarning() << "Data of the reply is wrong"; - return; - } - QStringList returnList; - quint32 orderId; - quint32 returnCode; - QDataStream in(data); - in.setVersion(QDataStream::Qt_4_4); - in >> orderId; - in >> returnCode; - in >> returnList; - data.clear(); - if(orderId!=orderIdFirstSendProtocol) - { - if(!notRepliedQuery.contains(orderId)) - qWarning() << "Unknown query not replied:" << orderId; - else - { - if(!parseReply(orderId,returnCode,returnList)) - emit unknowReply(orderId); - emit newReply(orderId,returnCode,returnList); - } - } - else - { - if(!sendProtocolReplied) - { - sendProtocolReplied=true; - if(returnCode!=1000) - { - error_string="Protocol not supported"; - emit error(error_string); - disconnectFromServer(); - return; - } - } - else - { - error_string=QStringLiteral("First send protocol send with the query id %1 have been already previously replied").arg(orderIdFirstSendProtocol); - emit error(error_string); - disconnectFromServer(); - return; - } - } - } - } - if(haveData) - detectTimeOut.start(); - else - detectTimeOut.stop(); + while(socket.bytesAvailable()>0) + { + if(!haveData) + { + if(socket.bytesAvailable()<(int)sizeof(int))//int of size cuted + { + /* error_string="Bytes available is not sufficient to do a int"; + emit error(error_string); + disconnectFromServer();*/ + return; + } + QDataStream in(&socket); + in.setVersion(QDataStream::Qt_4_4); + in >> dataSize; + dataSize-=sizeof(int); + if(dataSize>64*1024*1024) // 64MB + { + error_string="Reply size is >64MB, seam corrupted"; + emit error(error_string); + disconnectFromServer(); + return; + } + if(dataSize<(int)(sizeof(int) //orderId + + sizeof(quint32) //returnCode + + sizeof(quint32) //string list size + )) + { + error_string="Reply size is too small to have correct code"; + emit error(error_string); + disconnectFromServer(); + return; + } + } + if(dataSize<(data.size()+socket.bytesAvailable())) + data.append(socket.read(dataSize-data.size())); + else + data.append(socket.readAll()); + if(dataSize==data.size()) + { + if(!checkDataIntegrity(data)) + { + data.clear(); + qWarning() << "Data of the reply is wrong"; + return; + } + QStringList returnList; + quint32 orderId; + quint32 returnCode; + QDataStream in(data); + in.setVersion(QDataStream::Qt_4_4); + in >> orderId; + in >> returnCode; + in >> returnList; + data.clear(); + if(orderId!=orderIdFirstSendProtocol) + { + if(!notRepliedQuery.contains(orderId)) + qWarning() << "Unknown query not replied:" << orderId; + else + { + if(!parseReply(orderId,returnCode,returnList)) + emit unknowReply(orderId); + emit newReply(orderId,returnCode,returnList); + } + } + else + { + if(!sendProtocolReplied) + { + sendProtocolReplied=true; + if(returnCode!=1000) + { + error_string="Protocol not supported"; + emit error(error_string); + disconnectFromServer(); + return; + } + } + else + { + error_string=QStringLiteral("First send protocol send with the query id %1 have been already previously replied").arg(orderIdFirstSendProtocol); + emit error(error_string); + disconnectFromServer(); + return; + } + } + } + } + if(haveData) + detectTimeOut.start(); + else + detectTimeOut.stop(); } bool ClientCatchcopy::checkDataIntegrity(QByteArray data) { - quint32 orderId; - qint32 replyCode; - qint32 listSize; - QDataStream in(data); - in.setVersion(QDataStream::Qt_4_4); - in >> orderId; - in >> replyCode; - in >> listSize; - if(listSize>65535) - { - emit error("List size is wrong"); - qWarning() << "List size is wrong"; - return false; - } - int index=0; - while(index<listSize) - { - qint32 stringSize; - in >> stringSize; - if(stringSize>65535) - { - emit error("String size is wrong"); - qWarning() << "String size is wrong"; - return false; - } - if(stringSize>(in.device()->size()-in.device()->pos())) - { - emit error(QStringLiteral("String size is greater than the data: %1>(%2-%3)").arg(stringSize).arg(in.device()->size()).arg(in.device()->pos())); - qWarning() << QStringLiteral("String size is greater than the data: %1>(%2-%3)").arg(stringSize).arg(in.device()->size()).arg(in.device()->pos()); - return false; - } - in.device()->seek(in.device()->pos()+stringSize); - index++; - } - if(in.device()->size()!=in.device()->pos()) - { - emit error("Remaining data after string list parsing"); - qWarning() << "Remaining data after string list parsing"; - return false; - } - return true; + quint32 orderId; + qint32 replyCode; + qint32 listSize; + QDataStream in(data); + in.setVersion(QDataStream::Qt_4_4); + in >> orderId; + in >> replyCode; + in >> listSize; + if(listSize>65535) + { + emit error("List size is wrong"); + qWarning() << "List size is wrong"; + return false; + } + int index=0; + while(index<listSize) + { + qint32 stringSize; + in >> stringSize; + if(stringSize>65535) + { + emit error("String size is wrong"); + qWarning() << "String size is wrong"; + return false; + } + if(stringSize>(in.device()->size()-in.device()->pos())) + { + emit error(QStringLiteral("String size is greater than the data: %1>(%2-%3)").arg(stringSize).arg(in.device()->size()).arg(in.device()->pos())); + qWarning() << QStringLiteral("String size is greater than the data: %1>(%2-%3)").arg(stringSize).arg(in.device()->size()).arg(in.device()->pos()); + return false; + } + in.device()->seek(in.device()->pos()+stringSize); + index++; + } + if(in.device()->size()!=in.device()->pos()) + { + emit error("Remaining data after string list parsing"); + qWarning() << "Remaining data after string list parsing"; + return false; + } + return true; } QLocalSocket::LocalSocketState ClientCatchcopy::state() { - return socket.state(); + return socket.state(); } void ClientCatchcopy::disconnectedFromSocket() { - haveData = false; - orderIdFirstSendProtocol= 0; - idNextOrder = 0; - sendProtocolReplied = false; - notRepliedQuery.clear(); + haveData = false; + orderIdFirstSendProtocol= 0; + idNextOrder = 0; + sendProtocolReplied = false; + notRepliedQuery.clear(); } /// \brief to send the protocol version used quint32 ClientCatchcopy::sendProtocol() { - return sendRawOrderList(QStringList() << "protocol" << CATCHCOPY_PROTOCOL_VERSION); + return sendRawOrderList(QStringList() << "protocol" << CATCHCOPY_PROTOCOL_VERSION); } quint32 ClientCatchcopy::askServerName() { - return sendRawOrderList(QStringList() << "server" << "name?"); + return sendRawOrderList(QStringList() << "server" << "name?"); } quint32 ClientCatchcopy::setClientName(const QString & name) { - return sendRawOrderList(QStringList() << "client" << name); + return sendRawOrderList(QStringList() << "client" << name); } quint32 ClientCatchcopy::checkProtocolExtension(const QString & name) { - return sendRawOrderList(QStringList() << "protocol extension" << name); + return sendRawOrderList(QStringList() << "protocol extension" << name); } quint32 ClientCatchcopy::checkProtocolExtension(const QString & name,const QString & version) { - return sendRawOrderList(QStringList() << "protocol extension" << name << version); + return sendRawOrderList(QStringList() << "protocol extension" << name << version); } quint32 ClientCatchcopy::addCopyWithDestination(const QStringList & sources,const QString & destination) { - return sendRawOrderList(QStringList() << "cp" << sources << destination); + return sendRawOrderList(QStringList() << "cp" << sources << destination); } quint32 ClientCatchcopy::addCopyWithoutDestination(const QStringList & sources) { - return sendRawOrderList(QStringList() << "cp-?" << sources); + return sendRawOrderList(QStringList() << "cp-?" << sources); } quint32 ClientCatchcopy::addMoveWithDestination(const QStringList & sources,const QString & destination) { - return sendRawOrderList(QStringList() << "mv" << sources << destination); + return sendRawOrderList(QStringList() << "mv" << sources << destination); } quint32 ClientCatchcopy::addMoveWithoutDestination(const QStringList & sources) { - return sendRawOrderList(QStringList() << "mv-?" << sources); + return sendRawOrderList(QStringList() << "mv-?" << sources); } bool ClientCatchcopy::parseReply(quint32 orderId,quint32 returnCode,QStringList returnList) { - switch(returnCode) - { - case 1000: - emit protocolSupported(orderId); - break; - case 1001: - case 1002: - if(returnCode==1001) - emit protocolExtensionSupported(orderId,true); - else - emit protocolExtensionSupported(orderId,false); - break; - case 1003: - emit clientRegistered(orderId); - break; - case 1004: - if(returnList.size()!=1) - emit unknowOrder(orderId); - else - emit serverName(orderId,returnList.last()); - break; - case 1005: - case 1006: - if(returnCode==1005) - emit copyFinished(orderId,false); - else - emit copyFinished(orderId,true); - break; - case 1007: - emit copyCanceled(orderId); - break; - case 5000: - emit incorrectArgumentListSize(orderId); - break; - case 5001: - emit incorrectArgument(orderId); - break; - case 5002: - emit unknowOrder(orderId); //the server have not understand the order - break; - case 5003: - emit protocolNotSupported(orderId); - break; - default: - return false; - } - return true; + switch(returnCode) + { + case 1000: + emit protocolSupported(orderId); + break; + case 1001: + case 1002: + if(returnCode==1001) + emit protocolExtensionSupported(orderId,true); + else + emit protocolExtensionSupported(orderId,false); + break; + case 1003: + emit clientRegistered(orderId); + break; + case 1004: + if(returnList.size()!=1) + emit unknowOrder(orderId); + else + emit serverName(orderId,returnList.last()); + break; + case 1005: + case 1006: + if(returnCode==1005) + emit copyFinished(orderId,false); + else + emit copyFinished(orderId,true); + break; + case 1007: + emit copyCanceled(orderId); + break; + case 5000: + emit incorrectArgumentListSize(orderId); + break; + case 5001: + emit incorrectArgument(orderId); + break; + case 5002: + emit unknowOrder(orderId); //the server have not understand the order + break; + case 5003: + emit protocolNotSupported(orderId); + break; + default: + return false; + } + return true; } diff --git a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp index 5330492..9cd8373 100644 --- a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.cpp @@ -6,17 +6,17 @@ #include <stdio.h> -const QString ExtraSocketCatchcopy::pathSocket() +const std::string ExtraSocketCatchcopy::pathSocket() { #ifdef Q_OS_UNIX - return "advanced-copier-"+QString::number(getuid()); + return "advanced-copier-"+std::to_string(getuid()); #else QString userName; char uname[1024]; DWORD len=1023; if(GetUserNameA(uname, &len)!=FALSE) userName=QString::fromLatin1(toHex(uname)); - return "advanced-copier-"+userName; + return "advanced-copier-"+userName.toStdString(); #endif } diff --git a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.h b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.h index 59c8f93..fb4201c 100644 --- a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.h +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ExtraSocketCatchcopy.h @@ -6,6 +6,7 @@ #ifndef EXTRASOCKETCATCHCOPY_H #define EXTRASOCKETCATCHCOPY_H +#include <string> #include <QString> #ifdef Q_OS_UNIX @@ -23,7 +24,7 @@ class ExtraSocketCatchcopy { public: /// \brief to get the socket path - static const QString pathSocket(); + static const std::string pathSocket(); static char * toHex(const char *str); }; diff --git a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.cpp b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.cpp index 83c8790..6fd1172 100644 --- a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.cpp +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.cpp @@ -8,6 +8,22 @@ #include <QFile> #include <QDataStream> +#include <queue> +#include <vector> +#include <string> + +std::string stringimplode2(const std::vector<std::string>& elems, const std::string &delim) +{ + std::string newString; + for (std::vector<std::string>::const_iterator ii = elems.begin(); ii != elems.cend(); ++ii) + { + newString += (*ii); + if ( ii + 1 != elems.end() ) { + newString += delim; + } + } + return newString; +} ServerCatchcopy::ServerCatchcopy() { @@ -27,25 +43,25 @@ bool ServerCatchcopy::isListening() const return server.isListening(); } -void ServerCatchcopy::setName(const QString & name) +void ServerCatchcopy::setName(const std::string & name) { this->name=name; } -QString ServerCatchcopy::getName() const +std::string ServerCatchcopy::getName() const { return name; } /// \brief to get a client list -QStringList ServerCatchcopy::clientsList() const +std::vector<std::string> ServerCatchcopy::clientsList() const { - QStringList clients; + std::vector<std::string> clients; int index=0; int size=clientList.size(); while(index<size) { - clients << clientList[index].name; + clients.push_back(clientList[index].name); index++; } return clients; @@ -55,7 +71,7 @@ bool ServerCatchcopy::listen() { QLocalSocket socketTestConnection; pathSocket=ExtraSocketCatchcopy::pathSocket(); - socketTestConnection.connectToServer(pathSocket); + socketTestConnection.connectToServer(QString::fromStdString(pathSocket)); if(socketTestConnection.waitForConnected(CATCHCOPY_COMMUNICATION_TIMEOUT)) { error_string="Other server is listening"; @@ -64,7 +80,7 @@ bool ServerCatchcopy::listen() } else { - if(!server.removeServer(pathSocket)) + if(!server.removeServer(QString::fromStdString(pathSocket))) { error_string="Unable to remove the old server"; emit error(error_string); @@ -72,11 +88,11 @@ bool ServerCatchcopy::listen() #ifndef Q_OS_MAC server.setSocketOptions(QLocalServer::UserAccessOption); #endif - if(server.listen(pathSocket)) + if(server.listen(QString::fromStdString(pathSocket))) return true; else { - error_string=QStringLiteral("Unable to listen %1: %2").arg(pathSocket).arg(server.errorString()); + error_string=QStringLiteral("Unable to listen %1: %2").arg(QString::fromStdString(pathSocket)).arg(server.errorString()).toStdString(); emit error(error_string); return false; } @@ -94,7 +110,7 @@ void ServerCatchcopy::close() index++; } server.close(); - if(!server.removeServer(pathSocket)) + if(!server.removeServer(QString::fromStdString(pathSocket))) { error_string="Unable to remove the old server"; emit error(error_string); @@ -102,12 +118,12 @@ void ServerCatchcopy::close() } } -const QString ServerCatchcopy::errorStringServer() const +const std::string ServerCatchcopy::errorStringServer() const { - return server.errorString(); + return server.errorString().toStdString(); } -const QString ServerCatchcopy::errorString() const +const std::string ServerCatchcopy::errorString() const { return error_string; } @@ -145,7 +161,7 @@ void ServerCatchcopy::newConnection() } } -bool ServerCatchcopy::clientIdFound(const quint32 &id) const +bool ServerCatchcopy::clientIdFound(const uint32_t &id) const { int index=0; while(index<clientList.size()) @@ -195,7 +211,7 @@ void ServerCatchcopy::disconnected() { if(clientList.at(index).socket==socket) { - const quint32 &id=clientList.at(index).id; + const uint32_t &id=clientList.at(index).id; //ClientList.at(index).socket->disconnectFromServer();//already disconnected delete clientList.at(index).detectTimeOut; clientList.at(index).socket->deleteLater(); @@ -208,7 +224,7 @@ void ServerCatchcopy::disconnected() qWarning() << "Unlocated client!"; } -void ServerCatchcopy::disconnectClient(const quint32 &id) +void ServerCatchcopy::disconnectClient(const uint32_t &id) { int index=0; while(index<clientList.size()) @@ -259,8 +275,8 @@ void ServerCatchcopy::readyRead() return; } if(clientList.at(index).dataSize<(int)(sizeof(int) //orderId - + sizeof(quint32) //returnCode - + sizeof(quint32) //string list size + + sizeof(uint32_t) //returnCode + + sizeof(uint32_t) //string list size )) { error_string="Reply size is too small to have correct code"; @@ -274,22 +290,31 @@ void ServerCatchcopy::readyRead() clientList[index].data.append(socket->read(clientList.at(index).dataSize-clientList.at(index).data.size())); else clientList[index].data.append(socket->readAll()); - if(clientList.at(index).dataSize==(quint32)clientList.at(index).data.size()) + if(clientList.at(index).dataSize==(uint32_t)clientList.at(index).data.size()) { if(!checkDataIntegrity(clientList.at(index).data)) { - emit communicationError("Data integrity wrong: "+QString(clientList.at(index).data.toHex())); + emit communicationError("Data integrity wrong: "+QString(clientList.at(index).data.toHex()).toStdString()); clientList[index].data.clear(); clientList[index].haveData=false; qWarning() << "Data integrity wrong"; return; } - QStringList returnList; - quint32 orderId; + std::vector<std::string> returnList; + QStringList returnListQt; + uint32_t orderId; QDataStream in(clientList.at(index).data); in.setVersion(QDataStream::Qt_4_4); in >> orderId; - in >> returnList; + in >> returnListQt; + { + int index=0; + while(index<returnListQt.size()) + { + returnList.push_back(returnListQt.at(index).toStdString()); + index++; + } + } clientList[index].data.clear(); clientList[index].haveData=false; if(clientList.at(index).queryNoReplied.contains(orderId)) @@ -299,10 +324,10 @@ void ServerCatchcopy::readyRead() return; } clientList[index].queryNoReplied << orderId; - if(!clientList.at(index).firstProtocolReplied && returnList.size()==2 && returnList.first()=="protocol") + if(!clientList.at(index).firstProtocolReplied && returnList.size()==2 && returnList.front()=="protocol") { clientList[index].firstProtocolReplied=true; - protocolSupported(clientList.at(index).id,orderId,(returnList.last()==CATCHCOPY_PROTOCOL_VERSION)); + protocolSupported(clientList.at(index).id,orderId,(returnList.back()==CATCHCOPY_PROTOCOL_VERSION)); } else parseInput(clientList.at(index).id,orderId,returnList); @@ -322,7 +347,7 @@ void ServerCatchcopy::readyRead() bool ServerCatchcopy::checkDataIntegrity(const QByteArray &data) { - quint32 orderId; + uint32_t orderId; qint32 listSize; QDataStream in(data); in.setVersion(QDataStream::Qt_4_4); @@ -346,7 +371,7 @@ bool ServerCatchcopy::checkDataIntegrity(const QByteArray &data) } if(stringSize>(in.device()->size()-in.device()->pos())) { - emit error(QStringLiteral("String size is greater than the data: %1>(%2-%3)").arg(stringSize).arg(in.device()->size()).arg(in.device()->pos())); + emit error(QStringLiteral("String size is greater than the data: %1>(%2-%3)").arg(stringSize).arg(in.device()->size()).arg(in.device()->pos()).toStdString()); return false; } in.device()->seek(in.device()->pos()+stringSize); @@ -360,7 +385,7 @@ bool ServerCatchcopy::checkDataIntegrity(const QByteArray &data) return true; } -void ServerCatchcopy::parseInput(const quint32 &client,const quint32 &orderId,const QStringList &returnList) +void ServerCatchcopy::parseInput(const uint32_t &client,const uint32_t &orderId,const std::vector<std::string> &returnList) { const ServerCatchcopy::inputReturnType returnVal=parseInputCurrentProtocol(client,orderId,returnList); switch(returnVal) @@ -380,24 +405,24 @@ void ServerCatchcopy::parseInput(const quint32 &client,const quint32 &orderId,co incorrectArgumentListSize(client,orderId); break; case UnknowOrder: - emit error("Unknown query: "+QString::number(returnVal)+", with client: "+QString::number(client)+", orderId: "+QString::number(orderId)+", returnList: "+returnList.join(", ")); + emit error("Unknown query: "+std::to_string(returnVal)+", with client: "+std::to_string(client)+", orderId: "+std::to_string(orderId)+", returnList: "+stringimplode2(returnList,", ")); qWarning() << "Unknown query"; unknowOrder(client,orderId); break; } } -ServerCatchcopy::inputReturnType ServerCatchcopy::parseInputCurrentProtocol(const quint32 &client,const quint32 &orderId,const QStringList &returnList) +ServerCatchcopy::inputReturnType ServerCatchcopy::parseInputCurrentProtocol(const uint32_t &client,const uint32_t &orderId,const std::vector<std::string> &returnList) { if(returnList.size()==0) return WrongArgumentListSize; //if is supported - QString firstArgument=returnList.first(); + std::string firstArgument=returnList.front(); if(firstArgument=="protocol") { if(returnList.size()!=2) return WrongArgumentListSize; - emit askProtocolCompatibility(client,orderId,returnList.last()); + emit askProtocolCompatibility(client,orderId,returnList.back()); return Ok; } else if(firstArgument=="protocol extension") @@ -416,12 +441,12 @@ ServerCatchcopy::inputReturnType ServerCatchcopy::parseInputCurrentProtocol(cons { if(clientList.at(index).id==client) { - clientList[index].name=returnList.last(); + clientList[index].name=returnList.back(); break; } index++; } - emit clientName(client,returnList.last()); + emit clientName(client,returnList.back()); clientRegistered(client,orderId); return Replied; } @@ -429,7 +454,7 @@ ServerCatchcopy::inputReturnType ServerCatchcopy::parseInputCurrentProtocol(cons { if(returnList.size()!=2) return WrongArgumentListSize; - if(returnList.last()!="name?") + if(returnList.back()!="name?") return WrongArgument; serverName(client,orderId,name); return Replied; @@ -438,18 +463,18 @@ ServerCatchcopy::inputReturnType ServerCatchcopy::parseInputCurrentProtocol(cons { if(returnList.size()<3) return WrongArgumentListSize; - QStringList sourceList=returnList; - sourceList.removeFirst(); - sourceList.removeLast(); - emitNewCopy(client,orderId,sourceList,returnList.last()); + std::vector<std::string> sourceList=returnList; + sourceList.erase(sourceList.cbegin()); + sourceList.pop_back(); + emitNewCopy(client,orderId,sourceList,returnList.back()); return Ok; } else if(firstArgument=="cp-?") { if(returnList.size()<2) return WrongArgumentListSize; - QStringList sourceList=returnList; - sourceList.removeFirst(); + std::vector<std::string> sourceList=returnList; + sourceList.erase(sourceList.cbegin()); emitNewCopyWithoutDestination(client,orderId,sourceList); return Ok; } @@ -457,18 +482,18 @@ ServerCatchcopy::inputReturnType ServerCatchcopy::parseInputCurrentProtocol(cons { if(returnList.size()<3) return WrongArgumentListSize; - QStringList sourceList=returnList; - sourceList.removeFirst(); - sourceList.removeLast(); - emitNewMove(client,orderId,sourceList,returnList.last()); + std::vector<std::string> sourceList=returnList; + sourceList.erase(sourceList.cbegin()); + sourceList.pop_back(); + emitNewMove(client,orderId,sourceList,returnList.back()); return Ok; } else if(firstArgument=="mv-?") { if(returnList.size()<2) return WrongArgumentListSize; - QStringList sourceList=returnList; - sourceList.removeFirst(); + std::vector<std::string> sourceList=returnList; + sourceList.erase(sourceList.cbegin()); emitNewMoveWithoutDestination(client,orderId,sourceList); return Ok; } @@ -476,7 +501,7 @@ ServerCatchcopy::inputReturnType ServerCatchcopy::parseInputCurrentProtocol(cons return UnknowOrder; } -void ServerCatchcopy::emitNewCopyWithoutDestination(const quint32 &client,const quint32 &orderId,const QStringList &sources) +void ServerCatchcopy::emitNewCopyWithoutDestination(const uint32_t &client,const uint32_t &orderId,const std::vector<std::string> &sources) { LinkGlobalToLocalClient newAssociation; newAssociation.idClient=client; @@ -486,7 +511,7 @@ void ServerCatchcopy::emitNewCopyWithoutDestination(const quint32 &client,const emit newCopyWithoutDestination(newAssociation.globalOrderId,sources); } -void ServerCatchcopy::emitNewCopy(const quint32 &client,const quint32 &orderId,const QStringList &sources,const QString &destination) +void ServerCatchcopy::emitNewCopy(const uint32_t &client,const uint32_t &orderId,const std::vector<std::string> &sources,const std::string &destination) { LinkGlobalToLocalClient newAssociation; newAssociation.idClient=client; @@ -496,7 +521,7 @@ void ServerCatchcopy::emitNewCopy(const quint32 &client,const quint32 &orderId,c emit newCopy(newAssociation.globalOrderId,sources,destination); } -void ServerCatchcopy::emitNewMoveWithoutDestination(const quint32 &client,const quint32 &orderId,const QStringList &sources) +void ServerCatchcopy::emitNewMoveWithoutDestination(const uint32_t &client,const uint32_t &orderId,const std::vector<std::string> &sources) { LinkGlobalToLocalClient newAssociation; newAssociation.idClient=client; @@ -506,7 +531,7 @@ void ServerCatchcopy::emitNewMoveWithoutDestination(const quint32 &client,const emit newMoveWithoutDestination(newAssociation.globalOrderId,sources); } -void ServerCatchcopy::emitNewMove(const quint32 &client,const quint32 &orderId,const QStringList &sources,const QString &destination) +void ServerCatchcopy::emitNewMove(const uint32_t &client,const uint32_t &orderId,const std::vector<std::string> &sources,const std::string &destination) { LinkGlobalToLocalClient newAssociation; newAssociation.idClient=client; @@ -516,7 +541,7 @@ void ServerCatchcopy::emitNewMove(const quint32 &client,const quint32 &orderId,c emit newMove(newAssociation.globalOrderId,sources,destination); } -void ServerCatchcopy::copyFinished(const quint32 &globalOrderId,const bool &withError) +void ServerCatchcopy::copyFinished(const uint32_t &globalOrderId,const bool &withError) { int index=0; while(index<LinkGlobalToLocalClientList.size()) @@ -532,7 +557,7 @@ void ServerCatchcopy::copyFinished(const quint32 &globalOrderId,const bool &with } } -void ServerCatchcopy::copyCanceled(const quint32 &globalOrderId) +void ServerCatchcopy::copyCanceled(const uint32_t &globalOrderId) { int index=0; while(index<LinkGlobalToLocalClientList.size()) @@ -548,12 +573,14 @@ void ServerCatchcopy::copyCanceled(const quint32 &globalOrderId) } } -void ServerCatchcopy::reply(const quint32 &client,const quint32 &orderId,const quint32 &returnCode,const QString &returnString) +void ServerCatchcopy::reply(const uint32_t &client,const uint32_t &orderId,const uint32_t &returnCode,const std::string &returnString) { - reply(client,orderId,returnCode,QStringList() << returnString); + std::vector<std::string> returnList; + returnList.push_back(returnString); + reply(client,orderId,returnCode,returnList); } -void ServerCatchcopy::reply(const quint32 &client,const quint32 &orderId,const quint32 &returnCode,const QStringList &returnList) +void ServerCatchcopy::reply(const uint32_t &client,const uint32_t &orderId,const uint32_t &returnCode,const std::vector<std::string> &returnList) { int index=0; while(index<clientList.size()) @@ -575,7 +602,16 @@ void ServerCatchcopy::reply(const quint32 &client,const quint32 &orderId,const q out << int(0); out << orderId; out << returnCode; - out << returnList; + QStringList returnListQt; + { + unsigned int index=0; + while(index<returnList.size()) + { + returnListQt << QString::fromStdString(returnList.at(index)); + index++; + } + } + out << returnListQt; out.device()->seek(0); out << block.size(); do @@ -593,7 +629,7 @@ void ServerCatchcopy::reply(const quint32 &client,const quint32 &orderId,const q } if(clientList[index].socket->error()!=QLocalSocket::UnknownSocketError && clientList[index].socket->error()!=QLocalSocket::PeerClosedError) { - error_string="Error with socket: "+clientList[index].socket->errorString(); + error_string="Error with socket: "+clientList[index].socket->errorString().toStdString(); emit error(error_string); return; } @@ -618,7 +654,7 @@ void ServerCatchcopy::reply(const quint32 &client,const quint32 &orderId,const q qWarning() << "Client id not found:" << client; } -void ServerCatchcopy::protocolSupported(const quint32 &client,const quint32 &orderId,const bool &value) +void ServerCatchcopy::protocolSupported(const uint32_t &client,const uint32_t &orderId,const bool &value) { if(value) reply(client,orderId,1000,"protocol supported"); @@ -626,27 +662,27 @@ void ServerCatchcopy::protocolSupported(const quint32 &client,const quint32 &ord reply(client,orderId,5003,"protocol not supported"); } -void ServerCatchcopy::incorrectArgumentListSize(const quint32 &client,const quint32 &orderId) +void ServerCatchcopy::incorrectArgumentListSize(const uint32_t &client,const uint32_t &orderId) { reply(client,orderId,5000,"incorrect argument list size"); } -void ServerCatchcopy::incorrectArgument(const quint32 &client,const quint32 &orderId) +void ServerCatchcopy::incorrectArgument(const uint32_t &client,const uint32_t &orderId) { reply(client,orderId,5001,"incorrect argument"); } -void ServerCatchcopy::clientRegistered(const quint32 &client,const quint32 &orderId) +void ServerCatchcopy::clientRegistered(const uint32_t &client,const uint32_t &orderId) { reply(client,orderId,1003,"client registered"); } -void ServerCatchcopy::serverName(const quint32 &client,const quint32 &orderId,const QString &name) +void ServerCatchcopy::serverName(const uint32_t &client,const uint32_t &orderId,const std::string &name) { reply(client,orderId,1004,name); } -void ServerCatchcopy::copyFinished(const quint32 &client,const quint32 &orderId,const bool &withError) +void ServerCatchcopy::copyFinished(const uint32_t &client,const uint32_t &orderId,const bool &withError) { if(!withError) reply(client,orderId,1005,"finished"); @@ -654,12 +690,12 @@ void ServerCatchcopy::copyFinished(const quint32 &client,const quint32 &orderId, reply(client,orderId,1006,"finished with error(s)"); } -void ServerCatchcopy::copyCanceled(const quint32 &client,const quint32 &orderId) +void ServerCatchcopy::copyCanceled(const uint32_t &client,const uint32_t &orderId) { reply(client,orderId,1007,"canceled"); } -void ServerCatchcopy::unknowOrder(const quint32 &client,const quint32 &orderId) +void ServerCatchcopy::unknowOrder(const uint32_t &client,const uint32_t &orderId) { reply(client,orderId,5002,"unknown order"); } @@ -680,7 +716,7 @@ void ServerCatchcopy::checkTimeOut() clientList.at(index).detectTimeOut->stop(); if(clientList.at(index).haveData) { - error_string="The client is too long to send the next part of the reply: "+clientList.at(index).data; + error_string="The client is too long to send the next part of the reply: "+QString(clientList.at(index).data.toHex()).toStdString(); clientList[index].haveData=false; clientList[index].data.clear(); clientList.at(index).socket->disconnectFromServer(); @@ -692,7 +728,7 @@ void ServerCatchcopy::checkTimeOut() } } -quint32 ServerCatchcopy::incrementOrderId() +uint32_t ServerCatchcopy::incrementOrderId() { do { diff --git a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.h b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.h index 1314d73..85acff9 100644 --- a/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.h +++ b/plugins/Listener/catchcopy-v0002/catchcopy-api-0002/ServerCatchcopy.h @@ -9,8 +9,8 @@ #include <QObject> #include <QLocalSocket> #include <QLocalServer> -#include <QStringList> -#include <QString> +#include <vector> +#include <string> #include <QByteArray> #include <QTimer> @@ -28,54 +28,54 @@ class ServerCatchcopy : public QObject /// \brief try close the server void close(); /// \brief get the error string on the QLocalServer - const QString errorStringServer() const; + const std::string errorStringServer() const; /// \brief get the general error string - const QString errorString() const; + const std::string errorString() const; /// \brief set the name of the server - void setName(const QString & name); + void setName(const std::string & name); /// \brief get the name - QString getName() const; + std::string getName() const; /// \brief to get a client list - QStringList clientsList() const; + std::vector<std::string> clientsList() const; private: - QString pathSocket; - QString name; - QString error_string; + std::string pathSocket; + std::string name; + std::string error_string; QLocalServer server; - quint32 idNextClient; + uint32_t idNextClient; struct Client { - quint32 id; + uint32_t id; QLocalSocket *socket; QByteArray data; bool haveData; - quint32 dataSize; + uint32_t dataSize; bool firstProtocolReplied; - QList<quint32> queryNoReplied; + QList<uint32_t> queryNoReplied; QTimer *detectTimeOut; - QString name; + std::string name; }; QList<Client> clientList; struct LinkGlobalToLocalClient { - quint32 idClient; - quint32 orderId; - quint32 globalOrderId; + uint32_t idClient; + uint32_t orderId; + uint32_t globalOrderId; }; QList<LinkGlobalToLocalClient> LinkGlobalToLocalClientList; enum inputReturnType{Ok,Replied,ExtensionWrong,WrongArgument,WrongArgumentListSize,UnknowOrder}; - inputReturnType parseInputCurrentProtocol(const quint32 &client,const quint32 &orderId,const QStringList &returnList); - bool clientIdFound(const quint32 &id) const; - quint32 nextOrderId; - QList<quint32> orderList; - quint32 incrementOrderId(); - void emitNewCopyWithoutDestination(const quint32 &client,const quint32 &orderId,const QStringList &sources); - void emitNewCopy(const quint32 &client,const quint32 &orderId,const QStringList &sources,const QString &destination); - void emitNewMoveWithoutDestination(const quint32 &client,const quint32 &orderId,const QStringList &sources); - void emitNewMove(const quint32 &client,const quint32 &orderId,const QStringList &sources,const QString &destination); + inputReturnType parseInputCurrentProtocol(const uint32_t &client,const uint32_t &orderId,const std::vector<std::string> &returnList); + bool clientIdFound(const uint32_t &id) const; + uint32_t nextOrderId; + QList<uint32_t> orderList; + uint32_t incrementOrderId(); + void emitNewCopyWithoutDestination(const uint32_t &client,const uint32_t &orderId,const std::vector<std::string> &sources); + void emitNewCopy(const uint32_t &client,const uint32_t &orderId,const std::vector<std::string> &sources,const std::string &destination); + void emitNewMoveWithoutDestination(const uint32_t &client,const uint32_t &orderId,const std::vector<std::string> &sources); + void emitNewMove(const uint32_t &client,const uint32_t &orderId,const std::vector<std::string> &sources,const std::string &destination); bool checkDataIntegrity(const QByteArray &data); protected: - void parseInput(const quint32 &client,const quint32 &orderId,const QStringList &returnList); + void parseInput(const uint32_t &client,const uint32_t &orderId,const std::vector<std::string> &returnList); private slots: void newConnection(); void connectionError(const QLocalSocket::LocalSocketError &error); @@ -84,61 +84,61 @@ class ServerCatchcopy : public QObject void checkTimeOut(); public slots: /// \brief disconnect one client - void disconnectClient(const quint32 &id); - /// \brief reply to a client with QStringList - void reply(const quint32 &client,const quint32 &orderId,const quint32 &returnCode,const QStringList &returnList); + void disconnectClient(const uint32_t &id); + /// \brief reply to a client with std::vector<std::string> + void reply(const uint32_t &client,const uint32_t &orderId,const uint32_t &returnCode,const std::vector<std::string> &returnList); /// \brief reply to a client - void reply(const quint32 &client,const quint32 &orderId,const quint32 &returnCode,const QString &returnString); + void reply(const uint32_t &client,const uint32_t &orderId,const uint32_t &returnCode,const std::string &returnString); //reply /// \brief send if the protocol is supported - void protocolSupported(const quint32 &client,const quint32 &orderId,const bool &value); + void protocolSupported(const uint32_t &client,const uint32_t &orderId,const bool &value); /// \brief send incorrect arguement list size - void incorrectArgumentListSize(const quint32 &client,const quint32 &orderId); + void incorrectArgumentListSize(const uint32_t &client,const uint32_t &orderId); /// \brief send incorrect arguement - void incorrectArgument(const quint32 &client,const quint32 &orderId); + void incorrectArgument(const uint32_t &client,const uint32_t &orderId); /// \brief the client is registred - void clientRegistered(const quint32 &client,const quint32 &orderId); + void clientRegistered(const uint32_t &client,const uint32_t &orderId); /// \brief send the server name - void serverName(const quint32 &client,const quint32 &orderId,const QString &name); + void serverName(const uint32_t &client,const uint32_t &orderId,const std::string &name); /// \brief send the copy is finished - void copyFinished(const quint32 &client,const quint32 &orderId,const bool &withError); + void copyFinished(const uint32_t &client,const uint32_t &orderId,const bool &withError); /// \brief send the copy is canceled - void copyCanceled(const quint32 &client,const quint32 &orderId); + void copyCanceled(const uint32_t &client,const uint32_t &orderId); /// \brief send the copy is finished by global is order - void copyFinished(const quint32 &globalOrderId,const bool &withError); + void copyFinished(const uint32_t &globalOrderId,const bool &withError); /// \brief send copy cancel by global is order - void copyCanceled(const quint32 &globalOrderId); + void copyCanceled(const uint32_t &globalOrderId); /// \brief send the unknow order - void unknowOrder(const quint32 &client,const quint32 &orderId); + void unknowOrder(const uint32_t &client,const uint32_t &orderId); signals: /// \brief send connected client - void connectedClient(const quint32 &id); + void connectedClient(const uint32_t &id); /// \brief send disconnect client - void disconnectedClient(const quint32 &id); + void disconnectedClient(const uint32_t &id); /// \brief have new query - void newQuery(const quint32 &client,const quint32 &orderId,const QStringList &returnList); + void newQuery(const uint32_t &client,const uint32_t &orderId,const std::vector<std::string> &returnList); /// \brief have new error - void error(const QString &error); - void communicationError(const QString &error); + void error(const std::string &error); + void communicationError(const std::string &error); //query /// \brief ask the protocol compatility - void askProtocolCompatibility(const quint32 &client,const quint32 &orderId,const QString &version); + void askProtocolCompatibility(const uint32_t &client,const uint32_t &orderId,const std::string &version); /// \brief ask protocol extension - void askProtocolExtension(const quint32 &client,const quint32 &orderId,const QString &extension); + void askProtocolExtension(const uint32_t &client,const uint32_t &orderId,const std::string &extension); /// \brief ask protocol extension with version - void askProtocolExtension(const quint32 &client,const quint32 &orderId,const QString &extension,const QString &version); + void askProtocolExtension(const uint32_t &client,const uint32_t &orderId,const std::string &extension,const std::string &version); /// \brief send the client name, without query id - void clientName(const quint32 &client,const QString &name); + void clientName(const uint32_t &client,const std::string &name); /// \brief send the client have ask the server name - void askServerName(const quint32 &client,const quint32 &orderId); + void askServerName(const uint32_t &client,const uint32_t &orderId); /// \brief copy is send, by globalOrderId, without destination - void newCopyWithoutDestination(const quint32 &globalOrderId,const QStringList &sources); + void newCopyWithoutDestination(const uint32_t &globalOrderId,const std::vector<std::string> &sources); /// \brief copy is send, by globalOrderId, with destination - void newCopy(const quint32 &globalOrderId,const QStringList &sources,const QString &destination); + void newCopy(const uint32_t &globalOrderId,const std::vector<std::string> &sources,const std::string &destination); /// \brief move is send, by globalOrderId, without destination - void newMoveWithoutDestination(const quint32 &globalOrderId,const QStringList &sources); + void newMoveWithoutDestination(const uint32_t &globalOrderId,const std::vector<std::string> &sources); /// \brief move is send, by globalOrderId, with destination - void newMove(const quint32 &globalOrderId,const QStringList &sources,const QString &destination); + void newMove(const uint32_t &globalOrderId,const std::vector<std::string> &sources,const std::string &destination); }; #endif // SERVERCATCHCOPY_H |