Subversion Repositories tpanel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
112 andreas 1
/*
2
 * Copyright (C) 2022 by Andreas Theofilu <andreas@theosys.at>
3
 *
4
 * This program is free software; you can redistribute it and/or modify
5
 * it under the terms of the GNU General Public License as published by
6
 * the Free Software Foundation; either version 3 of the License, or
7
 * (at your option) any later version.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
 * GNU General Public License for more details.
13
 *
14
 * You should have received a copy of the GNU General Public License
15
 * along with this program; if not, write to the Free Software Foundation,
16
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
17
 */
18
 
19
#ifndef __TFSFREADER_H__
20
#define __TFSFREADER_H__
21
 
22
#include <string>
23
#include <vector>
24
 
25
#include "tsocket.h"
26
 
27
class TFsfReader
28
{
29
    public:
30
        typedef struct FTP_CMDS_t
31
        {
32
            std::string cmd;
33
            int success;
34
        }FTP_CMDS_t;
35
 
36
        TFsfReader();
37
        ~TFsfReader();
38
 
39
        bool copyOverFTP(const std::string& fname, const std::string& target);
113 andreas 40
        bool unpack(const std::string&fname, const std::string& path);
112 andreas 41
 
42
    private:
43
        bool sendCommand(int cmd, const std::string& param);
44
 
45
        TSocket *mFtp{nullptr};
46
        TSocket *mFtpData{nullptr};
47
        std::vector<FTP_CMDS_t> mFtpCmds;
48
        std::string mLastCmdBuffer;     // Contains the result of the last command.
49
        int mDataPort{20};              // The FTP data port to transfer files.
50
        bool mPassive{false};           // TRUE = passive mode active
51
};
52
 
53
#endif