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

QuerySearch.h

Go to the documentation of this file.
00001 //
00002 // QuerySearch.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_QUERYSEARCH_H__2141B926_3F6B_4A5D_9FBD_C67FD0A5C46C__INCLUDED_)
00023 #define AFX_QUERYSEARCH_H__2141B926_3F6B_4A5D_9FBD_C67FD0A5C46C__INCLUDED_
00024 
00025 #pragma once
00026 
00027 class CPacket;
00028 class CSchema;
00029 class CXMLElement;
00030 class CSearchWnd;
00031 class CG1Packet;
00032 class CG2Packet;
00033 class CEDPacket;
00034 
00035 
00036 class CQuerySearch
00037 {
00038 // Construction
00039 public:
00040         CQuerySearch(BOOL bGUID = TRUE);
00041         CQuerySearch(CQuerySearch* pCopy);
00042         virtual ~CQuerySearch();
00043 
00044 // Attributes
00045 public:
00046         GGUID                   m_pGUID;
00047 public:
00048         CString                 m_sSearch;
00049         CSchema*                m_pSchema;
00050         CXMLElement*    m_pXML;
00051         QWORD                   m_nMinSize;
00052         QWORD                   m_nMaxSize;
00053 public:
00054         BOOL                    m_bSHA1;
00055         SHA1                    m_pSHA1;
00056         BOOL                    m_bTiger;
00057         TIGEROOT                m_pTiger;
00058         BOOL                    m_bED2K;
00059         MD4                             m_pED2K;
00060         BOOL                    m_bBTH;
00061         SHA1                    m_pBTH;
00062 public:
00063         BOOL                    m_bSimilarSearch;
00064         MD4                             m_pSimilarED2K;
00065 public:
00066         BOOL                    m_bWantURL;
00067         BOOL                    m_bWantDN;
00068         BOOL                    m_bWantXML;
00069         BOOL                    m_bWantCOM;
00070         BOOL                    m_bWantPFS;
00071         BOOL                    m_bAndG1;
00072 public:
00073         BOOL                    m_bUDP;
00074         SOCKADDR_IN             m_pEndpoint;
00075         DWORD                   m_nKey;
00076         BOOL                    m_bFirewall;
00077 public:
00078         DWORD                   m_nWords;
00079         LPCTSTR*                m_pWordPtr;
00080         DWORD*                  m_pWordLen;
00081 
00082 // Packet Operations
00083 public:
00084         CG1Packet*                              ToG1Packet();
00085         CG2Packet*                              ToG2Packet(SOCKADDR_IN* pUDP, DWORD nKey);
00086         CEDPacket*                              ToEDPacket(BOOL bUDP, DWORD nServerFlags = 0);
00087         static CQuerySearch*    FromPacket(CPacket* pPacket, SOCKADDR_IN* pEndpoint = NULL);
00088 protected:
00089         BOOL                                    ReadG1Packet(CPacket* pPacket);
00090         BOOL                                    ReadG2Packet(CG2Packet* pPacket, SOCKADDR_IN* pEndpoint = NULL);
00091 
00092 // Operations
00093 public:
00094         BOOL            Match(LPCTSTR pszFilename, QWORD nSize, LPCTSTR pszSchemaURI, CXMLElement* pXML, SHA1* pSHA1 = NULL, TIGEROOT* pTiger = NULL, MD4* pED2K = NULL);
00095         TRISTATE        MatchMetadata(LPCTSTR pszSchemaURI, CXMLElement* pXML);
00096         BOOL            MatchMetadataShallow(LPCTSTR pszSchemaURI, CXMLElement* pXML);
00097         void            BuildWordList();
00098         void            Serialize(CArchive& ar);
00099         CSearchWnd*     OpenWindow();
00100         BOOL            CheckValid();
00101 protected:
00102         void            AddStringToWordList(LPCTSTR pszString);
00103         BOOL            WriteHashesToEDPacket( CEDPacket* pPacket, BOOL bUDP );
00104 
00105 // Utilities
00106 public:
00107         static BOOL     WordMatch(LPCTSTR pszString, LPCTSTR pszFind);
00108         static BOOL     NumberMatch(const CString& strValue, const CString& strRange);
00109 
00110 };
00111 
00112 #endif // !defined(AFX_QUERYSEARCH_H__2141B926_3F6B_4A5D_9FBD_C67FD0A5C46C__INCLUDED_)

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