|
Packit |
8f70b4 |
/*
|
|
Packit |
8f70b4 |
* lftp - file transfer program
|
|
Packit |
8f70b4 |
*
|
|
Packit |
8f70b4 |
* Copyright (c) 1996-2015 by Alexander V. Lukyanov (lav@yars.free.net)
|
|
Packit |
8f70b4 |
*
|
|
Packit |
8f70b4 |
* This program is free software; you can redistribute it and/or modify
|
|
Packit |
8f70b4 |
* it under the terms of the GNU General Public License as published by
|
|
Packit |
8f70b4 |
* the Free Software Foundation; either version 3 of the License, or
|
|
Packit |
8f70b4 |
* (at your option) any later version.
|
|
Packit |
8f70b4 |
*
|
|
Packit |
8f70b4 |
* This program is distributed in the hope that it will be useful,
|
|
Packit |
8f70b4 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
8f70b4 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
8f70b4 |
* GNU General Public License for more details.
|
|
Packit |
8f70b4 |
*
|
|
Packit |
8f70b4 |
* You should have received a copy of the GNU General Public License
|
|
Packit |
8f70b4 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
Packit |
8f70b4 |
*/
|
|
Packit |
8f70b4 |
|
|
Packit |
8f70b4 |
#ifndef GETJOB_H
|
|
Packit |
8f70b4 |
#define GETJOB_H
|
|
Packit |
8f70b4 |
|
|
Packit |
8f70b4 |
#include "CopyJob.h"
|
|
Packit |
8f70b4 |
|
|
Packit |
8f70b4 |
class GetJob : public CopyJobEnv, ResClient
|
|
Packit |
8f70b4 |
{
|
|
Packit |
8f70b4 |
FileCopyPeer *SrcLocal(const char *src);
|
|
Packit |
8f70b4 |
FileCopyPeer *DstLocal(const char *dst);
|
|
Packit |
8f70b4 |
FileCopyPeer *CreateCopyPeer(const ParsedURL &url,const char *path,FA::open_mode mode);
|
|
Packit |
8f70b4 |
FileCopyPeer *CreateCopyPeer(const char *path,FA::open_mode mode);
|
|
Packit |
8f70b4 |
bool IsRemoteNonURL(const ParsedURL &url,FA::open_mode mode);
|
|
Packit |
8f70b4 |
bool IsLocalNonURL(const ParsedURL &url,FA::open_mode mode);
|
|
Packit |
8f70b4 |
static bool IsLocal(const ParsedURL &url;;
|
|
Packit |
8f70b4 |
|
|
Packit |
8f70b4 |
protected:
|
|
Packit |
8f70b4 |
FileCopyPeer *CreateCopyPeer(FileAccess *session,const char *path,FA::open_mode mode);
|
|
Packit |
8f70b4 |
FileCopyPeer *CreateCopyPeer(const FileAccessRef& session,const char *path,FA::open_mode mode);
|
|
Packit |
8f70b4 |
void NextFile();
|
|
Packit |
8f70b4 |
|
|
Packit |
8f70b4 |
bool make_dirs;
|
|
Packit |
8f70b4 |
bool delete_files;
|
|
Packit |
8f70b4 |
bool remove_target_first;
|
|
Packit |
8f70b4 |
bool truncate_target_first;
|
|
Packit |
8f70b4 |
bool reverse;
|
|
Packit |
8f70b4 |
|
|
Packit |
8f70b4 |
public:
|
|
Packit |
8f70b4 |
GetJob(FileAccess *s,ArgV *a,bool c=false);
|
|
Packit |
8f70b4 |
|
|
Packit |
8f70b4 |
void DeleteFiles() { delete_files=true; }
|
|
Packit |
8f70b4 |
void RemoveSourceLater() { delete_files=true; }
|
|
Packit |
8f70b4 |
void Reverse() { reverse=true; } // put
|
|
Packit |
8f70b4 |
void RemoveTargetFirst() { remove_target_first=true; }
|
|
Packit |
8f70b4 |
};
|
|
Packit |
8f70b4 |
|
|
Packit |
8f70b4 |
#endif /* GETJOB_H */
|