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

CDownloadWithSources Class Reference

#include <DownloadWithSources.h>

Inheritance diagram for CDownloadWithSources:

CDownloadBase CDownloadWithTransfers CDownloadWithFile CDownloadWithTorrent CDownloadWithTiger CDownloadWithSearch CDownloadWithExtras CDownload List of all members.

Public Member Functions

 CDownloadWithSources ()
virtual ~CDownloadWithSources ()
CString GetSourceURLs (CStringList *pState, int nMaximum, PROTOCOLID nProtocol, CDownloadSource *pExcept)
int GetSourceCount (BOOL bNoPush=FALSE, BOOL bSane=FALSE) const
int GetBTSourceCount (BOOL bNoPush=FALSE) const
int GetED2KCompleteSourceCount () const
BOOL CheckSource (CDownloadSource *pSource) const
void ClearSources ()
BOOL AddSourceHit (CQueryHit *pHit, BOOL bForce=FALSE)
BOOL AddSourceED2K (DWORD nClientID, WORD nClientPort, DWORD nServerIP, WORD nServerPort, GGUID *pGUID=NULL)
BOOL AddSourceBT (SHA1 *pGUID, IN_ADDR *pAddress, WORD nPort)
BOOL AddSourceURL (LPCTSTR pszURL, BOOL bURN=FALSE, FILETIME *pLastSeen=NULL)
int AddSourceURLs (LPCTSTR pszURLs, BOOL bURN=FALSE)
virtual BOOL OnQueryHits (CQueryHit *pHits)
virtual void Serialize (CArchive &ar, int nVersion)
CDownloadSourceGetFirstSource () const

Public Attributes

CStringList m_pFailedSources
CXMLElementm_pXML

Protected Member Functions

BOOL AddSourceInternal (CDownloadSource *pSource)
void RemoveSource (CDownloadSource *pSource, BOOL bBan)
void SortSource (CDownloadSource *pSource, BOOL bTop)
void SortSource (CDownloadSource *pSource)
void RemoveOverlappingSources (QWORD nOffset, QWORD nLength)
int GetSourceColour ()

Protected Attributes

CDownloadSourcem_pSourceFirst
CDownloadSourcem_pSourceLast
int m_nSourceCount

Friends

class CDownloadSource
class CDownloadTransfer

Constructor & Destructor Documentation

CDownloadWithSources::CDownloadWithSources  ) 
 

Definition at line 50 of file DownloadWithSources.cpp.

References m_nSourceCount, m_pSourceFirst, m_pSourceLast, m_pXML, and NULL.

CDownloadWithSources::~CDownloadWithSources  )  [virtual]
 

Definition at line 58 of file DownloadWithSources.cpp.

References ClearSources(), m_pXML, and NULL.


Member Function Documentation

BOOL CDownloadWithSources::AddSourceBT SHA1 pGUID,
IN_ADDR *  pAddress,
WORD  nPort
 

Definition at line 272 of file DownloadWithSources.cpp.

References AddSourceInternal(), CDownloadSource, CSettings::Connection, CSettings::sConnection::IgnoreOwnIP, CNetwork::IsFirewalledAddress(), CNetwork::m_pHost, Network, and Settings.

Referenced by CDownloadTransferBT::OnSourceResponse(), and CBTTrackerRequest::Process().

BOOL CDownloadWithSources::AddSourceED2K DWORD  nClientID,
WORD  nClientPort,
DWORD  nServerIP,
WORD  nServerPort,
GGUID pGUID = NULL
 

Definition at line 267 of file DownloadWithSources.cpp.

References AddSourceInternal(), and CDownloadSource.

BOOL CDownloadWithSources::AddSourceHit CQueryHit pHit,
BOOL  bForce = FALSE
 

Definition at line 169 of file DownloadWithSources.cpp.

References CXMLElement::AddAttribute(), CXMLElement::AddElement(), AddSourceInternal(), CDownloadSource, CXMLElement::Clone(), CSettings::Downloads, CSettings::General, CSchemaCache::Get(), CSettings::sGeneral::HashIntegrity, CQueryHit::m_bBTH, CDownloadBase::m_bBTH, CQueryHit::m_bED2K, CDownloadBase::m_bED2K, CQueryHit::m_bSHA1, CDownloadBase::m_bSHA1, CQueryHit::m_bSize, CQueryHit::m_bTiger, CDownloadBase::m_bTiger, CQueryHit::m_nSize, CDownloadBase::m_nSize, CQueryHit::m_pBTH, CDownloadBase::m_pBTH, CQueryHit::m_pED2K, CDownloadBase::m_pED2K, CQueryHit::m_pSHA1, CDownloadBase::m_pSHA1, CQueryHit::m_pTiger, CDownloadBase::m_pTiger, CQueryHit::m_pXML, m_pXML, CQueryHit::m_sName, CDownloadBase::m_sRemoteName, CQueryHit::m_sSchemaPlural, CQueryHit::m_sSchemaURI, CQueryHit::m_sURL, CSettings::sDownloads::Metadata, NULL, SchemaCache, CXMLAttribute::schemaName, Settings, SIZE_UNKNOWN, and CXMLAttribute::xmlnsInstance.

Referenced by CDownloads::Add(), and OnQueryHits().

BOOL CDownloadWithSources::AddSourceInternal CDownloadSource pSource  )  [protected]
 

Definition at line 424 of file DownloadWithSources.cpp.

References CSettings::Connection, CSettings::sConnection::IgnoreOwnIP, CSettings::sConnection::InPort, m_nSourceCount, CNetwork::m_pHost, CDownloadSource::m_pNext, m_pSourceFirst, m_pSourceLast, Network, NULL, PROTOCOL_ED2K, PROTOCOL_HTTP, CDownloadBase::SetModified(), and Settings.

Referenced by AddSourceBT(), AddSourceED2K(), AddSourceHit(), AddSourceURL(), CDownloadWithTorrent::CreateTorrentTransfer(), and CDownload::SerializeOld().

BOOL CDownloadWithSources::AddSourceURL LPCTSTR  pszURL,
BOOL  bURN = FALSE,
FILETIME *  pLastSeen = NULL
 

Definition at line 288 of file DownloadWithSources.cpp.

References AddSourceInternal(), CDownloadSource, CNetwork::IsFirewalledAddress(), CDownloadBase::m_bSHA1, CSourceURL::m_bSHA1, CSourceURL::m_pAddress, m_pFailedSources, CNetwork::m_pHost, CSourceURL::m_pSHA1, CDownloadBase::m_pSHA1, CDownloadBase::m_sRemoteName, Network, NULL, CSourceURL::Parse(), and CConnection::URLDecode().

Referenced by AddSourceURLs(), CDownloadsWnd::OnDownloadsUrl(), and CDownloadTransferBT::OnSourceResponse().

int CDownloadWithSources::AddSourceURLs LPCTSTR  pszURLs,
BOOL  bURN = FALSE
 

Definition at line 342 of file DownloadWithSources.cpp.

References _tcsistr(), AddSourceURL(), CSHA::HashToString(), CNetwork::IsFirewalledAddress(), CDownloadBase::m_bSHA1, CDownloadBase::m_pSHA1, Network, NULL, and TimeFromString().

Referenced by CDownloads::Add(), CDownloadTransferHTTP::OnHeaderLine(), and CUploadTransferHTTP::RequestPartialFile().

BOOL CDownloadWithSources::CheckSource CDownloadSource pSource  )  const
 

Definition at line 138 of file DownloadWithSources.cpp.

References CDownloadSource::m_pNext, and m_pSourceFirst.

void CDownloadWithSources::ClearSources  ) 
 

Definition at line 151 of file DownloadWithSources.cpp.

References GetFirstSource(), m_nSourceCount, m_pSourceFirst, m_pSourceLast, NULL, and CDownloadBase::SetModified().

Referenced by CDownloads::Load(), CDownloadEditDlg::OnLButtonUp(), CDownload::OnMoved(), and ~CDownloadWithSources().

int CDownloadWithSources::GetBTSourceCount BOOL  bNoPush = FALSE  )  const
 

Definition at line 91 of file DownloadWithSources.cpp.

References CDownloadSource::m_pNext, m_pSourceFirst, and PROTOCOL_BT.

Referenced by CDownloadWithTorrent::RunTorrent().

int CDownloadWithSources::GetED2KCompleteSourceCount  )  const
 

Definition at line 113 of file DownloadWithSources.cpp.

References CDownloadSource::m_pNext, m_pSourceFirst, and PROTOCOL_ED2K.

CDownloadSource* CDownloadWithSources::GetFirstSource  )  const [inline]
 

Definition at line 79 of file DownloadWithSources.h.

References m_pSourceFirst.

Referenced by ClearSources(), CDownloadWithTorrent::CreateTorrentTransfer(), CDownloadsCtrl::DeselectAll(), CFragmentBar::DrawDownload(), CDownloadsCtrl::GetAt(), CDownloadsCtrl::GetRect(), CDownloadsCtrl::GetSelectedCount(), GetSourceColour(), GetSourceURLs(), CDownloadsCtrl::HitTest(), CDownloadsCtrl::IsExpandable(), CDownloadWithTransfers::OnAcceptPush(), CDownloadsWnd::OnBrowseLaunch(), CDownloadWithTransfers::OnDonkeyCallback(), CDownloadsCtrl::OnLButtonDblClk(), CDownloadsCtrl::OnLButtonDown(), CDownloadsCtrl::OnPaint(), CDownloadsCtrl::OnSize(), CBTClient::OnSourceRequest(), CDownloadsWnd::OnTransfersChat(), CDownloadsWnd::OnTransfersConnect(), CDownloadsWnd::OnTransfersDisconnect(), CDownloadsWnd::OnTransfersForget(), CDownloadsWnd::Prepare(), RemoveOverlappingSources(), CDownload::Resume(), CDownloadsWnd::Select(), CDownloadsCtrl::SelectAll(), and Serialize().

int CDownloadWithSources::GetSourceColour  )  [protected]
 

Definition at line 721 of file DownloadWithSources.cpp.

References GetFirstSource(), and SRC_COLOURS.

Referenced by CDownloadSource::GetColour().

int CDownloadWithSources::GetSourceCount BOOL  bNoPush = FALSE,
BOOL  bSane = FALSE
const
 

Definition at line 67 of file DownloadWithSources.cpp.

References m_nSourceCount, CDownloadSource::m_pNext, and m_pSourceFirst.

Referenced by CDownloadsCtrl::GetClientStatus(), CDownloads::GetCount(), CDownloadsCtrl::GetDownloadStatus(), CDownloadsCtrl::GetRect(), CDownloadsCtrl::HitTest(), CDownloadsCtrl::IsExpandable(), CDownloadsWnd::OnDownloadsHelp(), CDownloadTipCtrl::OnPaint(), CDownloadsCtrl::OnPaint(), CDownload::OnRun(), CDownloadsCtrl::OnSize(), CDownloadMonitorDlg::OnTimer(), CDownloadsCtrl::PaintDownload(), CDownload::Resume(), CDownloadWithSearch::RunSearch(), CDownloadWithTorrent::RunTorrent(), CDownloadWithTorrent::SeedTorrent(), CDownloadTransferED2K::SendPrimaryRequest(), Serialize(), and CQuerySearch::WriteHashesToEDPacket().

CString CDownloadWithSources::GetSourceURLs CStringList *  pState,
int  nMaximum,
PROTOCOLID  nProtocol,
CDownloadSource pExcept
 

Definition at line 510 of file DownloadWithSources.cpp.

References GetFirstSource(), CDownloadSource::m_bPushOnly, NULL, PROTOCOL_G1, PROTOCOL_HTTP, Replace(), and TimeToString().

Referenced by CDownload::OnMoved(), CUploadTransferHTTP::RequestPartialFile(), and CDownloadTransferHTTP::SendRequest().

BOOL CDownloadWithSources::OnQueryHits CQueryHit pHits  )  [virtual]
 

Definition at line 551 of file DownloadWithSources.cpp.

References AddSourceHit(), CQueryHit::m_pNext, and CQueryHit::m_sURL.

Referenced by CDownloads::OnQueryHits().

void CDownloadWithSources::RemoveOverlappingSources QWORD  nOffset,
QWORD  nLength
[protected]
 

Definition at line 564 of file DownloadWithSources.cpp.

References GetFirstSource(), IDS_DOWNLOAD_VERIFY_DROP, CDownloadBase::m_sRemoteName, CShareazaApp::Message(), MSG_ERROR, and theApp.

Referenced by CDownloadWithTiger::FinishValidation().

void CDownloadWithSources::RemoveSource CDownloadSource pSource,
BOOL  bBan
[protected]
 

Definition at line 586 of file DownloadWithSources.cpp.

References m_nSourceCount, m_pFailedSources, CDownloadSource::m_pNext, CDownloadSource::m_pPrev, m_pSourceFirst, m_pSourceLast, NULL, and CDownloadBase::SetModified().

Referenced by CDownloadSource::OnFailure(), and CDownloadSource::Remove().

void CDownloadWithSources::Serialize CArchive &  ar,
int  nVersion
[virtual]
 

Reimplemented from CDownloadBase.

Reimplemented in CDownload, CDownloadWithExtras, CDownloadWithFile, CDownloadWithTiger, and CDownloadWithTorrent.

Definition at line 759 of file DownloadWithSources.cpp.

References CDownloadSource, GetFirstSource(), GetSourceCount(), CDownloadSource::m_nPort, m_nSourceCount, CDownloadSource::m_pAddress, CDownloadSource::m_pNext, CDownloadSource::m_pPrev, m_pSourceFirst, m_pSourceLast, m_pXML, CDownloadSource::m_sURL, NULL, CDownloadSource::Serialize(), and CDownloadBase::Serialize().

Referenced by CDownloadWithFile::Serialize().

void CDownloadWithSources::SortSource CDownloadSource pSource  )  [protected]
 

Definition at line 663 of file DownloadWithSources.cpp.

References CDownloadSource::m_nSortOrder, m_nSourceCount, CDownloadSource::m_pNext, CDownloadSource::m_pPrev, m_pSourceFirst, m_pSourceLast, and NULL.

void CDownloadWithSources::SortSource CDownloadSource pSource,
BOOL  bTop
[protected]
 

Definition at line 613 of file DownloadWithSources.cpp.

References m_nSourceCount, CDownloadSource::m_pNext, CDownloadSource::m_pPrev, m_pSourceFirst, m_pSourceLast, and NULL.

Referenced by CDownloadTransfer::SetState().


Friends And Related Function Documentation

friend class CDownloadSource [friend]
 

Definition at line 84 of file DownloadWithSources.h.

Referenced by AddSourceBT(), AddSourceED2K(), AddSourceHit(), AddSourceURL(), CDownloadWithTorrent::CreateTorrentTransfer(), Serialize(), and CDownload::SerializeOld().

friend class CDownloadTransfer [friend]
 

Reimplemented in CDownload, CDownloadWithFile, and CDownloadWithTransfers.

Definition at line 85 of file DownloadWithSources.h.


Member Data Documentation

int CDownloadWithSources::m_nSourceCount [protected]
 

Definition at line 45 of file DownloadWithSources.h.

Referenced by AddSourceInternal(), CDownloadWithSources(), ClearSources(), GetSourceCount(), CDownload::OnRun(), RemoveSource(), Serialize(), and SortSource().

CStringList CDownloadWithSources::m_pFailedSources
 

Definition at line 47 of file DownloadWithSources.h.

Referenced by AddSourceURL(), and RemoveSource().

CDownloadSource* CDownloadWithSources::m_pSourceFirst [protected]
 

Definition at line 43 of file DownloadWithSources.h.

Referenced by AddSourceInternal(), CDownloadWithSources(), CheckSource(), ClearSources(), GetBTSourceCount(), GetED2KCompleteSourceCount(), GetFirstSource(), GetSourceCount(), RemoveSource(), Serialize(), SortSource(), and CDownloadWithTransfers::StartNewTransfer().

CDownloadSource* CDownloadWithSources::m_pSourceLast [protected]
 

Definition at line 44 of file DownloadWithSources.h.

Referenced by AddSourceInternal(), CDownloadWithSources(), ClearSources(), RemoveSource(), Serialize(), and SortSource().

CXMLElement* CDownloadWithSources::m_pXML
 

Definition at line 48 of file DownloadWithSources.h.

Referenced by AddSourceHit(), CDownloadWithFile::AppendMetadata(), CDownloadWithSources(), CDownload::OnMoved(), CDownloadTransferHTTP::ReadMetadata(), CUploadTransferHTTP::RequestPartialFile(), Serialize(), CDownload::SerializeOld(), CDownloadTransferHTTP::StartNextFragment(), CDownloadWithFile::WriteMetadata(), and ~CDownloadWithSources().


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