MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / OutputRulesSummary

Function OutputRulesSummary

src/tw/textdbviewer.cpp:348–404  ·  view source on GitHub ↗

The rules summary is not working due to changes in the databasse infrastructure. Until we hear different from the product manager, it is out of here.

Source from the content-addressed store, hash-verified

346// The rules summary is not working due to changes in the databasse infrastructure. Until
347// we hear different from the product manager, it is out of here.
348static void OutputRulesSummary(const cFCODatabaseFileIter& genreIter, const iFCONameTranslator* pNT, TOSTREAM* pOut )
349{
350 const cHierDatabase& db = genreIter.GetDb();
351
352 // these should add up to 79
353 const int nameWidth = 50;
354 const int numObjectsWidth = 10;
355
356 (*pOut) << g_sz79Dashes << endl;
357 (*pOut) << TSS_GetString( cTW, tw::STR_RULE_SUMMARY ) << endl;
358 (*pOut) << g_sz79Dashes << endl << endl;
359
360 (*pOut).width(nameWidth);
361 (*pOut) << TSS_GetString( cTW, tw::STR_RULE_NAME );
362 (*pOut).width(numObjectsWidth);
363 (*pOut) << TSS_GetString( cTW, tw::STR_OBJECTS ) << endl;
364
365 (*pOut) << setw( nameWidth ) << _T("---------");
366 (*pOut) << setw( numObjectsWidth ) << _T("-------");
367 (*pOut) << endl;
368
369 // output spec stats
370 cFCOSpecListCanonicalIter specIter( genreIter.GetSpecList() );
371
372 // iterate over all database elements
373 int nTotalObjects = 0;
374 for( specIter.SeekBegin(); !specIter.Done(); specIter.Next() )
375 {
376 (*pOut) << setw( nameWidth ) << specIter.Spec()->GetName();
377
378 // if the name is too long, put it on its own line
379 if( specIter.Spec()->GetName().length() >= nameWidth )
380 {
381 (*pOut) << endl;
382
383 // output space holder
384 (*pOut).width(nameWidth);
385 (*pOut) << _T("");
386 }
387
388 (*pOut).width(numObjectsWidth);
389 (*pOut) << _T("TODO");
390 //(*pOut) << specIter.GetFCOSet()->Size(); TODO: Do this right
391 (*pOut) << endl;
392 }
393
394 (*pOut) << endl;
395
396 // NOTE 4 Jan 99 mdb -- this used to use dbHeader.GetTotalObjectsScanned() but it was not always consistent with the
397 // total number of objects in the database. TODO -- if we are really not going to use this number, then we should
398 // not store it in the database at all.
399 //
400 (*pOut) << TSS_GetString( cTW, tw::STR_TOTAL_NUM_FILES );
401 //(*pOut) << _T(" ") << nTotalObjects << endl;
402 (*pOut) << _T("TODO") << endl;
403 (*pOut) << endl;
404}
405#endif

Callers 2

OutputTextReportMethod · 0.85
OutputRulesSummaryMethod · 0.85

Calls 6

SpecMethod · 0.80
SeekBeginMethod · 0.45
DoneMethod · 0.45
NextMethod · 0.45
GetNameMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected