CbmRoot
Loading...
Searching...
No Matches
cbm::qa::report::Builder Class Reference

Report builder. More...

#include <CbmQaReportBuilder.h>

Collaboration diagram for cbm::qa::report::Builder:
[legend]

Public Member Functions

 Builder (std::string_view title, fs::path outPath)
 Constructor.
 
virtual ~Builder ()=default
 Destructor.
 
void AddSection (std::shared_ptr< Section > pSection)
 Adds section.
 
std::shared_ptr< HeaderGetHeader ()
 Gets header.
 
std::shared_ptr< TailGetTail ()
 Gets tail.
 
void CreateScript (Engine &engine, bool bCompile=true)
 Saves script.
 
std::string PathInSource (fs::path path) const
 Converts path of the object in the code to one in the document source.
 
std::string AbsFigurePath (fs::path relPath) const
 Returns absolute path to the figure.
 
std::string SaveCanvas (const TCanvas *canv, const std::string &relPath) const
 Saves canvas.
 
void SetFigureExtention (std::string_view figExtention)
 Sets figure extention.
 

Private Attributes

std::vector< std::shared_ptr< Section > > fvpSections
 List of report sections.
 
std::string fsFigureExtention = "pdf"
 Figure extention.
 
fs::path fScriptsPath
 Scripts path.
 
fs::path fFiguresPath
 Figures path.
 
std::shared_ptr< HeaderfpHeader = nullptr
 Header of the report.
 
std::shared_ptr< TailfpTail = nullptr
 Tail of the report.
 

Static Private Attributes

static constexpr std::string_view ksSourceName = "source"
 Name of source.
 

Detailed Description

Report builder.

Definition at line 24 of file CbmQaReportBuilder.h.

Constructor & Destructor Documentation

◆ Builder()

Builder::Builder ( std::string_view title,
fs::path outPath )

Constructor.

Parameters
titleReport title
outPathOutput path

Definition at line 29 of file CbmQaReportBuilder.cxx.

References fFiguresPath, fpHeader, and fScriptsPath.

◆ ~Builder()

virtual cbm::qa::report::Builder::~Builder ( )
virtualdefault

Destructor.

Member Function Documentation

◆ AbsFigurePath()

std::string cbm::qa::report::Builder::AbsFigurePath ( fs::path relPath) const
inline

Returns absolute path to the figure.

Parameters
relPathRelative path to the figure

Definition at line 54 of file CbmQaReportBuilder.h.

References fFiguresPath.

Referenced by SaveCanvas().

◆ AddSection()

void cbm::qa::report::Builder::AddSection ( std::shared_ptr< Section > pSection)
inline

Adds section.

Definition at line 35 of file CbmQaReportBuilder.h.

References fvpSections.

◆ CreateScript()

void Builder::CreateScript ( Engine & engine,
bool bCompile = true )

Saves script.

Parameters
engineEngine of the document
bCompileFlag: true - script will be compiled, if the compilation rule is defined by engine

Definition at line 45 of file CbmQaReportBuilder.cxx.

References cbm::qa::report::Engine::Compile(), fpHeader, fpTail, fScriptsPath, fvpSections, ksSourceName, cbm::qa::report::Engine::MyName(), and cbm::qa::report::Engine::ScriptExtention().

◆ GetHeader()

std::shared_ptr< Header > cbm::qa::report::Builder::GetHeader ( )
inline

Gets header.

Definition at line 38 of file CbmQaReportBuilder.h.

References fpHeader.

◆ GetTail()

std::shared_ptr< Tail > cbm::qa::report::Builder::GetTail ( )
inline

Gets tail.

Definition at line 41 of file CbmQaReportBuilder.h.

References fpTail.

◆ PathInSource()

std::string cbm::qa::report::Builder::PathInSource ( fs::path path) const
inline

Converts path of the object in the code to one in the document source.

Parameters
pathPath to the object

Definition at line 50 of file CbmQaReportBuilder.h.

References fScriptsPath.

Referenced by SaveCanvas().

◆ SaveCanvas()

std::string Builder::SaveCanvas ( const TCanvas * canv,
const std::string & relPath ) const

Saves canvas.

Parameters
canvPointer to canvas
relPathRelative path to the canvas image
Returns
Path to canvas in source
Note
Creates the directory, if it does not exist

Definition at line 66 of file CbmQaReportBuilder.cxx.

References AbsFigurePath(), fsFigureExtention, and PathInSource().

◆ SetFigureExtention()

void cbm::qa::report::Builder::SetFigureExtention ( std::string_view figExtention)
inline

Sets figure extention.

Definition at line 64 of file CbmQaReportBuilder.h.

References fsFigureExtention.

Member Data Documentation

◆ fFiguresPath

fs::path cbm::qa::report::Builder::fFiguresPath
private

Figures path.

Definition at line 72 of file CbmQaReportBuilder.h.

Referenced by AbsFigurePath(), and Builder().

◆ fpHeader

std::shared_ptr<Header> cbm::qa::report::Builder::fpHeader = nullptr
private

Header of the report.

Definition at line 73 of file CbmQaReportBuilder.h.

Referenced by Builder(), CreateScript(), and GetHeader().

◆ fpTail

std::shared_ptr<Tail> cbm::qa::report::Builder::fpTail = nullptr
private

Tail of the report.

Definition at line 74 of file CbmQaReportBuilder.h.

Referenced by CreateScript(), and GetTail().

◆ fScriptsPath

fs::path cbm::qa::report::Builder::fScriptsPath
private

Scripts path.

Definition at line 71 of file CbmQaReportBuilder.h.

Referenced by Builder(), CreateScript(), and PathInSource().

◆ fsFigureExtention

std::string cbm::qa::report::Builder::fsFigureExtention = "pdf"
private

Figure extention.

Definition at line 70 of file CbmQaReportBuilder.h.

Referenced by SaveCanvas(), and SetFigureExtention().

◆ fvpSections

std::vector<std::shared_ptr<Section> > cbm::qa::report::Builder::fvpSections
private

List of report sections.

Definition at line 69 of file CbmQaReportBuilder.h.

Referenced by AddSection(), and CreateScript().

◆ ksSourceName

std::string_view cbm::qa::report::Builder::ksSourceName = "source"
staticconstexprprivate

Name of source.

Definition at line 67 of file CbmQaReportBuilder.h.

Referenced by CreateScript().


The documentation for this class was generated from the following files: