#ifndef SENDSYSTEM_H
#define SENDSYSTEM_H

#include <QObject>
#include <QFile>
#include <QFileInfo>
#include <QThread>
#include <QTcpSocket>
#include <QDataStream>
#include <Core/tools.h>

class SendSystem :public QObject
{
    Q_OBJECT
public:
    explicit SendSystem(QObject* parent = nullptr);
    void setSocket(QTcpSocket *socket);
    void sendClientAutorization();
    void sendFileBlock(const QString& path);
    void sendFolderBlock(const QString& path);
    void sendFileBlockWithVersion(const QString& localPath,const QString& serverPath);
    void sendQTConnect();
    void sendXMLAnswer(const QByteArray& array);
    void sendFinish();
    void sendCheckHash();
    void sendPacketType(PacketType packetType);
    ~SendSystem(){};
signals:
    void sigSend();
    QByteArray sigGetXmlAnswer(QString);

public slots:
    void xmlAnswer(const QString& message);
private:
    QTcpSocket *socket;
    int readSize;

};

#endif // SENDSYSTEM_H
