Add a base class for FtpClient to allow different clients later.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23299 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
#include "FileUploadClient.h"
|
||||
|
||||
FileUploadClient::FileUploadClient()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
FileUploadClient::~FileUploadClient()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
FileUploadClient::ChangeDir(const string& dir)
|
||||
{
|
||||
bool rc = false;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
FileUploadClient::ListDirContents(string& listing)
|
||||
{
|
||||
bool rc = false;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
FileUploadClient::PrintWorkingDir(string& dir)
|
||||
{
|
||||
bool rc = false;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
FileUploadClient::Connect(const string& server, const string& login, const string& passwd)
|
||||
{
|
||||
bool rc = false;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
FileUploadClient::PutFile(const string& local, const string& remote, ftp_mode mode)
|
||||
{
|
||||
bool rc = false;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
FileUploadClient::GetFile(const string& remote, const string& local, ftp_mode mode)
|
||||
{
|
||||
bool rc = false;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
// Note: this only works for local remote moves, cross filesystem moves
|
||||
// will not work
|
||||
bool
|
||||
FileUploadClient::MoveFile(const string& oldPath, const string& newPath)
|
||||
{
|
||||
bool rc = false;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
FileUploadClient::Chmod(const string& path, const string& mod)
|
||||
{
|
||||
bool rc = false;
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
FileUploadClient::SetPassive(bool on)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
#ifndef FILE_UPLOAD_CLIENT_H
|
||||
#define FILE_UPLOAD_CLIENT_H
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
|
||||
using std::string;
|
||||
|
||||
|
||||
class FileUploadClient {
|
||||
public:
|
||||
FileUploadClient();
|
||||
virtual ~FileUploadClient();
|
||||
|
||||
enum ftp_mode {
|
||||
binary_mode,
|
||||
ascii_mode
|
||||
};
|
||||
|
||||
virtual bool Connect(const string& server, const string& login,
|
||||
const string& passwd);
|
||||
|
||||
virtual bool PutFile(const string& local, const string& remote,
|
||||
ftp_mode mode = binary_mode);
|
||||
|
||||
virtual bool GetFile(const string& remote, const string& local,
|
||||
ftp_mode mode = binary_mode);
|
||||
|
||||
virtual bool MoveFile(const string& oldPath, const string& newPath);
|
||||
virtual bool ChangeDir(const string& dir);
|
||||
virtual bool PrintWorkingDir(string& dir);
|
||||
virtual bool ListDirContents(string& listing);
|
||||
virtual bool Chmod(const string& path, const string& mod);
|
||||
|
||||
virtual void SetPassive(bool on);
|
||||
};
|
||||
|
||||
#endif // FILE_UPLOAD_CLIENT_H
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "FtpClient.h"
|
||||
|
||||
FtpClient::FtpClient()
|
||||
:
|
||||
: FileUploadClient(),
|
||||
fState(0),
|
||||
fControl(NULL),
|
||||
fData(NULL)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <File.h>
|
||||
#include <NetworkKit.h>
|
||||
#include "FileUploadClient.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
@@ -22,16 +23,11 @@ using std::string;
|
||||
#define xEOF 236
|
||||
|
||||
|
||||
class FtpClient {
|
||||
class FtpClient : public FileUploadClient {
|
||||
public:
|
||||
FtpClient();
|
||||
~FtpClient();
|
||||
|
||||
enum ftp_mode {
|
||||
binary_mode,
|
||||
ascii_mode
|
||||
};
|
||||
|
||||
bool Connect(const string& server, const string& login,
|
||||
const string& passwd);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
|
||||
|
||||
Application CodyCam :
|
||||
CodyCam.cpp
|
||||
FileUploadClient.cpp
|
||||
FtpClient.cpp
|
||||
Settings.cpp
|
||||
SettingsHandler.cpp
|
||||
|
||||
Reference in New Issue
Block a user