btool
A parser/converter/transpiler for .bib files
BibElement.hpp
Go to the documentation of this file.
1 #ifndef BIBPARSER_BIBELEMENT_HPP
2 #define BIBPARSER_BIBELEMENT_HPP
3 
4 #include <StyleProperties.hpp>
5 #include <Field.hpp>
6 #include <optional>
7 #include <string>
8 #include <vector>
9 
14 struct BibElement {
15  std::string id;
16  std::string style;
17  std::vector<Field> attributes;
18 
19  [[nodiscard]] auto isCompliantTo(const StyleProperties &props) const -> bool;
20 
21  auto operator==(const BibElement &other) const noexcept -> bool;
22 
23  [[nodiscard]] auto findAttribute(const std::string &key) const noexcept -> std::optional<Field>;
24 };
25 
26 auto operator<<(std::ostream &os, BibElement const &elem) -> std::ostream &;
27 
28 #endif
BibElement::id
std::string id
the elements (unique) id
Definition: BibElement.hpp:15
StyleProperties
style-properties-container
Definition: StyleProperties.hpp:11
BibElement::operator==
auto operator==(const BibElement &other) const noexcept -> bool
Definition: BibElement.cpp:37
BibElement::attributes
std::vector< Field > attributes
the attributes of the element
Definition: BibElement.hpp:17
BibElement::isCompliantTo
auto isCompliantTo(const StyleProperties &props) const -> bool
Definition: BibElement.cpp:12
BibElement::findAttribute
auto findAttribute(const std::string &key) const noexcept -> std::optional< Field >
Definition: BibElement.cpp:46
Field.hpp
operator<<
auto operator<<(std::ostream &os, BibElement const &elem) -> std::ostream &
Definition: BibElement.cpp:65
StyleProperties.hpp
BibElement::style
std::string style
the style-name of the element
Definition: BibElement.hpp:16
BibElement
bib-element-Container
Definition: BibElement.hpp:14