MCPcopy Create free account
hub / github.com/MaxBelkov/visualsyslog / Load

Method Load

source/messmatch.cpp:284–332  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

282}
283//---------------------------------------------------------------------------
284void TMessMatch::Load(XMLElementEx * p)
285{
286 if( p->exist("prioritymask") )
287 {
288 bNot = p->rb("not", false);
289 PriorityMask = p->ri("prioritymask", 0);
290 FacilityMask = p->ri("facilitymask", 0);
291 }
292 else
293 {
294 // convert from legacy format
295 int OperationP; // 0 =, 1 <= (to emerg), 2 >= (to debug)
296 int Priority; // 0-7: syslog const LOG_, -1: any Priority (match all)
297
298 OperationP = p->ri("operationp", 0);
299 Priority = p->ri("priority", -1);
300 if( Priority==-1) // any Priority (match all)
301 {
302 PriorityMask = PriorityMaskAll;
303 }
304 else
305 {
306 PriorityMask = 0;
307 switch( OperationP )
308 {
309 case 0: // =
310 PriorityMask = 1<<Priority;
311 break;
312 case 1: // <= (to emerg)
313 for(int i=0; i<=Priority; i++)
314 PriorityMask |= 1<<Priority;
315 break;
316 case 2: // >= (to debug)
317 for(int i=Priority; i<LOG_NPRIORITIES; i++)
318 PriorityMask |= 1<<Priority;
319 break;
320 }
321 }
322 }
323 MatchCase = p->rb("matchcase", true);
324 Field1 = p->ri("field1", 0);
325 Contains1 = p->rb("contains1", true);
326 p->rs("text1", Text1);
327 Field2 = p->ri("field2", 0);
328 Contains2 = p->rb("contains2", true);
329 p->rs("text2", Text2);
330
331 DeleteEmptyLines();
332}
333//---------------------------------------------------------------------------
334static char * szFilter = "filter";
335

Callers

nothing calls this directly

Calls 7

ReportError2Function · 0.85
existMethod · 0.80
rbMethod · 0.80
riMethod · 0.80
rsMethod · 0.80
LoadFileMethod · 0.80
NameMethod · 0.80

Tested by

no test coverage detected