|
lftp
4.4.6
About: lftp is a command line ftp client (FTP, HTTP, ssl support, background transfer, reget, reput, ...)
Fossies Dox: lftp-4.4.6.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation) ![]() |
#include <FileCopy.h>


Public Member Functions | |
| off_t | GetPos () |
| off_t | GetSize () |
| int | GetPercentDone () |
| const char * | GetPercentDoneStr () |
| float | GetRate () |
| const char * | GetRateStr () |
| off_t | GetBytesRemaining () |
| long | GetETA () |
| long | GetETA (off_t b) |
| const char * | GetETAStr () |
| const char * | GetETAStrSFromTime (time_t t) |
| const char * | GetStatus () |
| FgData * | GetFgData (bool fg) |
| pid_t | GetProcGroup () |
| void | Kill (int sig) |
| off_t | GetBytesCount () |
| double | GetTimeSpent () |
| void | SetDate (time_t t, int p=0) |
| void | SetDate (const FileTimestamp &t) |
| void | SetSize (off_t s) |
| bool | SetContinue (bool new_cont) |
| bool | Done () |
| bool | Error () |
| const char * | ErrorText () |
| void | SetError (const char *str) |
| void | DontCopyDate () |
| void | DontVerify () |
| void | Ascii () |
| void | DontFailIfBroken () |
| void | FailIfCannotSeek () |
| void | SetRange (off_t s, off_t lim) |
| void | SetRangeLimit (off_t lim) |
| off_t | GetRangeStart () |
| off_t | GetRangeLimit () |
| void | RemoveSourceLater () |
| void | RemoveTargetFirst () |
| void | LineBuffered (int size=0x1000) |
| bool | IsLineBuffered () const |
| FileCopy (FileCopyPeer *src, FileCopyPeer *dst, bool cont) | |
| ~FileCopy () | |
| int | Do () |
| void | SuspendInternal () |
| void | ResumeInternal () |
| void | Fg () |
| void | Bg () |
| void | AllowWrite (bool y=true) |
| bool | WriteAllowed () |
| bool | WritePending () |
| void | LogTransfer () |
Public Member Functions inherited from SMTask | |
| void | Suspend () |
| void | Resume () |
| void | SuspendSlave () |
| void | ResumeSlave () |
| bool | IsSuspended () |
| virtual const char * | GetLogContext () |
| SMTask () | |
| virtual | ~SMTask () |
| void | DeleteLater () |
| void | IncRefCount () |
| void | DecRefCount () |
| int | Roll () |
| void | Enter () |
| void | Leave () |
Static Public Member Functions | |
| static FileCopy * | New (FileCopyPeer *src, FileCopyPeer *dst, bool cont) |
Static Public Member Functions inherited from SMTask | |
| static void | Block (int fd, int mask) |
| static void | Timeout (int ms) |
| static void | TimeoutS (int s) |
| static void | UpdateNow () |
| static void | Schedule () |
| static int | CollectGarbage () |
| static void | Block () |
| static void | Delete (SMTask *) |
| static SMTask * | _MakeRef (SMTask *task) |
| static void | _DeleteRef (SMTask *task) |
| static SMTask * | _SetRef (SMTask *task, SMTask *new_task) |
| template<typename T > | |
| static T * | MakeRef (T *task) |
| static int | Roll (SMTask *) |
| static void | RollAll (const TimeInterval &max_time) |
| static void | Enter (SMTask *task) |
| static void | Leave (SMTask *task) |
| static int | TaskCount () |
| static void | PrintTasks () |
| static bool | NonFatalError (int err) |
| static bool | TemporaryNetworkError (int err) |
| static void | Cleanup () |
Public Attributes | |
| SMTaskRef< FileCopyPeer > | get |
| SMTaskRef< FileCopyPeer > | put |
Static Public Attributes | |
| static FileCopy *(* | fxp_create )(FileCopyPeer *src, FileCopyPeer *dst, bool cont) |
| static SMTaskRef< Log > | transfer_log |
Static Public Attributes inherited from SMTask | |
| static TimeDate | now |
| static SMTask * | current |
Protected Types | |
| enum | state_t { INITIAL, GET_INFO_WAIT, PUT_WAIT, DO_COPY, CONFIRM_WAIT, GET_DONE_WAIT, ALL_DONE } |
Protected Types inherited from SMTask | |
| enum | { STALL =0, MOVED =1, WANTDIE =2 } |
Protected Member Functions | |
| void | RateAdd (int a) |
| void | RateReset () |
Protected Member Functions inherited from SMTask | |
| virtual void | PrepareToDie () |
Protected Attributes | |
| enum FileCopy::state_t | state |
| off_t | bytes_count |
Protected Attributes inherited from SMTask | |
| int | running |
| int | ref_count |
| bool | deleting |
Definition at line 151 of file FileCopy.h.
|
protected |
| Enumerator | |
|---|---|
| INITIAL | |
| GET_INFO_WAIT | |
| PUT_WAIT | |
| DO_COPY | |
| CONFIRM_WAIT | |
| GET_DONE_WAIT | |
| ALL_DONE | |
Definition at line 158 of file FileCopy.h.
| FileCopy::FileCopy | ( | FileCopyPeer * | src, |
| FileCopyPeer * | dst, | ||
| bool | cont | ||
| ) |
Definition at line 409 of file FileCopy.cc.
References buffer_size, bytes_count, INITIAL, ResType::Query(), and set_state.
Referenced by New().
| FileCopy::~FileCopy | ( | ) |
Definition at line 427 of file FileCopy.cc.
Definition at line 252 of file FileCopy.h.
|
inline |
Definition at line 228 of file FileCopy.h.
References put.
Referenced by CopyJobEnv::AddCopier(), CMD(), and CatJob::NextFile().
| void FileCopy::Bg | ( | ) |
Definition at line 456 of file FileCopy.cc.
References put.
|
virtual |
Implements SMTask.
Reimplemented in FileCopyFtp.
Definition at line 63 of file FileCopy.cc.
References _, ALL_DONE, b, bytes_count, CONFIRM_WAIT, debug, DO_COPY, Done(), Buffer::Empty(), Error(), FILE_END, Buffer::Get(), get, GET_DONE_WAIT, GET_INFO_WAIT, INITIAL, LogTransfer(), m, memrchr(), SMTask::MOVED, NO_DATE, NO_DATE_YET, NO_SIZE, NO_SIZE_YET, SMTask::now, Buffer::Put(), put, PUT_WAIT, RateAdd(), RateReset(), s, set_state, SetError(), Buffer::Size(), Buffer::Skip(), skip_threshold, SMTask::STALL, state, and strerror().
|
inline |
|
inline |
|
inline |
Definition at line 229 of file FileCopy.h.
|
inline |
Definition at line 227 of file FileCopy.h.
References put.
|
inline |
Definition at line 222 of file FileCopy.h.
Referenced by FileCopyFtp::Do(), and Do().
|
inline |
Definition at line 223 of file FileCopy.h.
|
inline |
Definition at line 230 of file FileCopy.h.
| void FileCopy::Fg | ( | ) |
Definition at line 451 of file FileCopy.cc.
References put.
|
inline |
| off_t FileCopy::GetBytesRemaining | ( | ) |
Definition at line 545 of file FileCopy.cc.
References FILE_END, get, and GetPos().
Referenced by GetETA(), and GetETAStr().
|
inline |
Definition at line 204 of file FileCopy.h.
References GetBytesRemaining(), and GetETA().
Referenced by GetETA().
| long FileCopy::GetETA | ( | off_t | b) |
Definition at line 565 of file FileCopy.cc.
| const char * FileCopy::GetETAStr | ( | ) |
Definition at line 558 of file FileCopy.cc.
References b, GetBytesRemaining(), and put.
|
inline |
Definition at line 207 of file FileCopy.h.
Definition at line 594 of file FileCopy.cc.
References put.
| int FileCopy::GetPercentDone | ( | ) |
Definition at line 492 of file FileCopy.cc.
References FILE_END, NO_SIZE, NO_SIZE_YET, percent(), and put.
Referenced by GetPercentDoneStr().
| const char * FileCopy::GetPercentDoneStr | ( | ) |
Definition at line 513 of file FileCopy.cc.
References GetPercentDone(), and snprintf().
| off_t FileCopy::GetPos | ( | ) |
| pid_t FileCopy::GetProcGroup | ( | ) |
Definition at line 604 of file FileCopy.cc.
|
inline |
Definition at line 234 of file FileCopy.h.
Referenced by LogTransfer().
|
inline |
Definition at line 233 of file FileCopy.h.
Referenced by LogTransfer().
| float FileCopy::GetRate | ( | ) |
Definition at line 533 of file FileCopy.cc.
References put.
| const char * FileCopy::GetRateStr | ( | ) |
Definition at line 539 of file FileCopy.cc.
References put.
| off_t FileCopy::GetSize | ( | ) |
Definition at line 485 of file FileCopy.cc.
References NO_SIZE.
| const char * FileCopy::GetStatus | ( | ) |
Definition at line 571 of file FileCopy.cc.
References NULL, put, and xstring::vset().
| double FileCopy::GetTimeSpent | ( | ) |
Definition at line 587 of file FileCopy.cc.
Referenced by LogTransfer().
|
inline |
Definition at line 238 of file FileCopy.h.
| void FileCopy::Kill | ( | int | sig) |
Definition at line 613 of file FileCopy.cc.
References put.
| void FileCopy::LineBuffered | ( | int | size = 0x1000) |
| void FileCopy::LogTransfer | ( | ) |
Definition at line 621 of file FileCopy.cc.
References dir_file(), FILE_END, get_lftp_data_dir(), GetBytesCount(), GetRangeLimit(), GetRangeStart(), Speedometer::GetStr(), GetTimeSpent(), open(), put, ResMgr::Query(), ResMgr::QueryBool(), url::remove_password(), src, and transfer_log.
Referenced by Do().
|
static |
Definition at line 430 of file FileCopy.cc.
References FileCopy(), and fxp_create.
Referenced by CMD(), CatJob::NextFile(), and GetJob::NextFile().
|
protected |
Definition at line 522 of file FileCopy.cc.
Referenced by FileCopyFtp::Do(), and Do().
|
protected |
Definition at line 527 of file FileCopy.cc.
References SMTask::now.
Referenced by FileCopyFtp::Do(), and Do().
|
inline |
Definition at line 235 of file FileCopy.h.
Referenced by GetJob::NextFile().
|
inline |
|
virtual |
Definition at line 219 of file FileCopy.h.
|
inline |
Definition at line 215 of file FileCopy.h.
References p.
|
inline |
Definition at line 216 of file FileCopy.h.
References SetDate(), FileTimestamp::ts, and FileTimestamp::ts_prec.
Referenced by SetDate().
| void FileCopy::SetError | ( | const char * | str) |
Definition at line 462 of file FileCopy.cc.
References put, and xstring_c::set().
Referenced by FileCopyFtp::Do(), and Do().
| void FileCopy::SetRange | ( | off_t | s, |
| off_t | lim | ||
| ) |
Definition at line 652 of file FileCopy.cc.
References put.
|
inline |
Definition at line 232 of file FileCopy.h.
|
inline |
Definition at line 217 of file FileCopy.h.
|
virtual |
|
inline |
Definition at line 253 of file FileCopy.h.
References put.
|
inline |
Definition at line 254 of file FileCopy.h.
References put.
|
protected |
Definition at line 194 of file FileCopy.h.
Referenced by FileCopyFtp::Do(), Do(), FileCopy(), and GetBytesCount().
|
static |
Definition at line 250 of file FileCopy.h.
Referenced by FileAccess::ClassCleanup(), Ftp::ClassInit(), and New().
| SMTaskRef<FileCopyPeer> FileCopy::get |
Definition at line 154 of file FileCopy.h.
Referenced by FileCopyFtp::Do(), Do(), and GetBytesRemaining().
| SMTaskRef<FileCopyPeer> FileCopy::put |
Definition at line 155 of file FileCopy.h.
Referenced by AllowWrite(), Ascii(), Bg(), FileCopyFtp::Do(), Do(), DontCopyDate(), DontVerify(), Fg(), FileCopyFtp::FileCopyFtp(), GetETAStr(), GetFgData(), GetPercentDone(), GetPos(), GetProcGroup(), GetRate(), GetRateStr(), GetStatus(), Kill(), LogTransfer(), RemoveTargetFirst(), ResumeInternal(), SetError(), SetRange(), SuspendInternal(), WriteAllowed(), and WritePending().
|
protected |
Referenced by FileCopyFtp::Do(), Do(), and Done().
Definition at line 257 of file FileCopy.h.
Referenced by LogTransfer().