Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CDownloadTask Class Reference

#include <DownloadTask.h>

List of all members.

Public Types

enum  { dtaskAllocate, dtaskCopySimple, dtaskCopyTorrent }

Public Member Functions

 CDownloadTask (CDownload *pDownload, int nTask)
virtual ~CDownloadTask ()
void Abort ()
BOOL WasAborted ()
virtual BOOL InitInstance ()
virtual int Run ()

Static Public Member Functions

static CString SafeFilename (LPCTSTR pszName)

Public Attributes

int m_nTask
CDownloadm_pDownload
BOOL m_bSuccess
QWORD m_nSize
CString m_sName
CString m_sFilename
CString m_sPath
CBTInfo m_pTorrent

Protected Member Functions

void RunAllocate ()
void RunCopySimple ()
void RunCopyTorrent ()
BOOL CopyFile (HANDLE hSource, LPCTSTR pszTarget, QWORD nLength)
void CreatePathForFile (const CString &strBase, const CString &strPath)

Protected Attributes

CEvent * m_pEvent

Private Attributes

int m_nTorrentFile


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
dtaskAllocate 
dtaskCopySimple 
dtaskCopyTorrent 

Definition at line 59 of file DownloadTask.h.


Constructor & Destructor Documentation

CDownloadTask::CDownloadTask CDownload pDownload,
int  nTask
 

Definition at line 60 of file DownloadTask.cpp.

References CLibraryFolders::AddFolder(), CSettings::sDownloads::CollectionPath, DownloadGroups, CSettings::Downloads, CDownloadGroups::GetCompletedPath(), LibraryFolders, NULL, Settings, and CSettings::sDownloads::TorrentPath.

CDownloadTask::~CDownloadTask  )  [virtual]
 

Definition at line 109 of file DownloadTask.cpp.

References CDownloads::Check(), Downloads, m_pDownload, m_pEvent, CTransfers::m_pSection, CDownloadBase::m_pTask, NULL, CDownload::OnTaskComplete(), and Transfers.


Member Function Documentation

void CDownloadTask::Abort  ) 
 

Definition at line 127 of file DownloadTask.cpp.

References m_pEvent, CTransfers::m_pSection, and Transfers.

Referenced by CDownload::Remove(), and CDownload::~CDownload().

BOOL CDownloadTask::CopyFile HANDLE  hSource,
LPCTSTR  pszTarget,
QWORD  nLength
[protected]
 

Definition at line 417 of file DownloadTask.cpp.

References BUFFER_SIZE, m_pEvent, and NULL.

Referenced by RunCopySimple(), and RunCopyTorrent().

void CDownloadTask::CreatePathForFile const CString &  strBase,
const CString &  strPath
[protected]
 

Definition at line 502 of file DownloadTask.cpp.

References NULL.

Referenced by RunCopyTorrent().

BOOL CDownloadTask::InitInstance  )  [virtual]
 

Definition at line 144 of file DownloadTask.cpp.

int CDownloadTask::Run  )  [virtual]
 

Definition at line 149 of file DownloadTask.cpp.

References CSettings::sDownloads::CompletePath, CSettings::Downloads, dtaskAllocate, dtaskCopySimple, dtaskCopyTorrent, m_bSuccess, m_nTask, m_pEvent, m_sPath, NULL, RunAllocate(), RunCopySimple(), RunCopyTorrent(), and Settings.

void CDownloadTask::RunAllocate  )  [protected]
 

Definition at line 186 of file DownloadTask.cpp.

References FSCTL_SET_SPARSE, m_bSuccess, m_nSize, m_sFilename, and NULL.

Referenced by Run().

void CDownloadTask::RunCopySimple  )  [protected]
 

Definition at line 221 of file DownloadTask.cpp.

References CopyFile(), m_bSuccess, m_nSize, m_sFilename, m_sName, m_sPath, CShareazaApp::Message(), MSG_DEBUG, NULL, CUploads::OnRename(), SafeFilename(), theApp, and Uploads.

Referenced by Run().

void CDownloadTask::RunCopyTorrent  )  [protected]
 

Definition at line 355 of file DownloadTask.cpp.

References CopyFile(), CreatePathForFile(), CDownloads::dlPathComplete, Downloads, CBTInfo::IsAvailable(), CDownloads::IsSpaceAvailable(), m_bSuccess, CBTInfo::m_nFiles, CBTInfo::CBTFile::m_nSize, m_nTorrentFile, CBTInfo::m_nTotalSize, m_pEvent, CBTInfo::m_pFiles, m_pTorrent, m_sFilename, CBTInfo::CBTFile::m_sPath, m_sPath, CShareazaApp::Message(), MSG_DEBUG, NULL, and theApp.

Referenced by Run().

CString CDownloadTask::SafeFilename LPCTSTR  pszName  )  [static]
 

Definition at line 456 of file DownloadTask.cpp.

References CSettings::Downloads, CSettings::sDownloads::IncompletePath, IsCharacter(), CShareazaApp::m_bNT, NULL, Settings, and theApp.

Referenced by CDownloadBase::GenerateLocalName(), CBTInfo::LoadTorrentTree(), RunCopySimple(), and CBTInfo::SaveTorrentFile().

BOOL CDownloadTask::WasAborted  ) 
 

Definition at line 136 of file DownloadTask.cpp.

References m_pEvent, and NULL.

Referenced by CDownload::OnTaskComplete().


Member Data Documentation

BOOL CDownloadTask::m_bSuccess
 

Definition at line 45 of file DownloadTask.h.

Referenced by CDownload::OnMoved(), Run(), RunAllocate(), RunCopySimple(), and RunCopyTorrent().

QWORD CDownloadTask::m_nSize
 

Definition at line 49 of file DownloadTask.h.

Referenced by RunAllocate(), and RunCopySimple().

int CDownloadTask::m_nTask
 

Definition at line 43 of file DownloadTask.h.

Referenced by CDownload::OnTaskComplete(), and Run().

int CDownloadTask::m_nTorrentFile [private]
 

Definition at line 47 of file DownloadTask.h.

Referenced by RunCopyTorrent().

CDownload* CDownloadTask::m_pDownload
 

Definition at line 44 of file DownloadTask.h.

Referenced by ~CDownloadTask().

CEvent* CDownloadTask::m_pEvent [protected]
 

Definition at line 55 of file DownloadTask.h.

Referenced by Abort(), CopyFile(), Run(), RunCopyTorrent(), WasAborted(), and ~CDownloadTask().

CBTInfo CDownloadTask::m_pTorrent
 

Definition at line 53 of file DownloadTask.h.

Referenced by RunCopyTorrent().

CString CDownloadTask::m_sFilename
 

Definition at line 51 of file DownloadTask.h.

Referenced by CDownload::OnMoved(), RunAllocate(), RunCopySimple(), and RunCopyTorrent().

CString CDownloadTask::m_sName
 

Definition at line 50 of file DownloadTask.h.

Referenced by RunCopySimple().

CString CDownloadTask::m_sPath
 

Definition at line 52 of file DownloadTask.h.

Referenced by CDownload::OnMoved(), Run(), RunCopySimple(), and RunCopyTorrent().


The documentation for this class was generated from the following files:
Generated on Thu Dec 15 10:40:06 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2