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

CTransferFile Class Reference

#include <TransferFile.h>

List of all members.

Public Member Functions

 CTransferFile (LPCTSTR pszPath)
virtual ~CTransferFile ()
void AddRef ()
void Release (BOOL bWrite)
HANDLE GetHandle (BOOL bWrite=FALSE)
BOOL IsOpen ()
BOOL Read (QWORD nOffset, LPVOID pBuffer, QWORD nBuffer, QWORD *pnRead)
BOOL Write (QWORD nOffset, LPCVOID pBuffer, QWORD nBuffer, QWORD *pnWritten)

Protected Member Functions

BOOL Open (BOOL bWrite, BOOL bCreate)
BOOL EnsureWrite ()
BOOL CloseWrite ()
void DeferredWrite (BOOL bOffline=FALSE)

Protected Attributes

CString m_sPath
HANDLE m_hFile
BOOL m_bWrite
DWORD m_nReference
DefWrite m_pDeferred [DEFERRED_MAX]
int m_nDeferred

Friends

class CTransferFiles

Classes

class  DefWrite


Constructor & Destructor Documentation

CTransferFile::CTransferFile LPCTSTR  pszPath  ) 
 

Definition at line 134 of file TransferFile.cpp.

References m_bWrite, m_hFile, m_nDeferred, m_nReference, and m_sPath.

CTransferFile::~CTransferFile  )  [virtual]
 

Definition at line 143 of file TransferFile.cpp.

References DeferredWrite(), and m_hFile.


Member Function Documentation

void CTransferFile::AddRef  ) 
 

Definition at line 155 of file TransferFile.cpp.

References m_nReference, and CTransferFiles::m_pSection.

BOOL CTransferFile::CloseWrite  )  [protected]
 

Definition at line 239 of file TransferFile.cpp.

References DeferredWrite(), m_bWrite, m_hFile, and Open().

Referenced by Release().

void CTransferFile::DeferredWrite BOOL  bOffline = FALSE  )  [protected]
 

Definition at line 319 of file TransferFile.cpp.

References m_bWrite, m_hFile, m_nDeferred, CTransferFile::DefWrite::m_nLength, CTransferFile::DefWrite::m_nOffset, CTransferFile::DefWrite::m_pBuffer, m_pDeferred, CShareazaApp::Message(), MSG_TEMP, NULL, and theApp.

Referenced by CloseWrite(), CTransferFiles::CommitDeferred(), GetHandle(), Read(), Write(), and ~CTransferFile().

BOOL CTransferFile::EnsureWrite  )  [protected]
 

Definition at line 224 of file TransferFile.cpp.

References m_bWrite, m_hFile, and Open().

HANDLE CTransferFile::GetHandle BOOL  bWrite = FALSE  ) 
 

Definition at line 178 of file TransferFile.cpp.

References DeferredWrite(), m_bWrite, m_hFile, m_nDeferred, and CTransferFiles::m_pSection.

Referenced by CFragmentedFile::Create(), CFragmentedFile::Flush(), and CFragmentedFile::MakeComplete().

BOOL CTransferFile::IsOpen  ) 
 

Definition at line 188 of file TransferFile.cpp.

References m_hFile.

Referenced by CFragmentedFile::Flush().

BOOL CTransferFile::Open BOOL  bWrite,
BOOL  bCreate
[protected]
 

Definition at line 196 of file TransferFile.cpp.

References CShareazaApp::m_bNT, m_bWrite, m_hFile, m_sPath, NULL, and theApp.

Referenced by CloseWrite(), and EnsureWrite().

BOOL CTransferFile::Read QWORD  nOffset,
LPVOID  pBuffer,
QWORD  nBuffer,
QWORD pnRead
 

Definition at line 255 of file TransferFile.cpp.

References DeferredWrite(), m_hFile, m_nDeferred, CTransferFiles::m_pSection, and NULL.

Referenced by CUploadTransferED2K::DispatchNextChunk(), CUploadTransferHTTP::OnWrite(), CFragmentedFile::ReadRange(), and CUploadTransferBT::ServeRequests().

void CTransferFile::Release BOOL  bWrite  ) 
 

Definition at line 161 of file TransferFile.cpp.

References CloseWrite(), m_bWrite, m_nReference, CTransferFiles::m_pSection, and CTransferFiles::Remove().

Referenced by CFragmentedFile::Close(), CUploadTransfer::CloseFile(), CUploadTransferHTTP::OnCompleted(), CUploadTransfer::OnRename(), and CUploadTransferHTTP::OpenFileSendHeaders().

BOOL CTransferFile::Write QWORD  nOffset,
LPCVOID  pBuffer,
QWORD  nBuffer,
QWORD pnWritten
 

Definition at line 275 of file TransferFile.cpp.

References DEFERRED_MAX, DEFERRED_THRESHOLD, DeferredWrite(), m_bWrite, m_hFile, m_nDeferred, CTransferFile::DefWrite::m_nLength, CTransferFile::DefWrite::m_nOffset, CTransferFile::DefWrite::m_pBuffer, m_pDeferred, CTransferFiles::m_pSection, CShareazaApp::Message(), MSG_TEMP, NULL, CTransferFiles::QueueDeferred(), and theApp.

Referenced by CFragmentedFile::WriteRange().


Friends And Related Function Documentation

friend class CTransferFiles [friend]
 

Definition at line 97 of file TransferFile.h.


Member Data Documentation

BOOL CTransferFile::m_bWrite [protected]
 

Definition at line 77 of file TransferFile.h.

Referenced by CloseWrite(), CTransferFile(), DeferredWrite(), EnsureWrite(), GetHandle(), Open(), Release(), and Write().

HANDLE CTransferFile::m_hFile [protected]
 

Definition at line 76 of file TransferFile.h.

Referenced by CloseWrite(), CTransferFile(), DeferredWrite(), EnsureWrite(), GetHandle(), IsOpen(), Open(), Read(), Write(), and ~CTransferFile().

int CTransferFile::m_nDeferred [protected]
 

Definition at line 81 of file TransferFile.h.

Referenced by CTransferFile(), DeferredWrite(), GetHandle(), Read(), and Write().

DWORD CTransferFile::m_nReference [protected]
 

Definition at line 78 of file TransferFile.h.

Referenced by AddRef(), CTransferFile(), and Release().

DefWrite CTransferFile::m_pDeferred[DEFERRED_MAX] [protected]
 

Definition at line 80 of file TransferFile.h.

Referenced by DeferredWrite(), and Write().

CString CTransferFile::m_sPath [protected]
 

Definition at line 75 of file TransferFile.h.

Referenced by CTransferFile(), and Open().


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