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
|