File: fgconi.h

package info (click to toggle)
ftpgrab 0.1.2r-8
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 376 kB
  • ctags: 335
  • sloc: cpp: 2,790; makefile: 26
file content (51 lines) | stat: -rw-r--r-- 1,271 bytes parent folder | download | duplicates (9)
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
#ifndef _FGCONI_H
#define _FGCONI_H

// fgconi.h
//
// FTPGrabConnectionInterface
//
// Interface class detailing requirements of each FTPGrab protocol
// we might be fetching from e.g. FTP, HTTP etc.

class FGString;
class FGDirListing;

class FGConnectionInterface {
public:
  // Need virtual destructor - we delete by the base class
  virtual ~FGConnectionInterface();

  // Connect method
  // INPUTS: Hostname of host to connect to
  // RETURNS: Nothing
  // THROWS: Various connect failed exceptions
  virtual void Connect(const FGString& host) = 0;

  // Change directory method
  // INPUTS: Directory name
  // RETURNS: Nothing
  // THROWS: Directory not found exception
  virtual void ChangeDir(const FGString& dir) = 0;

  // Get directory listing method
  // INPUTS: None
  // RETURNS: Vector of directory entries
  virtual FGDirListing GetDirListing(void) = 0;

  // Retrieve file method
  // INPUTS: Filename
  // RETURNS: fd to source of data
  // THROWS: File not found, etc.
  virtual int GetFile(const FGString& file) = 0;

  // Post retrive file method
  // Some protocols need to perform cleanup/verification after
  // a transfer
  virtual void PostFileTransfer(void) = 0;

  // Disconnect
  virtual void Disconnect(void) = 0;
};

#endif // _FGCONI_H