00001 // 00002 // UploadFiles.h 00003 // 00004 // Copyright (c) Shareaza Development Team, 2002-2005. 00005 // This file is part of SHAREAZA (www.shareaza.com) 00006 // 00007 // Shareaza is free software; you can redistribute it 00008 // and/or modify it under the terms of the GNU General Public License 00009 // as published by the Free Software Foundation; either version 2 of 00010 // the License, or (at your option) any later version. 00011 // 00012 // Shareaza is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with Shareaza; if not, write to the Free Software 00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 // 00021 00022 #if !defined(AFX_UPLOADFILES_H__0F70ABF7_91B7_436B_A235_C3D01DB0D7F6__INCLUDED_) 00023 #define AFX_UPLOADFILES_H__0F70ABF7_91B7_436B_A235_C3D01DB0D7F6__INCLUDED_ 00024 00025 #pragma once 00026 00027 class CUploadFile; 00028 class CUploadTransfer; 00029 00030 00031 class CUploadFiles 00032 { 00033 // Construction 00034 public: 00035 CUploadFiles(); 00036 virtual ~CUploadFiles(); 00037 00038 // Attributes 00039 protected: 00040 CPtrList m_pList; 00041 00042 // Operations 00043 public: 00044 void Clear(); 00045 CUploadFile* GetFile(CUploadTransfer* pUpload, SHA1* pSHA1, LPCTSTR pszName, LPCTSTR pszPath, QWORD nSize); 00046 void Remove(CUploadTransfer* pTransfer); 00047 void MoveToHead(CUploadTransfer* pTransfer); 00048 void MoveToTail(CUploadTransfer* pTransfer); 00049 00050 // List Access 00051 public: 00052 inline POSITION GetIterator() const 00053 { 00054 return m_pList.GetHeadPosition(); 00055 } 00056 00057 inline CUploadFile* GetNext(POSITION& pos) const 00058 { 00059 return (CUploadFile*)m_pList.GetNext( pos ); 00060 } 00061 00062 inline int GetCount() const 00063 { 00064 return m_pList.GetCount(); 00065 } 00066 00067 inline BOOL Check(CUploadFile* pFile) const 00068 { 00069 return m_pList.Find( pFile ) != NULL; 00070 } 00071 00072 }; 00073 00074 extern CUploadFiles UploadFiles; 00075 00076 #endif // !defined(AFX_UPLOADFILES_H__0F70ABF7_91B7_436B_A235_C3D01DB0D7F6__INCLUDED_)