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

Function GetEmailRecipients

src/tripwire/twcmdlineutil.cpp:465–499  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// GetEmailRecipients - produce a list of all email addresses referred to in the report. ///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

463//
464////////////////////////////////////////////////////////////////////////////////
465static void
466GetEmailRecipients(std::vector<TSTRING>& vstrRecipients, const cFCOReport& report, const cTWModeCommon* modeCommon)
467{
468
469 // loop through all generes
470 cFCOReportGenreIter genreIter(report);
471 for (genreIter.SeekBegin(); !genreIter.Done(); genreIter.Next())
472 {
473
474 // loop through all specs
475 cFCOReportSpecIter specIter(report, genreIter.GetGenre());
476
477 for (specIter.SeekBegin(); !specIter.Done(); specIter.Next())
478 {
479
480 // loop through all email addresses for this spec
481 cFCOSpecAttrEmailIter emailIter(*specIter.GetAttr());
482
483 for (emailIter.SeekBegin(); !emailIter.Done(); emailIter.Next())
484 {
485
486 TSTRING address = emailIter.EmailAddress();
487 std::vector<TSTRING>::iterator i;
488
489 // see if the address is already in the list
490 i = std::find(vstrRecipients.begin(), vstrRecipients.end(), address);
491
492 if (i == vstrRecipients.end())
493 {
494 vstrRecipients.push_back(address);
495 }
496 }
497 }
498 }
499}
500
501
502static void GetGlobalEmailRecipients(std::vector<TSTRING>& vstrRecipients,

Callers 1

EmailReportMethod · 0.85

Calls 7

GetAttrMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
SeekBeginMethod · 0.45
DoneMethod · 0.45
NextMethod · 0.45
GetGenreMethod · 0.45

Tested by

no test coverage detected