MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / FillSection

Method FillSection

Exporter/Html/TemplateHtmlExporter.cpp:221–250  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

219
220 //-------------------------------------------------------------------------
221 void TemplateHtmlExporter::FillSection(
222 ctemplate::TemplateDictionary& sectionDictionary,
223 bool isSimpleText,
224 const fs::path* link,
225 const cov::CoverageRate& coverageRate,
226 const fs::path& originalFilename)
227 {
228 if (link)
229 {
230 auto htmlPath = ToHtmlPath(*link);
231 sectionDictionary.SetValueAndShowSection(
232 LinkTemplate,
233 htmlPath,
234 ItemLinkSection);
235 }
236 else
237 {
238 sectionDictionary.ShowSection(isSimpleText ? ItemSimpleText
239 : ItemNoLinkSection);
240 }
241
242 sectionDictionary.SetIntValue(CoverRateTemplate, coverageRate.GetPercentRate());
243 sectionDictionary.SetIntValue(UncoverRateTemplate, 100 - coverageRate.GetPercentRate());
244 sectionDictionary.SetIntValue(ExecutedLineTemplate, coverageRate.GetExecutedLinesCount());
245 sectionDictionary.SetIntValue(UnExecutedLineTemplate, coverageRate.GetUnExecutedLinesCount());
246 sectionDictionary.SetIntValue(TotalLineTemplate, coverageRate.GetTotalLinesCount());
247 sectionDictionary.SetValue(IdTemplate, GetUuid());
248 auto name = ToString(originalFilename.wstring());
249 sectionDictionary.SetValue(NameTemplate, name);
250 }
251}

Callers

nothing calls this directly

Calls 6

ToHtmlPathFunction · 0.85
GetPercentRateMethod · 0.80
GetExecutedLinesCountMethod · 0.80
GetTotalLinesCountMethod · 0.80
ToStringFunction · 0.70

Tested by

no test coverage detected