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

ShareazaURL.h

Go to the documentation of this file.
00001 //
00002 // ShareazaURL.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_SHAREAZAURL_H__B39B7816_FE18_4843_A10A_C0DB32D96E52__INCLUDED_)
00023 #define AFX_SHAREAZAURL_H__B39B7816_FE18_4843_A10A_C0DB32D96E52__INCLUDED_
00024 
00025 #pragma once
00026 
00027 class CQuerySearch;
00028 class CBTInfo;
00029 
00030 
00031 class CShareazaURL
00032 {
00033 // Construction
00034 public:
00035         CShareazaURL();
00036         CShareazaURL(CBTInfo* pTorrent);
00037         virtual ~CShareazaURL();
00038 
00039 // Attributes
00040 public:
00041         int                     m_nAction;
00042 public:
00043         BOOL            m_bSHA1;
00044         SHA1            m_pSHA1;
00045         BOOL            m_bTiger;
00046         TIGEROOT        m_pTiger;
00047         BOOL            m_bMD5;
00048         MD5                     m_pMD5;
00049         BOOL            m_bED2K;
00050         MD4                     m_pED2K;
00051         BOOL            m_bBTH;
00052         SHA1            m_pBTH;
00053 public:
00054         CString         m_sName;
00055         BOOL            m_bSize;
00056         QWORD           m_nSize;
00057         int                     m_nPort;
00058         CString         m_sURL;
00059         CBTInfo*        m_pTorrent;
00060 
00061         enum
00062         {
00063                 uriNull, uriSource, uriDownload, uriSearch, uriHost, uriBrowse,
00064                 uriDonkeyServer, uriDiscovery
00065         };
00066 
00067 // Operations
00068 public:
00069         void                    Clear();
00070         BOOL                    Parse(LPCTSTR pszURL);
00071         CQuerySearch*   ToQuery();
00072 protected:
00073         BOOL    ParseMagnet(LPCTSTR pszURL);
00074         BOOL    ParseShareaza(LPCTSTR pszURL);
00075         BOOL    ParseShareazaHost(LPCTSTR pszURL, BOOL bBrowse = FALSE);
00076         BOOL    ParseShareazaFile(LPCTSTR pszURL);
00077         BOOL    ParseDonkey(LPCTSTR pszURL);
00078         BOOL    ParseDonkeyFile(LPCTSTR pszURL);
00079         BOOL    ParseDonkeyServer(LPCTSTR pszURL);
00080         BOOL    ParsePiolet(LPCTSTR pszURL);
00081         BOOL    ParsePioletFile(LPCTSTR pszURL);
00082         BOOL    ParseDiscovery(LPCTSTR pszURL, int nType);
00083 protected:
00084         void    SkipSlashes(LPCTSTR& pszURL, int nAdd = 0);
00085         void    SafeString(CString& strInput);
00086 
00087 // Registration Operations
00088 public:
00089         static void     Register(BOOL bOnStartup = FALSE);
00090         static BOOL     RegisterShellType(LPCTSTR pszProtocol, LPCTSTR pszName, LPCTSTR pszType, LPCTSTR pszApplication, LPCTSTR pszTopic, UINT nIDIcon, BOOL bOverwrite = TRUE);
00091         static BOOL     RegisterMagnetHandler(LPCTSTR pszID, LPCTSTR pszName, LPCTSTR pszDescription, LPCTSTR pszApplication, UINT nIDIcon);
00092         static BOOL     IsRegistered(LPCTSTR pszProtocol);
00093         static BOOL     UnregisterShellType(LPCTSTR pszProtocol);
00094         static void DeleteKey(HKEY hParent, LPCTSTR pszKey);
00095 
00096 };
00097 
00098 #endif // !defined(AFX_SHAREAZAURL_H__B39B7816_FE18_4843_A10A_C0DB32D96E52__INCLUDED_)

Generated on Thu Dec 15 10:39:49 2005 for Shareaza 2.2.1.0 by  doxygen 1.4.2