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)  

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
FileCopy Class Reference

#include <FileCopy.h>

Inheritance diagram for FileCopy:
Collaboration diagram for FileCopy:

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 ()
 
FgDataGetFgData (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 FileCopyNew (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< FileCopyPeerget
 
SMTaskRef< FileCopyPeerput
 

Static Public Attributes

static FileCopy *(* fxp_create )(FileCopyPeer *src, FileCopyPeer *dst, bool cont)
 
static SMTaskRef< Logtransfer_log
 
- Static Public Attributes inherited from SMTask
static TimeDate now
 
static SMTaskcurrent
 

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
 

Detailed Description

Definition at line 151 of file FileCopy.h.

Member Enumeration Documentation

enum FileCopy::state_t
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.

Constructor & Destructor Documentation

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.

Member Function Documentation

void FileCopy::AllowWrite ( bool  y = true)
inline

Definition at line 252 of file FileCopy.h.

References put, and y.

void FileCopy::Ascii ( )
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.

bool FileCopy::Done ( )
inline

Definition at line 221 of file FileCopy.h.

References ALL_DONE, and state.

Referenced by Do().

void FileCopy::DontCopyDate ( )
inline

Definition at line 226 of file FileCopy.h.

References put.

Referenced by CatJob::NextFile().

void FileCopy::DontFailIfBroken ( )
inline

Definition at line 229 of file FileCopy.h.

void FileCopy::DontVerify ( )
inline

Definition at line 227 of file FileCopy.h.

References put.

bool FileCopy::Error ( )
inline

Definition at line 222 of file FileCopy.h.

Referenced by FileCopyFtp::Do(), and Do().

const char* FileCopy::ErrorText ( )
inline

Definition at line 223 of file FileCopy.h.

void FileCopy::FailIfCannotSeek ( )
inline

Definition at line 230 of file FileCopy.h.

void FileCopy::Fg ( )

Definition at line 451 of file FileCopy.cc.

References put.

off_t FileCopy::GetBytesCount ( )
inline

Definition at line 212 of file FileCopy.h.

References bytes_count.

Referenced by LogTransfer().

off_t FileCopy::GetBytesRemaining ( )

Definition at line 545 of file FileCopy.cc.

References FILE_END, get, and GetPos().

Referenced by GetETA(), and GetETAStr().

long FileCopy::GetETA ( )
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.

const char* FileCopy::GetETAStrSFromTime ( time_t  t)
inline

Definition at line 207 of file FileCopy.h.

FgData * FileCopy::GetFgData ( bool  fg)

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 ( )

Definition at line 476 of file FileCopy.cc.

References put.

Referenced by GetBytesRemaining().

pid_t FileCopy::GetProcGroup ( )

Definition at line 604 of file FileCopy.cc.

References p, and put.

off_t FileCopy::GetRangeLimit ( )
inline

Definition at line 234 of file FileCopy.h.

Referenced by LogTransfer().

off_t FileCopy::GetRangeStart ( )
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().

bool FileCopy::IsLineBuffered ( ) const
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)

Definition at line 469 of file FileCopy.cc.

References s.

Referenced by CatJob::NextFile().

FileCopy * FileCopy::New ( FileCopyPeer src,
FileCopyPeer dst,
bool  cont 
)
static

Definition at line 430 of file FileCopy.cc.

References FileCopy(), and fxp_create.

Referenced by CMD(), CatJob::NextFile(), and GetJob::NextFile().

void FileCopy::RateAdd ( int  a)
protected

Definition at line 522 of file FileCopy.cc.

Referenced by FileCopyFtp::Do(), and Do().

void FileCopy::RateReset ( )
protected

Definition at line 527 of file FileCopy.cc.

References SMTask::now.

Referenced by FileCopyFtp::Do(), and Do().

void FileCopy::RemoveSourceLater ( )
inline

Definition at line 235 of file FileCopy.h.

Referenced by GetJob::NextFile().

void FileCopy::RemoveTargetFirst ( )
inline

Definition at line 236 of file FileCopy.h.

References put.

Referenced by GetJob::NextFile().

void FileCopy::ResumeInternal ( )
virtual

Reimplemented from SMTask.

Definition at line 445 of file FileCopy.cc.

References put.

bool FileCopy::SetContinue ( bool  new_cont)
inline

Definition at line 219 of file FileCopy.h.

void FileCopy::SetDate ( time_t  t,
int  p = 0 
)
inline

Definition at line 215 of file FileCopy.h.

References p.

void FileCopy::SetDate ( const FileTimestamp t)
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.

void FileCopy::SetRangeLimit ( off_t  lim)
inline

Definition at line 232 of file FileCopy.h.

void FileCopy::SetSize ( off_t  s)
inline

Definition at line 217 of file FileCopy.h.

void FileCopy::SuspendInternal ( )
virtual

Reimplemented from SMTask.

Definition at line 439 of file FileCopy.cc.

References put.

bool FileCopy::WriteAllowed ( )
inline

Definition at line 253 of file FileCopy.h.

References put.

bool FileCopy::WritePending ( )
inline

Definition at line 254 of file FileCopy.h.

References put.

Member Data Documentation

off_t FileCopy::bytes_count
protected

Definition at line 194 of file FileCopy.h.

Referenced by FileCopyFtp::Do(), Do(), FileCopy(), and GetBytesCount().

FileCopy *(* FileCopy::fxp_create)(FileCopyPeer *src, FileCopyPeer *dst, bool cont)
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().

enum FileCopy::state_t FileCopy::state
protected

Referenced by FileCopyFtp::Do(), Do(), and Done().

SMTaskRef< Log > FileCopy::transfer_log
static

Definition at line 257 of file FileCopy.h.

Referenced by LogTransfer().


The documentation for this class was generated from the following files: