16 |
16 |
17 a { color: #BA6D36; } |
17 a { color: #BA6D36; } |
18 |
18 |
19 </style> |
19 </style> |
20 </head> |
20 </head> |
21 <body><a NAME="top" ID="top"></a> |
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
22 <h1>eric6.WebBrowser.AdBlock.AdBlockSearchTree</h1> |
23 <h1>eric6.WebBrowser.AdBlock.AdBlockSearchTree</h1> |
|
24 |
23 <p> |
25 <p> |
24 Module implementing the AdBlock search tree. |
26 Module implementing the AdBlock search tree. |
25 </p> |
27 </p> |
26 <h3>Global Attributes</h3> |
28 <h3>Global Attributes</h3> |
|
29 |
27 <table> |
30 <table> |
28 <tr><td>None</td></tr> |
31 <tr><td>None</td></tr> |
29 </table> |
32 </table> |
30 <h3>Classes</h3> |
33 <h3>Classes</h3> |
31 <table> |
34 |
|
35 <table> |
|
36 |
32 <tr> |
37 <tr> |
33 <td><a href="#AdBlockSearchTree">AdBlockSearchTree</a></td> |
38 <td><a href="#AdBlockSearchTree">AdBlockSearchTree</a></td> |
34 <td>Class implementing the AdBlock search tree.</td> |
39 <td>Class implementing the AdBlock search tree.</td> |
35 </tr><tr> |
40 </tr> |
|
41 <tr> |
36 <td><a href="#AdBlockSearchTreeNode">AdBlockSearchTreeNode</a></td> |
42 <td><a href="#AdBlockSearchTreeNode">AdBlockSearchTreeNode</a></td> |
37 <td>Class implementing the AdBlock search tree node.</td> |
43 <td>Class implementing the AdBlock search tree node.</td> |
38 </tr> |
44 </tr> |
39 </table> |
45 </table> |
40 <h3>Functions</h3> |
46 <h3>Functions</h3> |
41 <table> |
47 |
42 <tr><td>None</td></tr> |
48 <table> |
43 </table> |
49 <tr><td>None</td></tr> |
44 <hr /><hr /> |
50 </table> |
|
51 <hr /> |
|
52 <hr /> |
45 <a NAME="AdBlockSearchTree" ID="AdBlockSearchTree"></a> |
53 <a NAME="AdBlockSearchTree" ID="AdBlockSearchTree"></a> |
46 <h2>AdBlockSearchTree</h2> |
54 <h2>AdBlockSearchTree</h2> |
|
55 |
47 <p> |
56 <p> |
48 Class implementing the AdBlock search tree. |
57 Class implementing the AdBlock search tree. |
49 </p> |
58 </p> |
50 <h3>Derived from</h3> |
59 <h3>Derived from</h3> |
51 object |
60 object |
52 <h3>Class Attributes</h3> |
61 <h3>Class Attributes</h3> |
|
62 |
53 <table> |
63 <table> |
54 <tr><td>None</td></tr> |
64 <tr><td>None</td></tr> |
55 </table> |
65 </table> |
56 <h3>Class Methods</h3> |
66 <h3>Class Methods</h3> |
|
67 |
57 <table> |
68 <table> |
58 <tr><td>None</td></tr> |
69 <tr><td>None</td></tr> |
59 </table> |
70 </table> |
60 <h3>Methods</h3> |
71 <h3>Methods</h3> |
61 <table> |
72 |
|
73 <table> |
|
74 |
62 <tr> |
75 <tr> |
63 <td><a href="#AdBlockSearchTree.__init__">AdBlockSearchTree</a></td> |
76 <td><a href="#AdBlockSearchTree.__init__">AdBlockSearchTree</a></td> |
64 <td>Constructor</td> |
77 <td>Constructor</td> |
65 </tr><tr> |
78 </tr> |
|
79 <tr> |
66 <td><a href="#AdBlockSearchTree.__deleteNode">__deleteNode</a></td> |
80 <td><a href="#AdBlockSearchTree.__deleteNode">__deleteNode</a></td> |
67 <td>Private method to delete a search tree node.</td> |
81 <td>Private method to delete a search tree node.</td> |
68 </tr><tr> |
82 </tr> |
|
83 <tr> |
69 <td><a href="#AdBlockSearchTree.__prefixSearch">__prefixSearch</a></td> |
84 <td><a href="#AdBlockSearchTree.__prefixSearch">__prefixSearch</a></td> |
70 <td>Private method to perform a prefix search.</td> |
85 <td>Private method to perform a prefix search.</td> |
71 </tr><tr> |
86 </tr> |
|
87 <tr> |
72 <td><a href="#AdBlockSearchTree.add">add</a></td> |
88 <td><a href="#AdBlockSearchTree.add">add</a></td> |
73 <td>Public method to add a rule to the search tree.</td> |
89 <td>Public method to add a rule to the search tree.</td> |
74 </tr><tr> |
90 </tr> |
|
91 <tr> |
75 <td><a href="#AdBlockSearchTree.clear">clear</a></td> |
92 <td><a href="#AdBlockSearchTree.clear">clear</a></td> |
76 <td>Public method to clear the search tree.</td> |
93 <td>Public method to clear the search tree.</td> |
77 </tr><tr> |
94 </tr> |
|
95 <tr> |
78 <td><a href="#AdBlockSearchTree.find">find</a></td> |
96 <td><a href="#AdBlockSearchTree.find">find</a></td> |
79 <td>Public method to find a matching rule.</td> |
97 <td>Public method to find a matching rule.</td> |
80 </tr> |
98 </tr> |
81 </table> |
99 </table> |
82 <h3>Static Methods</h3> |
100 <h3>Static Methods</h3> |
83 <table> |
101 |
84 <tr><td>None</td></tr> |
102 <table> |
85 </table> |
103 <tr><td>None</td></tr> |
|
104 </table> |
|
105 |
86 <a NAME="AdBlockSearchTree.__init__" ID="AdBlockSearchTree.__init__"></a> |
106 <a NAME="AdBlockSearchTree.__init__" ID="AdBlockSearchTree.__init__"></a> |
87 <h4>AdBlockSearchTree (Constructor)</h4> |
107 <h4>AdBlockSearchTree (Constructor)</h4> |
88 <b>AdBlockSearchTree</b>(<i></i>) |
108 <b>AdBlockSearchTree</b>(<i></i>) |
|
109 |
89 <p> |
110 <p> |
90 Constructor |
111 Constructor |
91 </p><a NAME="AdBlockSearchTree.__deleteNode" ID="AdBlockSearchTree.__deleteNode"></a> |
112 </p> |
|
113 <a NAME="AdBlockSearchTree.__deleteNode" ID="AdBlockSearchTree.__deleteNode"></a> |
92 <h4>AdBlockSearchTree.__deleteNode</h4> |
114 <h4>AdBlockSearchTree.__deleteNode</h4> |
93 <b>__deleteNode</b>(<i>node</i>) |
115 <b>__deleteNode</b>(<i>node</i>) |
|
116 |
94 <p> |
117 <p> |
95 Private method to delete a search tree node. |
118 Private method to delete a search tree node. |
96 </p><dl> |
119 </p> |
|
120 <dl> |
|
121 |
97 <dt><i>node</i> (AdBlockSearchTreeNode)</dt> |
122 <dt><i>node</i> (AdBlockSearchTreeNode)</dt> |
98 <dd> |
123 <dd> |
99 reference to the node to be deleted |
124 reference to the node to be deleted |
100 </dd> |
125 </dd> |
101 </dl><a NAME="AdBlockSearchTree.__prefixSearch" ID="AdBlockSearchTree.__prefixSearch"></a> |
126 </dl> |
|
127 <a NAME="AdBlockSearchTree.__prefixSearch" ID="AdBlockSearchTree.__prefixSearch"></a> |
102 <h4>AdBlockSearchTree.__prefixSearch</h4> |
128 <h4>AdBlockSearchTree.__prefixSearch</h4> |
103 <b>__prefixSearch</b>(<i>request, domain, urlString, string, length</i>) |
129 <b>__prefixSearch</b>(<i>request, domain, urlString, string, length</i>) |
|
130 |
104 <p> |
131 <p> |
105 Private method to perform a prefix search. |
132 Private method to perform a prefix search. |
106 </p><dl> |
133 </p> |
|
134 <dl> |
|
135 |
107 <dt><i>request</i> (QWebEngineUrlRequestInfo)</dt> |
136 <dt><i>request</i> (QWebEngineUrlRequestInfo)</dt> |
108 <dd> |
137 <dd> |
109 URL request to be matched |
138 URL request to be matched |
110 </dd><dt><i>domain</i> (str)</dt> |
139 </dd> |
|
140 <dt><i>domain</i> (str)</dt> |
111 <dd> |
141 <dd> |
112 domain of the URL |
142 domain of the URL |
113 </dd><dt><i>urlString</i> (str)</dt> |
143 </dd> |
|
144 <dt><i>urlString</i> (str)</dt> |
114 <dd> |
145 <dd> |
115 requested URL as a lowercase string |
146 requested URL as a lowercase string |
116 </dd><dt><i>string</i> (str)</dt> |
147 </dd> |
|
148 <dt><i>string</i> (str)</dt> |
117 <dd> |
149 <dd> |
118 prefix string to search for |
150 prefix string to search for |
119 </dd><dt><i>length</i> (int)</dt> |
151 </dd> |
|
152 <dt><i>length</i> (int)</dt> |
120 <dd> |
153 <dd> |
121 length to be considered |
154 length to be considered |
122 </dd> |
155 </dd> |
123 </dl><dl> |
156 </dl> |
|
157 <dl> |
124 <dt>Returns:</dt> |
158 <dt>Returns:</dt> |
125 <dd> |
159 <dd> |
126 reference to the matched rule |
160 reference to the matched rule |
127 </dd> |
161 </dd> |
128 </dl><dl> |
162 </dl> |
|
163 <dl> |
129 <dt>Return Type:</dt> |
164 <dt>Return Type:</dt> |
130 <dd> |
165 <dd> |
131 AdBlockRule |
166 AdBlockRule |
132 </dd> |
167 </dd> |
133 </dl><a NAME="AdBlockSearchTree.add" ID="AdBlockSearchTree.add"></a> |
168 </dl> |
|
169 <a NAME="AdBlockSearchTree.add" ID="AdBlockSearchTree.add"></a> |
134 <h4>AdBlockSearchTree.add</h4> |
170 <h4>AdBlockSearchTree.add</h4> |
135 <b>add</b>(<i>rule</i>) |
171 <b>add</b>(<i>rule</i>) |
|
172 |
136 <p> |
173 <p> |
137 Public method to add a rule to the search tree. |
174 Public method to add a rule to the search tree. |
138 </p><dl> |
175 </p> |
|
176 <dl> |
|
177 |
139 <dt><i>rule</i> (AdBlockRule)</dt> |
178 <dt><i>rule</i> (AdBlockRule)</dt> |
140 <dd> |
179 <dd> |
141 rule to be added |
180 rule to be added |
142 </dd> |
181 </dd> |
143 </dl><dl> |
182 </dl> |
|
183 <dl> |
144 <dt>Returns:</dt> |
184 <dt>Returns:</dt> |
145 <dd> |
185 <dd> |
146 flag indicating a successful addition |
186 flag indicating a successful addition |
147 </dd> |
187 </dd> |
148 </dl><dl> |
188 </dl> |
|
189 <dl> |
149 <dt>Return Type:</dt> |
190 <dt>Return Type:</dt> |
150 <dd> |
191 <dd> |
151 bool |
192 bool |
152 </dd> |
193 </dd> |
153 </dl><a NAME="AdBlockSearchTree.clear" ID="AdBlockSearchTree.clear"></a> |
194 </dl> |
|
195 <a NAME="AdBlockSearchTree.clear" ID="AdBlockSearchTree.clear"></a> |
154 <h4>AdBlockSearchTree.clear</h4> |
196 <h4>AdBlockSearchTree.clear</h4> |
155 <b>clear</b>(<i></i>) |
197 <b>clear</b>(<i></i>) |
|
198 |
156 <p> |
199 <p> |
157 Public method to clear the search tree. |
200 Public method to clear the search tree. |
158 </p><a NAME="AdBlockSearchTree.find" ID="AdBlockSearchTree.find"></a> |
201 </p> |
|
202 <a NAME="AdBlockSearchTree.find" ID="AdBlockSearchTree.find"></a> |
159 <h4>AdBlockSearchTree.find</h4> |
203 <h4>AdBlockSearchTree.find</h4> |
160 <b>find</b>(<i>request, domain, urlString</i>) |
204 <b>find</b>(<i>request, domain, urlString</i>) |
|
205 |
161 <p> |
206 <p> |
162 Public method to find a matching rule. |
207 Public method to find a matching rule. |
163 </p><dl> |
208 </p> |
|
209 <dl> |
|
210 |
164 <dt><i>request</i> (QWebEngineUrlRequestInfo)</dt> |
211 <dt><i>request</i> (QWebEngineUrlRequestInfo)</dt> |
165 <dd> |
212 <dd> |
166 URL request to be matched |
213 URL request to be matched |
167 </dd><dt><i>domain</i> (str)</dt> |
214 </dd> |
|
215 <dt><i>domain</i> (str)</dt> |
168 <dd> |
216 <dd> |
169 domain of the URL |
217 domain of the URL |
170 </dd><dt><i>urlString</i> (str)</dt> |
218 </dd> |
|
219 <dt><i>urlString</i> (str)</dt> |
171 <dd> |
220 <dd> |
172 requested URL as a lowercase string |
221 requested URL as a lowercase string |
173 </dd> |
222 </dd> |
174 </dl><dl> |
223 </dl> |
|
224 <dl> |
175 <dt>Returns:</dt> |
225 <dt>Returns:</dt> |
176 <dd> |
226 <dd> |
177 reference to the matched rule |
227 reference to the matched rule |
178 </dd> |
228 </dd> |
179 </dl><dl> |
229 </dl> |
|
230 <dl> |
180 <dt>Return Type:</dt> |
231 <dt>Return Type:</dt> |
181 <dd> |
232 <dd> |
182 AdBlockRule |
233 AdBlockRule |
183 </dd> |
234 </dd> |
184 </dl> |
235 </dl> |
185 <div align="right"><a href="#top">Up</a></div> |
236 <div align="right"><a href="#top">Up</a></div> |
186 <hr /><hr /> |
237 <hr /> |
|
238 <hr /> |
187 <a NAME="AdBlockSearchTreeNode" ID="AdBlockSearchTreeNode"></a> |
239 <a NAME="AdBlockSearchTreeNode" ID="AdBlockSearchTreeNode"></a> |
188 <h2>AdBlockSearchTreeNode</h2> |
240 <h2>AdBlockSearchTreeNode</h2> |
|
241 |
189 <p> |
242 <p> |
190 Class implementing the AdBlock search tree node. |
243 Class implementing the AdBlock search tree node. |
191 </p> |
244 </p> |
192 <h3>Derived from</h3> |
245 <h3>Derived from</h3> |
193 object |
246 object |
194 <h3>Class Attributes</h3> |
247 <h3>Class Attributes</h3> |
|
248 |
195 <table> |
249 <table> |
196 <tr><td>None</td></tr> |
250 <tr><td>None</td></tr> |
197 </table> |
251 </table> |
198 <h3>Class Methods</h3> |
252 <h3>Class Methods</h3> |
|
253 |
199 <table> |
254 <table> |
200 <tr><td>None</td></tr> |
255 <tr><td>None</td></tr> |
201 </table> |
256 </table> |
202 <h3>Methods</h3> |
257 <h3>Methods</h3> |
203 <table> |
258 |
|
259 <table> |
|
260 |
204 <tr> |
261 <tr> |
205 <td><a href="#AdBlockSearchTreeNode.__init__">AdBlockSearchTreeNode</a></td> |
262 <td><a href="#AdBlockSearchTreeNode.__init__">AdBlockSearchTreeNode</a></td> |
206 <td>Constructor</td> |
263 <td>Constructor</td> |
207 </tr> |
264 </tr> |
208 </table> |
265 </table> |
209 <h3>Static Methods</h3> |
266 <h3>Static Methods</h3> |
210 <table> |
267 |
211 <tr><td>None</td></tr> |
268 <table> |
212 </table> |
269 <tr><td>None</td></tr> |
|
270 </table> |
|
271 |
213 <a NAME="AdBlockSearchTreeNode.__init__" ID="AdBlockSearchTreeNode.__init__"></a> |
272 <a NAME="AdBlockSearchTreeNode.__init__" ID="AdBlockSearchTreeNode.__init__"></a> |
214 <h4>AdBlockSearchTreeNode (Constructor)</h4> |
273 <h4>AdBlockSearchTreeNode (Constructor)</h4> |
215 <b>AdBlockSearchTreeNode</b>(<i></i>) |
274 <b>AdBlockSearchTreeNode</b>(<i></i>) |
|
275 |
216 <p> |
276 <p> |
217 Constructor |
277 Constructor |
218 </p> |
278 </p> |
219 <div align="right"><a href="#top">Up</a></div> |
279 <div align="right"><a href="#top">Up</a></div> |
220 <hr /> |
280 <hr /> |