25namespace fs = cbm::qa::report::fs;
31 , fpTail(
std::make_shared<
Tail>())
38 LOG(info) <<
"Initializing report builder for a document " << title <<
". The scripts path is "
48 LOG(info) <<
"\nCreating source script \"" << outName <<
"\" using " << engine.
MyName();
50 std::ofstream script(outName);
54 script << pSection->GetBody(engine);
56 script <<
fpTail->GetBody(engine);
69 LOG(fatal) <<
"cbm::qa::report::Builder::SaveCanvas(): a nullptr canvas is passed to the function. The provided "
70 <<
"relative path is \"" << relPath <<
"\"";
73 fs::create_directories(absPath.parent_path());
74 canv->SaveAs(absPath.string().c_str());
Base class for the report builder (implementation)
std::string fsFigureExtention
Figure extention.
void CreateScript(Engine &engine, bool bCompile=true)
Saves script.
std::string SaveCanvas(const TCanvas *canv, const std::string &relPath) const
Saves canvas.
std::string AbsFigurePath(fs::path relPath) const
Returns absolute path to the figure.
fs::path fFiguresPath
Figures path.
std::shared_ptr< Tail > fpTail
Tail of the report.
fs::path fScriptsPath
Scripts path.
static constexpr std::string_view ksSourceName
Name of source.
std::vector< std::shared_ptr< Section > > fvpSections
List of report sections.
std::shared_ptr< Header > fpHeader
Header of the report.
Builder(std::string_view title, fs::path outPath)
Constructor.
std::string PathInSource(fs::path path) const
Converts path of the object in the code to one in the document source.
A base abstract class to provide an interface for element body (a visitor in the Visitor pattern)
virtual std::string ScriptExtention() const =0
Returns script extention.
virtual void Compile(const std::string &) const
Defines the compilation rule (can be omitted)
virtual std::string MyName() const =0
Returns engine name.