00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
00034 public:
00035 CShareazaURL();
00036 CShareazaURL(CBTInfo* pTorrent);
00037 virtual ~CShareazaURL();
00038
00039
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
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
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_)