Doxygen
Loading...
Searching...
No Matches
cite.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 2020 by Dimitri van Heesch
4 * Based on a patch by David Munger
5 *
6 * Permission to use, copy, modify, and distribute this software and its
7 * documentation under the terms of the GNU General Public License is hereby
8 * granted. No representations are made about the suitability of this software
9 * for any purpose. It is provided "as is" without express or implied warranty.
10 * See the GNU General Public License for more details.
11 *
12 * Documents produced by Doxygen are derivative works derived from the
13 * input used in their production; they are not affected by this license.
14 *
15 */
16
17#ifndef CITE_H
18#define CITE_H
19
20#include <memory>
21
22#include "qcstring.h"
23#include "construct.h"
24
25/// Citation-related data.
27{
28 ABSTRACT_BASE_CLASS(CiteInfo)
29
30 virtual QCString label() const = 0;
31 virtual QCString text() const = 0;
32};
33
34/**
35 * @brief Citation manager class.
36 * @details This class provides access do the database of bibliographic
37 * references through the bibtex backend.
38 */
39class CitationManager
40{
41 public:
42 static CitationManager &instance();
43
44 /** Insert a citation identified by \a label into the database */
45 void insert(const QCString &label);
46
47 /** Return the citation info for a given \a label.
48 * Ownership of the info stays with the manager.
49 */
50 const CiteInfo *find(const QCString &label) const;
51
52 /** Generate the citations page */
53 void generatePage();
54
55 /** clears the database */
56 void clear();
57
58 /** return TRUE if there are no citations.
59 */
60 bool isEmpty() const;
61
62 /** lists the bibtex cite files in a comma separated list
63 */
64 QCString latexBibFiles();
65
66 QCString fileName() const;
67 QCString anchorPrefix() const;
68
69 private:
70 /** Create the database, with an expected maximum of \a size entries */
71 CitationManager();
72 ~CitationManager() = default;
73 NON_COPYABLE(CitationManager)
74 void insertCrossReferencesForBibFile(const QCString &bibFile);
75 QCString getFormulas(const QCString &s);
76 QCString replaceFormulas(const QCString &s);
77 struct Private;
78 std::unique_ptr<Private> p;
79};
80
81#endif // CITE_H
~CitationManager()=default
#define NON_COPYABLE(cls)
Macro to help implementing the rule of 5 for a non-copyable & movable class.
Definition construct.h:37
#define ABSTRACT_BASE_CLASS(cls)
Macro to implement rule of 5 for an abstract base class.
Definition construct.h:20
Citation-related data.
Definition cite.h:27
virtual QCString text() const =0
virtual QCString label() const =0
@ Private
Definition types.h:26