#include <AbstractGenerator.hpp>
Public Member Functions | |
AbstractGenerator (std::vector< BibElement > elements) | |
Public Member Functions inherited from Generator | |
virtual | ~Generator ()=default |
Static Public Member Functions | |
static auto | uniqueFieldsOf (const std::vector< BibElement > &values) noexcept -> std::unordered_set< std::string > |
static auto | sortedFields (const std::vector< Field > &set) noexcept -> std::vector< Field > |
Protected Member Functions | |
virtual auto | fail (const std::string &message, const std::string &type="unknown") -> void |
auto | write () -> std::string override |
Protected Attributes | |
std::vector< BibElement > | elements |
Elements to write. More... | |
Abstract Class with default-implementation of a File-Writer
Definition at line 14 of file AbstractGenerator.hpp.
|
explicit |
Constructor.
elements | the elements to write |
Definition at line 23 of file AbstractGenerator.cpp.
References elements.
|
protectedvirtual |
Helper Method to construct sufficient error-messages
message | the message to use |
FileWriterException | (always) |
Reimplemented in XmlGenerator, PlainTextGenerator, and HtmlGenerator.
Definition at line 12 of file AbstractGenerator.cpp.
Referenced by HtmlGenerator::fail(), PlainTextGenerator::fail(), and XmlGenerator::fail().
|
staticnoexcept |
Sorts a unordered vector of fields into a vector
set | the unordered vector of fields |
Definition at line 55 of file AbstractGenerator.cpp.
References Field::name.
|
staticnoexcept |
Definition at line 33 of file AbstractGenerator.cpp.
References BibElement::attributes.
Referenced by TEST_F().
|
overrideprotectedvirtual |
Default write-behaviour (do nothing)
Implements Generator.
Reimplemented in XmlGenerator, PlainTextGenerator, and HtmlGenerator.
Definition at line 29 of file AbstractGenerator.cpp.
|
protected |
Elements to write.
Definition at line 16 of file AbstractGenerator.hpp.
Referenced by AbstractGenerator(), HtmlGenerator::HtmlGenerator(), PlainTextGenerator::PlainTextGenerator(), and XmlGenerator::XmlGenerator().