cite.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  *
4  *
5  * Copyright (C) 2011 by Dimitri van Heesch
6  * Based on a patch by David Munger
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation under the terms of the GNU General Public License is hereby
10  * granted. No representations are made about the suitability of this software
11  * for any purpose. It is provided "as is" without express or implied warranty.
12  * See the GNU General Public License for more details.
13  *
14  * Documents produced by Doxygen are derivative works derived from the
15  * input used in their production; they are not affected by this license.
16  *
17  */
18 
19 #ifndef CITEDB_H
20 #define CITEDB_H
21 
22 #include <qdict.h>
23 
24 class FTextStream;
25 
26 /// String constants for citations
27 struct CiteConsts
28 {
29  static const QCString fileName;
30  static const QCString anchorPrefix;
31 };
32 
33 /// Citation-related data.
34 struct CiteInfo
35 {
36  CiteInfo(const char *label_, const char *text_=0, const char *fullText_=0,
37  const char *ref_=0) :
38  label(label_), text(text_), fullText(fullText_), ref(ref_)
39  { }
40 
41  CiteInfo(const CiteInfo &o)
42  { label=o.label.copy(); text=o.text.copy(); fullText=o.fullText.copy(); ref=o.ref.copy(); }
43 
48 
49 };
50 
51 /**
52  * @brief Cite database access class.
53  * @details This class provides access do the database of bibliographic
54  * references through the bibtex backend.
55  */
56 class CiteDict
57 {
58  public:
59  /** Create the database, with an expected maximum of \a size entries */
60  CiteDict(int size);
61 
62 // /** Resolve references to citations */
63 // void resolve();
64 
65  /** Insert a citation identified by \a label into the database */
66  void insert(const char *label);
67 
68  /** Return the citation info for a given \a label */
69  CiteInfo *find(const char *label) const;
70 
71  /** Generate the citations page */
72  void generatePage() const;
73 
74  /** clears the database */
75  void clear();
76 
77  /** return TRUE if there are no citations.
78  * Only valid after calling resolve()
79  */
80  bool isEmpty() const;
81 
82  /** writes the latex code for the standard bibliography
83  * section to text stream \a t
84  */
85  void writeLatexBibliography(FTextStream &t);
86 
87  private:
88 // bool writeAux();
89 // bool writeBst();
90 // bool execute();
91 // void parse();
92 // void clean();
93  QDict<CiteInfo> m_entries;
94 // QList<QCString> m_ordering;
96 };
97 
98 #endif
CiteInfo(const char *label_, const char *text_=0, const char *fullText_=0, const char *ref_=0)
Definition: cite.h:36
QCString label
Definition: cite.h:44
QDict< CiteInfo > m_entries
Definition: cite.h:93
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
CiteInfo(const CiteInfo &o)
Definition: cite.h:41
QCString copy() const
Definition: qcstring.h:250
QCString m_baseFileName
Definition: cite.h:95
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
Citation-related data.
Definition: cite.h:34
QCString fullText
Definition: cite.h:46
String constants for citations.
Definition: cite.h:27
QCString ref
Definition: cite.h:47
static const QCString anchorPrefix
Definition: cite.h:30
Cite database access class.
Definition: cite.h:56
static const QCString fileName
Definition: cite.h:29
QCString text
Definition: cite.h:45
vector< vector< double > > clear