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{
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 */
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 */
65
66 QCString fileName() const;
67 QCString anchorPrefix() const;
68
69 private:
70 /** Create the database, with an expected maximum of \a size entries */
72 ~CitationManager() = default;
74 void insertCrossReferencesForBibFile(const QCString &bibFile);
77 struct Private;
78 std::unique_ptr<Private> p;
79};
80
81#endif // CITE_H
void insertCrossReferencesForBibFile(const QCString &bibFile)
Definition cite.cpp:127
QCString anchorPrefix() const
Definition cite.cpp:122
std::unique_ptr< Private > p
Definition cite.h:78
const CiteInfo * find(const QCString &label) const
Return the citation info for a given label.
Definition cite.cpp:96
QCString latexBibFiles()
lists the bibtex cite files in a comma separated list
Definition cite.cpp:559
static CitationManager & instance()
Definition cite.cpp:80
void clear()
clears the database
Definition cite.cpp:106
QCString replaceFormulas(const QCString &s)
Definition cite.cpp:307
~CitationManager()=default
void insert(const QCString &label)
Insert a citation identified by label into the database.
Definition cite.cpp:90
CitationManager()
Create the database, with an expected maximum of size entries.
Definition cite.cpp:86
QCString fileName() const
Definition cite.cpp:117
bool isEmpty() const
return TRUE if there are no citations.
Definition cite.cpp:111
void generatePage()
Generate the citations page.
Definition cite.cpp:327
QCString getFormulas(const QCString &s)
Definition cite.cpp:232
This is an alternative implementation of QCString.
Definition qcstring.h:101
#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