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

CFragmentedFile Class Reference

#include <FragmentedFile.h>

List of all members.

Public Member Functions

 CFragmentedFile ()
virtual ~CFragmentedFile ()
BOOL Create (LPCTSTR pszFile, QWORD nLength)
BOOL Open (LPCTSTR pszFile)
BOOL Flush ()
void Close ()
void Clear ()
BOOL MakeComplete ()
void Serialize (CArchive &ar, int nVersion)
BOOL IsPositionRemaining (QWORD nOffset) const
BOOL DoesRangeOverlap (QWORD nOffset, QWORD nLength) const
QWORD GetRangeOverlap (QWORD nOffset, QWORD nLength) const
BOOL WriteRange (QWORD nOffset, LPCVOID pData, QWORD nLength)
BOOL ReadRange (QWORD nOffset, LPVOID pData, QWORD nLength)
QWORD InvalidateRange (QWORD nOffset, QWORD nLength)
BOOL IsValid () const
BOOL IsOpen () const
QWORD GetTotal () const
QWORD GetRemaining () const
QWORD GetCompleted () const
const FF::SimpleFragmentListGetEmptyFragmentList () const
QWORD GetEmptyFragmentCount () const
BOOL IsFlushNeeded () const

Protected Attributes

CTransferFilem_pFile
QWORD m_nUnflushed

Private Attributes

FF::SimpleFragmentList m_oFList

Friends

class CEDPartImporter


Constructor & Destructor Documentation

CFragmentedFile::CFragmentedFile  ) 
 

Definition at line 42 of file FragmentedFile.cpp.

CFragmentedFile::~CFragmentedFile  )  [virtual]
 

Definition at line 46 of file FragmentedFile.cpp.

References Clear().


Member Function Documentation

void CFragmentedFile::Clear  ) 
 

Definition at line 124 of file FragmentedFile.cpp.

References Close(), m_oFList, and detail::List< FragmentT, ContainerT >::swap().

Referenced by ~CFragmentedFile().

void CFragmentedFile::Close  ) 
 

Definition at line 111 of file FragmentedFile.cpp.

References m_nUnflushed, m_pFile, NULL, and CTransferFile::Release().

Referenced by Clear(), CDownloadWithFile::CloseFile(), and CDownload::OnDownloaded().

BOOL CFragmentedFile::Create LPCTSTR  pszFile,
QWORD  nLength
 

Definition at line 54 of file FragmentedFile.cpp.

References CSettings::Downloads, FSCTL_SET_SPARSE, CTransferFile::GetHandle(), detail::List< FragmentT, ContainerT >::insert(), detail::List< FragmentT, ContainerT >::limit(), CShareazaApp::m_bNT, m_oFList, m_pFile, CShareazaApp::Message(), MSG_ERROR, NULL, CTransferFiles::Open(), Settings, CSettings::sDownloads::SparseThreshold, detail::List< FragmentT, ContainerT >::swap(), theApp, and TransferFiles.

Referenced by CDownloadWithFile::OpenFile().

BOOL CFragmentedFile::DoesRangeOverlap QWORD  nOffset,
QWORD  nLength
const
 

Definition at line 182 of file FragmentedFile.cpp.

References m_oFList, and detail::overlaps().

Referenced by ReadRange().

BOOL CFragmentedFile::Flush  ) 
 

Definition at line 99 of file FragmentedFile.cpp.

References CTransferFile::GetHandle(), CTransferFile::IsOpen(), m_nUnflushed, m_pFile, and NULL.

Referenced by CDownload::OnRun().

QWORD CFragmentedFile::GetCompleted  )  const [inline]
 

Definition at line 86 of file FragmentedFile.h.

References m_oFList, and detail::List< FragmentT, ContainerT >::missing().

Referenced by CDownloadWithFile::GetVolumeComplete().

QWORD CFragmentedFile::GetEmptyFragmentCount  )  const [inline]
 

Definition at line 96 of file FragmentedFile.h.

References m_oFList, and detail::List< FragmentT, ContainerT >::size().

const FF::SimpleFragmentList& CFragmentedFile::GetEmptyFragmentList  )  const [inline]
 

Definition at line 91 of file FragmentedFile.h.

References m_oFList.

Referenced by CDownloadWithFile::AreRangesUseful(), CDownloadWithFile::ClipUploadRange(), CDownloadWithTiger::FindNewValidationBlock(), CDownloadWithFile::GetAvailableRanges(), CDownloadWithFile::GetEmptyFragmentList(), CDownloadWithFile::GetPossibleFragments(), CDownloadWithFile::GetRandomRange(), CDownloadWithFile::IsRangeUseful(), and CDownloadWithFile::IsRangeUsefulEnough().

QWORD CFragmentedFile::GetRangeOverlap QWORD  nOffset,
QWORD  nLength
const
 

Definition at line 187 of file FragmentedFile.cpp.

References m_oFList, and detail::overlappingSum().

QWORD CFragmentedFile::GetRemaining  )  const [inline]
 

Definition at line 81 of file FragmentedFile.h.

References m_oFList, and detail::List< FragmentT, ContainerT >::sumLength().

Referenced by CDownloadWithTiger::ContinueValidation(), CDownloadWithFile::GetVolumeRemaining(), CDownloadWithFile::PrepareFile(), and CDownloadWithFile::RunFile().

QWORD CFragmentedFile::GetTotal  )  const [inline]
 

Definition at line 76 of file FragmentedFile.h.

References detail::List< FragmentT, ContainerT >::limit(), and m_oFList.

QWORD CFragmentedFile::InvalidateRange QWORD  nOffset,
QWORD  nLength
 

Definition at line 244 of file FragmentedFile.cpp.

References detail::List< FragmentT, ContainerT >::insert(), and m_oFList.

Referenced by CDownloadWithFile::EraseRange(), and CDownloadWithTiger::FinishValidation().

BOOL CFragmentedFile::IsFlushNeeded  )  const [inline]
 

Definition at line 101 of file FragmentedFile.h.

References m_nUnflushed, m_pFile, and NULL.

BOOL CFragmentedFile::IsOpen  )  const [inline]
 

Definition at line 71 of file FragmentedFile.h.

References m_pFile, and NULL.

Referenced by CDownloadWithFile::OpenFile(), CDownloadWithFile::RunFile(), CDownloadWithTorrent::RunTorrent(), and CDownloadWithTorrent::SeedTorrent().

BOOL CFragmentedFile::IsPositionRemaining QWORD  nOffset  )  const
 

Definition at line 177 of file FragmentedFile.cpp.

References detail::hasPosition(), and m_oFList.

Referenced by CDownloadWithFile::ClipUploadRange(), and CDownloadWithFile::IsPositionEmpty().

BOOL CFragmentedFile::IsValid  )  const [inline]
 

Definition at line 66 of file FragmentedFile.h.

References detail::List< FragmentT, ContainerT >::limit(), and m_oFList.

Referenced by CDownloadWithFile::AreRangesUseful(), CDownloadWithFile::ClipUploadRange(), CDownloadWithFile::DeleteFile(), CDownloadWithFile::GetAvailableRanges(), CDownloadWithFile::GetRandomRange(), CDownloadWithFile::GetVolumeComplete(), CDownloadWithFile::GetVolumeRemaining(), CDownloadWithFile::IsPositionEmpty(), CDownloadWithFile::IsRangeUseful(), CDownloadWithFile::IsRangeUsefulEnough(), and CDownloadWithFile::OpenFile().

BOOL CFragmentedFile::MakeComplete  ) 
 

Definition at line 135 of file FragmentedFile.cpp.

References detail::List< FragmentT, ContainerT >::clear(), detail::List< FragmentT, ContainerT >::empty(), CTransferFile::GetHandle(), detail::List< FragmentT, ContainerT >::limit(), m_oFList, m_pFile, and NULL.

Referenced by CDownloadWithFile::MakeComplete().

BOOL CFragmentedFile::Open LPCTSTR  pszFile  ) 
 

Definition at line 85 of file FragmentedFile.cpp.

References detail::List< FragmentT, ContainerT >::limit(), m_oFList, m_pFile, NULL, CTransferFiles::Open(), and TransferFiles.

Referenced by CDownloadWithFile::OpenFile().

BOOL CFragmentedFile::ReadRange QWORD  nOffset,
LPVOID  pData,
QWORD  nLength
 

Definition at line 228 of file FragmentedFile.cpp.

References DoesRangeOverlap(), m_pFile, NULL, and CTransferFile::Read().

Referenced by CDownloadWithTiger::ContinueValidation().

void CFragmentedFile::Serialize CArchive &  ar,
int  nVersion
 

Definition at line 160 of file FragmentedFile.cpp.

References detail::List< FragmentT, ContainerT >::limit(), m_oFList, detail::SerializeIn1(), and detail::SerializeOut1().

Referenced by CDownloadWithFile::Serialize(), and CDownload::SerializeOld().

BOOL CFragmentedFile::WriteRange QWORD  nOffset,
LPCVOID  pData,
QWORD  nLength
 

Definition at line 195 of file FragmentedFile.cpp.

References FF::detail::Fragment< Payload, OffsetType >::begin(), FF::detail::Fragment< Payload, OffsetType >::end(), detail::List< FragmentT, ContainerT >::erase(), m_nUnflushed, m_oFList, m_pFile, NULL, detail::List< FragmentT, ContainerT >::overlappingRange(), and CTransferFile::Write().

Referenced by CDownloadWithFile::SubmitData().


Friends And Related Function Documentation

friend class CEDPartImporter [friend]
 

Definition at line 106 of file FragmentedFile.h.


Member Data Documentation

QWORD CFragmentedFile::m_nUnflushed [protected]
 

Definition at line 42 of file FragmentedFile.h.

Referenced by Close(), Flush(), IsFlushNeeded(), and WriteRange().

FF::SimpleFragmentList CFragmentedFile::m_oFList [private]
 

Definition at line 45 of file FragmentedFile.h.

Referenced by Clear(), Create(), DoesRangeOverlap(), GetCompleted(), GetEmptyFragmentCount(), GetEmptyFragmentList(), GetRangeOverlap(), GetRemaining(), GetTotal(), CEDPartImporter::ImportFile(), InvalidateRange(), IsPositionRemaining(), IsValid(), MakeComplete(), Open(), Serialize(), and WriteRange().

CTransferFile* CFragmentedFile::m_pFile [protected]
 

Definition at line 41 of file FragmentedFile.h.

Referenced by Close(), Create(), Flush(), IsFlushNeeded(), IsOpen(), MakeComplete(), Open(), ReadRange(), and WriteRange().


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