source: cheroxy/trunk/include/CRXFilter.h@ 28

Last change on this file since 28 was 28, checked in by cheese, 11 years ago

#1 add filter class

File size: 1.1 KB
Line 
1/**
2 * CRXFilter.h
3 */
4
5#ifndef __CRXFILTER_H__
6#define __CRXFILTER_H__
7
8#include "CRXHttpRequest.h"
9#include "CRXHttpResponse.h"
10
11#include <string>
12#include <list>
13
14#define FILTER_DELIMITER '|'
15
16#define CRX_FILTER_MATCHED true
17#define CRX_FILTER_NOT_MATCHED false
18
19typedef enum
20{
21 CRX_FILTER_REQUEST_FILE_EXTENSION = 1
22} E_CRX_FILTER_REQUEST;
23
24class CRXFilter
25{
26private:
27 typedef struct __crx_filter__ {
28 E_CRX_FILTER_REQUEST mFilterType;
29 bool mIsMatched;
30 std::string mValue;
31 } S_CRX_FILTER;
32
33 typedef std::list<S_CRX_FILTER> CRXFilter_t;
34
35 CRXFilter_t mRequestFilterList;
36 CRXFilter_t mResponseFilterList;
37
38public:
39 CRXFilter (void);
40 ~CRXFilter (void);
41
42public:
43 void SetRequestFilter (const E_CRX_FILTER_REQUEST aType,
44 const bool aIsMatched,
45 const std::string aValue);
46
47 void RemoveRequestFilter (const E_CRX_FILTER_REQUEST aType);
48
49 bool CheckRequestFilter (const E_CRX_FILTER_REQUEST aType,
50 const CRXHttpRequest & aRequest);
51};
52
53#endif // #ifndef __CRXFILTER_H__
Note: See TracBrowser for help on using the repository browser.