source: filezilla/trunk/fuentes/src/engine/servercapabilities.h @ 130

Last change on this file since 130 was 130, checked in by jrpelegrina, 3 years ago

First release to xenial

File size: 2.3 KB
Line 
1#ifndef __SERVERCAPABILITIES_H__
2#define __SERVERCAPABILITIES_H__
3
4enum capabilities
5{
6        unknown,
7        yes,
8        no
9};
10
11enum capabilityNames
12{
13        resume2GBbug,
14        resume4GBbug,
15
16        // FTP-protocol specific
17        syst_command, // reply of SYST command as option
18        feat_command,
19        clnt_command, // set to 'yes' if CLNT should be sent
20        utf8_command, // set to 'yes' if OPTS UTF8 ON should be sent
21        mlsd_command,
22        opst_mlst_command, // Arguments for OPTS MLST command
23        mfmt_command,
24        mdtm_command,
25        size_command,
26        mode_z_support,
27        tvfs_support, // Trivial virtual file store (RFC 3659)
28        list_hidden_support, // LIST -a command
29        rest_stream, // supports REST+STOR in addition to APPE
30        epsv_command,
31
32        // FTPS and HTTPS
33        tls_resume, // Does the server support resuming of TLS sessions?
34
35        // Server timezone offset. If using FTP, LIST details are unspecified and
36        // can return different times than the UTC based times using the MLST or
37        // MDTM commands.
38        // Note that the user can invoke an additional timezone offset on top of
39        // this for server not supporting auto-detection or to compensate
40        // unsynchronized clocks.
41        timezone_offset,
42
43        auth_tls_command,
44        auth_ssl_command
45};
46
47class CCapabilities final
48{
49public:
50        enum capabilities GetCapability(enum capabilityNames name, wxString* pOption = 0) const;
51        enum capabilities GetCapability(enum capabilityNames name, int* pOption) const;
52        void SetCapability(enum capabilityNames name, enum capabilities cap, const wxString& option = _T(""));
53        void SetCapability(enum capabilityNames name, enum capabilities cap, int option);
54
55protected:
56        struct t_cap
57        {
58                enum capabilities cap;
59                wxString option;
60                int number;
61        };
62        std::map<enum capabilityNames, struct t_cap> m_capabilityMap;
63};
64
65class CServerCapabilities final
66{
67public:
68        // If return value isn't 'yes', pOptions remains unchanged
69        static enum capabilities GetCapability(const CServer& server, enum capabilityNames name, wxString* pOption = 0);
70        static enum capabilities GetCapability(const CServer& server, enum capabilityNames name, int* option);
71
72        static void SetCapability(const CServer& server, enum capabilityNames name, enum capabilities cap, const wxString& option = _T(""));
73        static void SetCapability(const CServer& server, enum capabilityNames name, enum capabilities cap, int option);
74
75protected:
76        static std::map<CServer, CCapabilities> m_serverMap;
77};
78
79#endif //__SERVERCAPABILITIES_H__
Note: See TracBrowser for help on using the repository browser.