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

CLibraryMaps Class Reference

#include <LibraryMaps.h>

Inheritance diagram for CLibraryMaps:

CComObject List of all members.

Public Member Functions

 CLibraryMaps ()
virtual ~CLibraryMaps ()
POSITION GetFileIterator () const
CLibraryFileGetNextFile (POSITION &pos) const
int GetFileCount () const
void GetStatistics (DWORD *pnFiles, QWORD *pnVolume)
CLibraryFileLookupFile (DWORD nIndex, BOOL bSharedOnly=FALSE, BOOL bAvailableOnly=FALSE)
CLibraryFileLookupFileByName (LPCTSTR pszName, BOOL bSharedOnly=FALSE, BOOL bAvailableOnly=FALSE)
CLibraryFileLookupFileByPath (LPCTSTR pszPath, BOOL bSharedOnly=FALSE, BOOL bAvailableOnly=FALSE)
CLibraryFileLookupFileByURN (LPCTSTR pszURN, BOOL bSharedOnly=FALSE, BOOL bAvailableOnly=FALSE)
CLibraryFileLookupFileBySHA1 (const SHA1 *pSHA1, BOOL bSharedOnly=FALSE, BOOL bAvailableOnly=FALSE)
CLibraryFileLookupFileByTiger (const TIGEROOT *pTiger, BOOL bSharedOnly=FALSE, BOOL bAvailableOnly=FALSE)
CLibraryFileLookupFileByED2K (const MD4 *pED2K, BOOL bSharedOnly=FALSE, BOOL bAvailableOnly=FALSE)

Protected Member Functions

void Clear ()
DWORD AllocateIndex ()
void OnFileAdd (CLibraryFile *pFile)
void OnFileRemove (CLibraryFile *pFile)
void CullDeletedFiles (CLibraryFile *pMatch)
CPtrList * Search (CQuerySearch *pSearch, int nMaximum, BOOL bLocal)
void Serialize1 (CArchive &ar, int nVersion)
void Serialize2 (CArchive &ar, int nVersion)

Protected Attributes

CMapPtrToPtr m_pIndexMap
CMapStringToOb m_pNameMap
CMapStringToOb m_pPathMap
CLibraryFile ** m_pSHA1Map
CLibraryFile ** m_pTigerMap
CLibraryFile ** m_pED2KMap
CPtrList m_pDeleted
DWORD m_nNextIndex
DWORD m_nFiles
QWORD m_nVolume
STDMETHOD( get_Application )(IApplication FAR *FAR *ppApplication)
STDMETHOD( get_Library )(ILibrary FAR *FAR *ppLibrary)
STDMETHOD( get__NewEnum )(IUnknown FAR *FAR *ppEnum)
STDMETHOD( get_Item )(VARIANT vIndex, ILibraryFile FAR *FAR *ppFile)
STDMETHOD( get_Count )(LONG FAR *pnCount)

Friends

class CLibrary
class CLibraryBuilder
class CLibraryFile

Constructor & Destructor Documentation

CLibraryMaps::CLibraryMaps  ) 
 

Definition at line 51 of file LibraryMaps.cpp.

References HASH_SIZE.

CLibraryMaps::~CLibraryMaps  )  [virtual]
 

Definition at line 68 of file LibraryMaps.cpp.

References m_pED2KMap, m_pSHA1Map, and m_pTigerMap.


Member Function Documentation

DWORD CLibraryMaps::AllocateIndex  )  [protected]
 

Definition at line 280 of file LibraryMaps.cpp.

References LookupFile(), and m_nNextIndex.

Referenced by OnFileAdd().

void CLibraryMaps::Clear  )  [protected]
 

Definition at line 261 of file LibraryMaps.cpp.

References GetFileIterator(), GetNextFile(), HASH_SIZE, m_nFiles, m_nVolume, m_pED2KMap, m_pIndexMap, m_pNameMap, m_pPathMap, m_pSHA1Map, and m_pTigerMap.

Referenced by CLibrary::Clear().

void CLibraryMaps::CullDeletedFiles CLibraryFile pMatch  )  [protected]
 

Definition at line 446 of file LibraryMaps.cpp.

References CLibraryFile::Delete, CLibraryFile::IsAvailable(), Library, LookupFileByED2K(), LookupFileBySHA1(), LookupFileByTiger(), and CLibrary::m_pSection.

Referenced by CLibraryBuilder::HashFile().

int CLibraryMaps::GetFileCount  )  const
 

Definition at line 91 of file LibraryMaps.cpp.

References m_pIndexMap.

Referenced by CHashProgressBar::Run().

POSITION CLibraryMaps::GetFileIterator  )  const
 

Definition at line 78 of file LibraryMaps.cpp.

References m_pIndexMap.

Referenced by CLibraryDictionary::BuildHashTable(), Clear(), CLibraryFolders::CreateAlbumTree(), Search(), CEDNeighbour::SendSharedFiles(), CAlbumFolder::SetCollection(), CLibraryThumbView::Update(), CLibraryDetailView::Update(), and CLibraryAlbumView::Update().

CLibraryFile * CLibraryMaps::GetNextFile POSITION &  pos  )  const
 

Definition at line 83 of file LibraryMaps.cpp.

References m_pIndexMap, and NULL.

Referenced by CLibraryDictionary::BuildHashTable(), Clear(), CLibraryFolders::CreateAlbumTree(), Search(), CEDNeighbour::SendSharedFiles(), CAlbumFolder::SetCollection(), CLibraryThumbView::Update(), CLibraryDetailView::Update(), and CLibraryAlbumView::Update().

void CLibraryMaps::GetStatistics DWORD *  pnFiles,
QWORD pnVolume
 

Definition at line 96 of file LibraryMaps.cpp.

References m_nFiles, and m_nVolume.

Referenced by CG1Neighbour::OnPing(), CFolderTipCtrl::OnPrepare(), CG2Neighbour::SendLNI(), CLibraryHeaderPanel::Update(), CHomeLibraryBox::Update(), and CMainWnd::UpdateMessages().

CLibraryFile * CLibraryMaps::LookupFile DWORD  nIndex,
BOOL  bSharedOnly = FALSE,
BOOL  bAvailableOnly = FALSE
 

Definition at line 105 of file LibraryMaps.cpp.

References Library, m_pIndexMap, CLibrary::m_pSection, and NULL.

Referenced by AllocateIndex(), CLibrary::LookupFile(), OnFileAdd(), OnFileRemove(), and CLibraryDictionary::Search().

CLibraryFile * CLibraryMaps::LookupFileByED2K const MD4 pED2K,
BOOL  bSharedOnly = FALSE,
BOOL  bAvailableOnly = FALSE
 

Definition at line 234 of file LibraryMaps.cpp.

References HASH_MASK, CLibraryFile::IsAvailable(), CLibraryFile::IsShared(), Library, CLibraryFile::m_pED2K, m_pED2KMap, CLibraryFile::m_pNextED2K, CLibrary::m_pSection, and NULL.

Referenced by CMatchFile::Add(), CBaseMatchWnd::CheckExisting(), CDeleteFileDlg::Create(), CullDeletedFiles(), CCollectionFile::File::IsComplete(), CMatchTipCtrl::LoadFromFile(), LookupFileByURN(), CTorrentSeedDlg::OnDownload(), CEDClient::OnFileRequest(), CEDClient::OnFileStatusRequest(), CEDClient::OnHashsetRequest(), CURLActionDlg::OnUrlDownload(), and CUploadTransferED2K::Request().

CLibraryFile * CLibraryMaps::LookupFileByName LPCTSTR  pszName,
BOOL  bSharedOnly = FALSE,
BOOL  bAvailableOnly = FALSE
 

Definition at line 124 of file LibraryMaps.cpp.

References Library, m_pNameMap, CLibrary::m_pSection, and NULL.

Referenced by OnFileRemove(), and CUploadTransferHTTP::OnHeadersComplete().

CLibraryFile * CLibraryMaps::LookupFileByPath LPCTSTR  pszPath,
BOOL  bSharedOnly = FALSE,
BOOL  bAvailableOnly = FALSE
 

Definition at line 141 of file LibraryMaps.cpp.

References Library, m_pPathMap, CLibrary::m_pSection, and NULL.

Referenced by CMediaListCtrl::Add(), CLibraryWnd::OnCollection(), CDownloadsWnd::OnDownloadsFileDelete(), CDownloadsWnd::OnDownloadsRate(), OnFileRemove(), CUploadTransferED2K::OpenFile(), CMediaFrame::OpenFile(), and CUploadTransferHTTP::OpenFileSendHeaders().

CLibraryFile * CLibraryMaps::LookupFileBySHA1 const SHA1 pSHA1,
BOOL  bSharedOnly = FALSE,
BOOL  bAvailableOnly = FALSE
 

Definition at line 186 of file LibraryMaps.cpp.

References HASH_MASK, CLibraryFile::IsAvailable(), CLibraryFile::IsShared(), Library, CLibraryFile::m_pNextSHA1, CLibrary::m_pSection, CLibraryFile::m_pSHA1, m_pSHA1Map, and NULL.

Referenced by CMatchFile::Add(), CAlbumFolder::AddFile(), CLibraryCollectionView::CheckAvailable(), CBaseMatchWnd::CheckExisting(), CDeleteFileDlg::Create(), CullDeletedFiles(), CTorrentSeedDlg::FindFile(), CAlbumFolder::GetCollection(), CCollectionFile::File::IsComplete(), CMatchTipCtrl::LoadFromFile(), LookupFileByURN(), CTorrentSeedDlg::OnDownload(), CURLActionDlg::OnUrlDownload(), Search(), CAlbumFolder::Serialize(), and CLibraryCollectionView::Update().

CLibraryFile * CLibraryMaps::LookupFileByTiger const TIGEROOT pTiger,
BOOL  bSharedOnly = FALSE,
BOOL  bAvailableOnly = FALSE
 

Definition at line 210 of file LibraryMaps.cpp.

References HASH_MASK, CLibraryFile::IsAvailable(), CLibraryFile::IsShared(), Library, CLibraryFile::m_pNextTiger, CLibrary::m_pSection, CLibraryFile::m_pTiger, m_pTigerMap, and NULL.

Referenced by CMatchFile::Add(), CBaseMatchWnd::CheckExisting(), CDeleteFileDlg::Create(), CullDeletedFiles(), CCollectionFile::File::IsComplete(), CMatchTipCtrl::LoadFromFile(), LookupFileByURN(), and Search().

CLibraryFile * CLibraryMaps::LookupFileByURN LPCTSTR  pszURN,
BOOL  bSharedOnly = FALSE,
BOOL  bAvailableOnly = FALSE
 

Definition at line 158 of file LibraryMaps.cpp.

References CED2K::HashFromURN(), CTigerNode::HashFromURN(), CSHA::HashFromURN(), LookupFileByED2K(), LookupFileBySHA1(), LookupFileByTiger(), NULL, and pTiger.

Referenced by CUploadTransferHTTP::OnHeadersComplete().

void CLibraryMaps::OnFileAdd CLibraryFile pFile  )  [protected]
 

Definition at line 289 of file LibraryMaps.cpp.

References AllocateIndex(), HASH_MASK, LookupFile(), m_nFiles, m_nVolume, m_pDeleted, m_pED2KMap, m_pIndexMap, m_pNameMap, CLibraryFile::m_pNextED2K, CLibraryFile::m_pNextSHA1, CLibraryFile::m_pNextTiger, m_pPathMap, m_pSHA1Map, m_pTigerMap, and NULL.

Referenced by CLibrary::AddFile().

void CLibraryMaps::OnFileRemove CLibraryFile pFile  )  [protected]
 

Definition at line 359 of file LibraryMaps.cpp.

References HASH_MASK, LookupFile(), LookupFileByName(), LookupFileByPath(), m_nFiles, m_nVolume, m_pDeleted, m_pED2KMap, CLibraryFile::m_pFolder, m_pIndexMap, m_pNameMap, CLibraryFile::m_pNextED2K, CLibraryFile::m_pNextSHA1, CLibraryFile::m_pNextTiger, m_pPathMap, m_pSHA1Map, m_pTigerMap, and NULL.

Referenced by CLibrary::RemoveFile().

CPtrList * CLibraryMaps::Search CQuerySearch pSearch,
int  nMaximum,
BOOL  bLocal
[protected]
 

Definition at line 481 of file LibraryMaps.cpp.

References GetFileIterator(), GetNextFile(), CLibraryFile::IsAvailable(), CLibraryFile::IsShared(), LookupFileBySHA1(), LookupFileByTiger(), CLibraryFile::m_bED2K, CQuerySearch::m_bED2K, CQuerySearch::m_bSHA1, CLibraryFile::m_bSHA1, CQuerySearch::m_bTiger, CQuerySearch::m_pED2K, CLibraryFile::m_pED2K, CQuerySearch::m_pSHA1, CQuerySearch::m_pTiger, and NULL.

Referenced by CLibrary::Search().

void CLibraryMaps::Serialize1 CArchive &  ar,
int  nVersion
[protected]
 

Definition at line 558 of file LibraryMaps.cpp.

References m_nNextIndex.

Referenced by CLibrary::Serialize().

void CLibraryMaps::Serialize2 CArchive &  ar,
int  nVersion
[protected]
 

Definition at line 570 of file LibraryMaps.cpp.

References CLibraryFile, m_pDeleted, NULL, and CLibraryFile::Serialize().

Referenced by CLibrary::Serialize().


Friends And Related Function Documentation

friend class CLibrary [friend]
 

Definition at line 89 of file LibraryMaps.h.

friend class CLibraryBuilder [friend]
 

Definition at line 90 of file LibraryMaps.h.

friend class CLibraryFile [friend]
 

Definition at line 91 of file LibraryMaps.h.

Referenced by Serialize2().


Member Data Documentation

STDMETHOD( CLibraryMaps::get__NewEnum)(IUnknown FAR *FAR *ppEnum) [protected]
 

STDMETHOD( CLibraryMaps::get_Application)(IApplication FAR *FAR *ppApplication) [protected]
 

STDMETHOD( CLibraryMaps::get_Count)(LONG FAR *pnCount) [protected]
 

STDMETHOD( CLibraryMaps::get_Item)(VARIANT vIndex, ILibraryFile FAR *FAR *ppFile) [protected]
 

STDMETHOD( CLibraryMaps::get_Library)(ILibrary FAR *FAR *ppLibrary) [protected]
 

DWORD CLibraryMaps::m_nFiles [protected]
 

Definition at line 49 of file LibraryMaps.h.

Referenced by Clear(), GetStatistics(), OnFileAdd(), and OnFileRemove().

DWORD CLibraryMaps::m_nNextIndex [protected]
 

Definition at line 48 of file LibraryMaps.h.

Referenced by AllocateIndex(), and Serialize1().

QWORD CLibraryMaps::m_nVolume [protected]
 

Definition at line 50 of file LibraryMaps.h.

Referenced by Clear(), GetStatistics(), OnFileAdd(), and OnFileRemove().

CPtrList CLibraryMaps::m_pDeleted [protected]
 

Definition at line 46 of file LibraryMaps.h.

Referenced by OnFileAdd(), OnFileRemove(), and Serialize2().

CLibraryFile** CLibraryMaps::m_pED2KMap [protected]
 

Definition at line 45 of file LibraryMaps.h.

Referenced by Clear(), LookupFileByED2K(), OnFileAdd(), OnFileRemove(), and ~CLibraryMaps().

CMapPtrToPtr CLibraryMaps::m_pIndexMap [protected]
 

Definition at line 40 of file LibraryMaps.h.

Referenced by Clear(), GetFileCount(), GetFileIterator(), GetNextFile(), LookupFile(), OnFileAdd(), and OnFileRemove().

CMapStringToOb CLibraryMaps::m_pNameMap [protected]
 

Definition at line 41 of file LibraryMaps.h.

Referenced by Clear(), LookupFileByName(), OnFileAdd(), and OnFileRemove().

CMapStringToOb CLibraryMaps::m_pPathMap [protected]
 

Definition at line 42 of file LibraryMaps.h.

Referenced by Clear(), LookupFileByPath(), OnFileAdd(), and OnFileRemove().

CLibraryFile** CLibraryMaps::m_pSHA1Map [protected]
 

Definition at line 43 of file LibraryMaps.h.

Referenced by Clear(), LookupFileBySHA1(), OnFileAdd(), OnFileRemove(), and ~CLibraryMaps().

CLibraryFile** CLibraryMaps::m_pTigerMap [protected]
 

Definition at line 44 of file LibraryMaps.h.

Referenced by Clear(), LookupFileByTiger(), OnFileAdd(), OnFileRemove(), and ~CLibraryMaps().


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