Doxygen
cite.h
浏览该文件的文档.
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 
24 /// Citation-related data.
25 struct CiteInfo
26 {
27  virtual ~CiteInfo() {}
28  virtual QCString label() const = 0;
29  virtual QCString text() const = 0;
30 };
31 
32 /**
33  * @brief Citation manager class.
34  * @details This class provides access do the database of bibliographic
35  * references through the bibtex backend.
36  */
38 {
39  public:
40  static CitationManager &instance();
41 
42  /** Insert a citation identified by \a label into the database */
43  void insert(const QCString &label);
44 
45  /** Return the citation info for a given \a label.
46  * Ownership of the info stays with the manager.
47  */
48  const CiteInfo *find(const QCString &label) const;
49 
50  /** Generate the citations page */
51  void generatePage();
52 
53  /** clears the database */
54  void clear();
55 
56  /** return TRUE if there are no citations.
57  */
58  bool isEmpty() const;
59 
60  /** lists the bibtex cite files in a comma separated list
61  */
63 
64  QCString fileName() const;
65  QCString anchorPrefix() const;
66 
67  private:
68  /** Create the database, with an expected maximum of \a size entries */
70  void insertCrossReferencesForBibFile(const QCString &bibFile);
71  struct Private;
72  std::unique_ptr<Private> p;
73 };
74 
75 #endif // CITE_H
CitationManager::find
const CiteInfo * find(const QCString &label) const
Return the citation info for a given label.
Definition: cite.cpp:75
CitationManager::clear
void clear()
clears the database
Definition: cite.cpp:85
CitationManager::instance
static CitationManager & instance()
Definition: cite.cpp:56
qcstring.h
CitationManager::latexBibFiles
QCString latexBibFiles()
lists the bibtex cite files in a comma separated list
Definition: cite.cpp:384
CitationManager::p
std::unique_ptr< Private > p
Definition: cite.h:71
CitationManager::CitationManager
CitationManager()
Create the database, with an expected maximum of size entries
Definition: cite.cpp:62
CitationManager
Citation manager class.
Definition: cite.h:37
CiteInfo::label
virtual QCString label() const =0
CitationManager::insert
void insert(const QCString &label)
Insert a citation identified by label into the database
Definition: cite.cpp:66
CitationManager::isEmpty
bool isEmpty() const
return TRUE if there are no citations.
Definition: cite.cpp:90
CitationManager::generatePage
void generatePage()
Generate the citations page
Definition: cite.cpp:192
CitationManager::Private
Definition: cite.cpp:51
CiteInfo
Citation-related data.
Definition: cite.h:25
CitationManager::insertCrossReferencesForBibFile
void insertCrossReferencesForBibFile(const QCString &bibFile)
Definition: cite.cpp:106
CitationManager::fileName
QCString fileName() const
Definition: cite.cpp:96
CiteInfo::text
virtual QCString text() const =0
CiteInfo::~CiteInfo
virtual ~CiteInfo()
Definition: cite.h:41
CitationManager::anchorPrefix
QCString anchorPrefix() const
Definition: cite.cpp:101
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108