summaryrefslogtreecommitdiffstats
path: root/debian/htdig/htdig-3.2.0b6/htnet/HtFTP.h
blob: a0456bf5e31096600155b0211e19a66bec92164f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
//
// HtFTP.h
//
// HtFTP: Class for FTP protocol access (derived from Transport)
//
// Søren Vejrup Carlsen, based on from HtFTP.h by Alexis Mikhailov
// started: 26.08.2002
//
// ////////////////////////////////////////////////////////////
//
// The HtFTP class should provide an interface for retrieving documents 
// from FTP-servers. It derives from Transport class.
//
///////
//
// Part of the ht://Dig package   <http://www.htdig.org/>
// Copyright (c) 1995-2004 The ht://Dig Group
// For copyright details, see the file COPYING in your distribution
// or the GNU Library General Public License (LGPL) version 2 or later
// <http://www.gnu.org/copyleft/lgpl.html>
//
// $Id: HtFTP.h,v 1.3 2004/05/28 13:15:23 lha Exp $ 
//

#ifndef _HTFTP_H
#define _HTFTP_H

#include "Transport.h"
#include "URL.h"
#include "htString.h"


// In advance declarations

class HtFTP;

class HtFTP_Response : public Transport_Response
{

   friend class HtFTP;    // declaring friendship
   
   public:
///////
   //    Construction / Destruction
///////
	 
      HtFTP_Response();
      ~HtFTP_Response();
};

class HtFTP : public Transport
{
public:

///////
   //    Construction/Destruction
///////

    HtFTP();
    ~HtFTP();

   // Information about the method to be used in the request

   // manages a Transport request (method inherited from Transport class)
   virtual DocStatus Request ();
   
 ///////
    //    Interface for resource retrieving
 ///////

   // Set and get the document to be retrieved
   void SetRequestURL(URL &u) { _url = u;}
   URL GetRequestURL () { return _url;}


   // Set and get the referring URL
   void SetRefererURL (URL u) { _referer = u;}
   URL GetRefererURL () { return _referer;}


 ///////
    //    Interface for the HTTP Response
 ///////

   // We have a valid response only if the status code is not equal to
   // initialization value
   
   Transport_Response *GetResponse()
   {
      if (_response._status_code != -1)
         return &_response;
      else return NULL;}


   // Get the document status 
   virtual DocStatus GetDocumentStatus();
   
protected:

///////
   //    Member attributes
///////

   ///////
      //    Http single Request information (Member attributes)
   ///////

   URL		_url;               // URL to retrieve
   URL		_referer;	    // Referring URL
   
   ///////
      //    Http Response information
   ///////

   HtFTP_Response	 _response; 	 // Object where response
   	       	   	       	   	 // information will be stored into
};

#endif