CbmRoot
Loading...
Searching...
No Matches
CbmQaReportHeader.h
Go to the documentation of this file.
1/* Copyright (C) 2024 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Sergei Zharko [committer] */
4
9
10#pragma once
11
12#include "CbmQaReportEngine.h"
13
14#include <string>
15#include <string_view>
16
17namespace cbm::qa::report
18{
21 class Header {
22 public:
24 virtual ~Header() = default;
25
27 void AddTag(std::string_view tag) { fvsTags.emplace_back(tag); }
28
31 std::string GetBody(const Engine& engine) const { return engine.HeaderBody(*this); }
32
34 const std::string& GetAuthor() const { return fsAuthor; }
35
37 const std::string& GetPageHeader() const { return fsPageHeader; }
38
40 const std::string& GetSetup() const { return fsSetup; }
41
43 const std::string& GetSubtitle() const { return fsSubtitle; }
44
46 const std::vector<std::string>& GetTags() const { return fvsTags; }
47
49 const std::string& GetTitle() const { return fsTitle; }
50
52 void SetAuthor(std::string_view author) { fsAuthor = author; }
53
55 void SetPageHeader(std::string_view pageHeader) { fsPageHeader = pageHeader; }
56
58 void SetSetup(std::string_view setup) { fsSetup = setup; }
59
61 void SetSubtitle(std::string_view subtitle) { fsSubtitle = subtitle; }
62
64 void SetTitle(std::string_view title) { fsTitle = title; }
65
66 private:
67 std::vector<std::string> fvsTags{};
68
69 std::string fsAuthor = "";
70 std::string fsSetup = "";
71 std::string fsSubtitle = "";
72 std::string fsTitle = "";
73 std::string fsPageHeader = "";
74 };
75} // namespace cbm::qa::report
A base abstract class to provide an interface for element body (a visitor in the Visitor pattern)
virtual std::string HeaderBody(const Header &header) const =0
Creates a body for header.
Header of the report.
void SetSetup(std::string_view setup)
Sets setup.
void SetSubtitle(std::string_view subtitle)
Sets subtitle.
const std::vector< std::string > & GetTags() const
Gets tags.
virtual ~Header()=default
Destructor.
const std::string & GetPageHeader() const
Gets page header.
const std::string & GetTitle() const
Gets title.
std::vector< std::string > fvsTags
Different Tags.
const std::string & GetSubtitle() const
Gets subtitle.
std::string fsPageHeader
Placed on top/bottom of the page.
void SetAuthor(std::string_view author)
Sets author.
std::string GetBody(const Engine &engine) const
Gets body of the element.
const std::string & GetSetup() const
Gets setup.
void AddTag(std::string_view tag)
Add tag.
void SetPageHeader(std::string_view pageHeader)
Sets page header.
const std::string & GetAuthor() const
Gets author.
void SetTitle(std::string_view title)
Sets title.