00001 // 00002 // UploadFile.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_UPLOADFILE_H__D2D194F0_8528_482F_A4DA_DE1D9C496335__INCLUDED_) 00023 #define AFX_UPLOADFILE_H__D2D194F0_8528_482F_A4DA_DE1D9C496335__INCLUDED_ 00024 00025 #pragma once 00026 00027 #include "FileFragments.hpp" 00028 class CUploadTransfer; 00029 00030 class CUploadFile 00031 { 00032 // Construction 00033 public: 00034 CUploadFile(CUploadTransfer* pUpload, SHA1* pSHA1, LPCTSTR pszName, LPCTSTR pszPath, QWORD nSize); 00035 virtual ~CUploadFile(); 00036 00037 // Attributes 00038 public: 00039 IN_ADDR m_pAddress; 00040 BOOL m_bSHA1; 00041 SHA1 m_pSHA1; 00042 CString m_sName; 00043 CString m_sPath; 00044 QWORD m_nSize; 00045 public: 00046 DWORD m_nRequests; 00047 FF::SimpleFragmentList m_oFragments; 00048 public: 00049 BOOL m_bSelected; 00050 protected: 00051 CPtrList m_pTransfers; 00052 00053 // Operations 00054 public: 00055 void Add(CUploadTransfer* pUpload); 00056 BOOL Remove(CUploadTransfer* pUpload); 00057 CUploadTransfer* GetActive() const; 00058 public: 00059 void AddFragment(QWORD nOffset, QWORD nLength); 00060 void Remove(); 00061 00062 // Inlines 00063 public: 00064 inline BOOL IsEmpty() const 00065 { 00066 return m_pTransfers.GetCount() == 0; 00067 } 00068 00069 }; 00070 00071 #endif // !defined(AFX_UPLOADFILE_H__D2D194F0_8528_482F_A4DA_DE1D9C496335__INCLUDED_)