Rev | Line | |
---|
[28] | 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 |
|
---|
| 19 | typedef enum
|
---|
| 20 | {
|
---|
| 21 | CRX_FILTER_REQUEST_FILE_EXTENSION = 1
|
---|
| 22 | } E_CRX_FILTER_REQUEST;
|
---|
| 23 |
|
---|
| 24 | class CRXFilter
|
---|
| 25 | {
|
---|
| 26 | private:
|
---|
| 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 |
|
---|
| 38 | public:
|
---|
| 39 | CRXFilter (void);
|
---|
| 40 | ~CRXFilter (void);
|
---|
| 41 |
|
---|
| 42 | public:
|
---|
| 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.