doxygen
entry.h
1 /******************************************************************************
2  *
3  *
4  *
5  * Copyright (C) 1997-2015 by Dimitri van Heesch.
6  *
7  * Permission to use, copy, modify, and distribute this software and its
8  * documentation under the terms of the GNU General Public License is hereby
9  * granted. No representations are made about the suitability of this software
10  * for any purpose. It is provided "as is" without express or implied warranty.
11  * See the GNU General Public License for more details.
12  *
13  * Documents produced by Doxygen are derivative works derived from the
14  * input used in their production; they are not affected by this license.
15  *
16  */
17 
18 #ifndef ENTRY_H
19 #define ENTRY_H
20 
21 #include "types.h"
22 
23 #include <qlist.h>
24 #include <qgstring.h>
25 
26 #include <vector>
27 #include <memory>
28 
29 struct SectionInfo;
30 class QFile;
31 class FileDef;
32 class FileStorage;
33 class StorageIntf;
34 class ArgumentList;
35 struct ListItemInfo;
36 
39 struct BaseInfo
40 {
42  BaseInfo(const char *n,Protection p,Specifier v) :
43  name(n),prot(p),virt(v) {}
47 };
48 
52 struct TagInfo
53 {
54  QCString tagName;
55  QCString fileName;
56  QCString anchor;
57 };
58 
65 class Entry
66 {
67  public:
68 
70  enum Sections {
71  CLASS_SEC = 0x00000001,
72  NAMESPACE_SEC = 0x00000010,
73  COMPOUND_MASK = CLASS_SEC,
74  SCOPE_MASK = COMPOUND_MASK | NAMESPACE_SEC,
75 
76  CLASSDOC_SEC = 0x00000800,
77  STRUCTDOC_SEC = 0x00001000,
78  UNIONDOC_SEC = 0x00002000,
79  EXCEPTIONDOC_SEC = 0x00004000,
80  NAMESPACEDOC_SEC = 0x00008000,
81  INTERFACEDOC_SEC = 0x00010000,
82  PROTOCOLDOC_SEC = 0x00020000,
83  CATEGORYDOC_SEC = 0x00040000,
84  SERVICEDOC_SEC = 0x00080000,
85  SINGLETONDOC_SEC = 0x00100000,
86  COMPOUNDDOC_MASK = CLASSDOC_SEC | STRUCTDOC_SEC | UNIONDOC_SEC |
87  INTERFACEDOC_SEC | EXCEPTIONDOC_SEC | PROTOCOLDOC_SEC |
88  CATEGORYDOC_SEC | SERVICEDOC_SEC | SINGLETONDOC_SEC,
89 
90  SOURCE_SEC = 0x00400000,
91  HEADER_SEC = 0x00800000,
92  FILE_MASK = SOURCE_SEC | HEADER_SEC,
93 
94  ENUMDOC_SEC = 0x01000000,
95  ENUM_SEC = 0x02000000,
96  EMPTY_SEC = 0x03000000,
97  PAGEDOC_SEC = 0x04000000,
98  VARIABLE_SEC = 0x05000000,
99  FUNCTION_SEC = 0x06000000,
100  TYPEDEF_SEC = 0x07000000,
101  MEMBERDOC_SEC = 0x08000000,
102  OVERLOADDOC_SEC = 0x09000000,
103  EXAMPLE_SEC = 0x0a000000,
104  VARIABLEDOC_SEC = 0x0b000000,
105  FILEDOC_SEC = 0x0c000000,
106  DEFINEDOC_SEC = 0x0d000000,
107  INCLUDE_SEC = 0x0e000000,
108  DEFINE_SEC = 0x0f000000,
109  GROUPDOC_SEC = 0x10000000,
110  USINGDIR_SEC = 0x11000000,
111  MAINPAGEDOC_SEC = 0x12000000,
112  MEMBERGRP_SEC = 0x13000000,
113  USINGDECL_SEC = 0x14000000,
114  PACKAGE_SEC = 0x15000000,
115  PACKAGEDOC_SEC = 0x16000000,
116  OBJCIMPL_SEC = 0x17000000,
117  DIRDOC_SEC = 0x18000000,
118  EXPORTED_INTERFACE_SEC = 0x19000000,
119  INCLUDED_SERVICE_SEC = 0x1A000000,
120  EXAMPLE_LINENO_SEC = 0x1B000000,
121  };
122 
123  // class specifiers (add new items to the end)
124  static const uint64 Template = (1ULL<<0);
125  static const uint64 Generic = (1ULL<<1);
126  static const uint64 Ref = (1ULL<<2);
127  static const uint64 Value = (1ULL<<3);
128  static const uint64 Interface = (1ULL<<4);
129  static const uint64 Struct = (1ULL<<5);
130  static const uint64 Union = (1ULL<<6);
131  static const uint64 Exception = (1ULL<<7);
132  static const uint64 Protocol = (1ULL<<8);
133  static const uint64 Category = (1ULL<<9);
134  static const uint64 SealedClass = (1ULL<<10);
135  static const uint64 AbstractClass = (1ULL<<11);
136  static const uint64 Enum = (1ULL<<12); // for Java-style enums
137  static const uint64 Service = (1ULL<<13); // UNO IDL
138  static const uint64 Singleton = (1ULL<<14); // UNO IDL
139  static const uint64 ForwardDecl = (1ULL<<15); // forward declared template classes
140  static const uint64 Local = (1ULL<<16); // for Slice types
141 
142  // member specifiers (add new items to the beginning)
143  static const uint64 ConstExpr = (1ULL<<19); // C++11 constexpr
144  static const uint64 PrivateGettable = (1ULL<<20); // C# private getter
145  static const uint64 ProtectedGettable = (1ULL<<21); // C# protected getter
146  static const uint64 PrivateSettable = (1ULL<<22); // C# private setter
147  static const uint64 ProtectedSettable = (1ULL<<23); // C# protected setter
148  static const uint64 Inline = (1ULL<<24);
149  static const uint64 Explicit = (1ULL<<25);
150  static const uint64 Mutable = (1ULL<<26);
151  static const uint64 Settable = (1ULL<<27);
152  static const uint64 Gettable = (1ULL<<28);
153  static const uint64 Readable = (1ULL<<29);
154  static const uint64 Writable = (1ULL<<30);
155  static const uint64 Final = (1ULL<<31);
156  static const uint64 Abstract = (1ULL<<32);
157  static const uint64 Addable = (1ULL<<33);
158  static const uint64 Removable = (1ULL<<34);
159  static const uint64 Raisable = (1ULL<<35);
160  static const uint64 Override = (1ULL<<36);
161  static const uint64 New = (1ULL<<37);
162  static const uint64 Sealed = (1ULL<<38);
163  static const uint64 Initonly = (1ULL<<39);
164  static const uint64 Optional = (1ULL<<40);
165  static const uint64 Required = (1ULL<<41);
166  static const uint64 NonAtomic = (1ULL<<42);
167  static const uint64 Copy = (1ULL<<43);
168  static const uint64 Retain = (1ULL<<44);
169  static const uint64 Assign = (1ULL<<45);
170  static const uint64 Strong = (1ULL<<46);
171  static const uint64 Weak = (1ULL<<47);
172  static const uint64 Unretained = (1ULL<<48);
173  static const uint64 Alias = (1ULL<<49);
174  static const uint64 ConstExp = (1ULL<<50);
175  static const uint64 Default = (1ULL<<51);
176  static const uint64 Delete = (1ULL<<52);
177  static const uint64 NoExcept = (1ULL<<53);
178  static const uint64 Attribute = (1ULL<<54); // UNO IDL attribute
179  static const uint64 Property = (1ULL<<55); // UNO IDL property
180  static const uint64 Readonly = (1ULL<<56); // on UNO IDL attribute or property
181  static const uint64 Bound = (1ULL<<57); // on UNO IDL attribute or property
182  static const uint64 Constrained = (1ULL<<58); // on UNO IDL property
183  static const uint64 Transient = (1ULL<<59); // on UNO IDL property
184  static const uint64 MaybeVoid = (1ULL<<60); // on UNO IDL property
185  static const uint64 MaybeDefault = (1ULL<<61); // on UNO IDL property
186  static const uint64 MaybeAmbiguous = (1ULL<<62); // on UNO IDL property
187  static const uint64 Published = (1ULL<<63); // UNO IDL keyword
188 
190  {
193  GROUPDOC_WEAK
194  };
195 
196  Entry();
197  Entry(const Entry &);
198  ~Entry();
199 
201  int getSize();
202 
203  void addSpecialListItem(const char *listName,int index);
204 
206  Entry *parent() const { return m_parent; }
207 
211  //const QList<Entry> *children() const { return m_sublist; }
212  const std::vector< std::unique_ptr<Entry> > &children() const { return m_sublist; }
213 
218  void moveToSubEntryAndKeep(Entry* e);
219  void moveToSubEntryAndKeep(std::unique_ptr<Entry> &e);
223  void moveToSubEntryAndRefresh(Entry* &e);
224  void moveToSubEntryAndRefresh(std::unique_ptr<Entry> &e);
225 
227  void moveFromSubEntry(const Entry *child,std::unique_ptr<Entry> &moveTo);
228 
230  void copyToSubEntry (Entry* e);
231  void copyToSubEntry (const std::unique_ptr<Entry> &e);
232 
236  void removeSubEntry(const Entry *e);
237 
241  void reset();
242 
243  void markAsProcessed() const { ((Entry*)(this))->section = Entry::EMPTY_SEC; }
244  void setFileDef(FileDef *fd);
245  FileDef *fileDef() const { return m_fileDef; }
246 
247  public:
248 
249  // identification
250  int section;
254 
255  // content
258  uint64 spec;
259  int initLines;
260  bool stat;
262  bool proto;
263  bool subGrouping;
264  bool callGraph;
265  bool callerGraph;
278  int docLine;
281  int briefLine;
293  int bodyLine;
295  int mGrpId;
300  int startLine;
304  bool hidden;
305  bool artificial;
306  GroupDocType groupDocType;
308  LocalToc localToc;
310 
311 
312  static int num;
313 
315  const char *groupDocCmd() const
316  {
317  switch( groupDocType )
318  {
319  case GROUPDOC_NORMAL: return "\\defgroup";
320  case GROUPDOC_ADD: return "\\addtogroup";
321  case GROUPDOC_WEAK: return "\\weakgroup";
322  default: return "unknown group command";
323  }
324  }
325  Grouping::GroupPri_t groupingPri() const
326  {
327  if( section != GROUPDOC_SEC )
328  {
329  return Grouping::GROUPING_LOWEST;
330  }
331  switch( groupDocType )
332  {
333  case GROUPDOC_NORMAL: return Grouping::GROUPING_AUTO_DEF;
334  case GROUPDOC_ADD: return Grouping::GROUPING_AUTO_ADD;
335  case GROUPDOC_WEAK: return Grouping::GROUPING_AUTO_WEAK;
336  default: return Grouping::GROUPING_LOWEST;
337  }
338  }
339 
340  private:
341  Entry *m_parent;
342  std::vector< std::unique_ptr<Entry> > m_sublist;
343  Entry &operator=(const Entry &);
344  FileDef *m_fileDef;
345 };
346 
347 #endif
bool callGraph
do we need to draw the call graph?
Definition: entry.h:264
TagInfo * tagInfo
tag file info
Definition: entry.h:253
QGString program
the program text
Definition: entry.h:273
QCString includeName
include name (3 arg of \class)
Definition: entry.h:276
This class represents an function or template argument list.
Definition: arguments.h:89
This file contains a number of basic enums and types.
bool proto
prototype ?
Definition: entry.h:262
uint64 spec
class/member specifiers
Definition: entry.h:258
Abstract interface for a template.
Definition: template.h:542
bool stat
static ?
Definition: entry.h:260
membership in group was defined via @weakgroup
Definition: types.h:70
Sections
Definition: entry.h:70
bool referencedByRelation
do we need to show the referenced by relation?
Definition: entry.h:266
Represents an unstructured piece of information, about an entity found in the sources.
Definition: entry.h:65
QCString read
property read accessor
Definition: entry.h:288
membership in group was defined via @defgroup
Definition: types.h:72
static int num
counts the total number of entries
Definition: entry.h:312
int briefLine
line number at which the brief desc. was found
Definition: entry.h:281
int docLine
line number at which the documentation was found
Definition: entry.h:278
ArgumentList * argList
member arguments as a list
Definition: entry.h:271
QCString name
member name
Definition: entry.h:252
A model of a file symbol.
Definition: filedef.h:64
int initLines
define/variable initializer lines to show
Definition: entry.h:259
GroupPri_t
Grouping priority.
Definition: types.h:67
This struct is used to capture the tag file information for an Entry.
Definition: entry.h:52
Entry * parent() const
Definition: entry.h:206
bool referencesRelation
do we need to show the references relation?
Definition: entry.h:267
QCString id
libclang id
Definition: entry.h:307
SrcLangExt
Language as given by extension.
Definition: types.h:42
bool hidden
does this represent an entity that is hidden from the output
Definition: entry.h:304
int mGrpId
member group id
Definition: entry.h:295
BaseInfo(const char *n, Protection p, Specifier v)
Definition: entry.h:42
QList< ArgumentList > * tArgLists
template argument declarations
Definition: entry.h:272
int startColumn
start column of entry in the source
Definition: entry.h:301
Definition: types.h:230
QCString includeFile
include file (2 arg of \class, must be unique)
Definition: entry.h:275
bool subGrouping
automatically group class members?
Definition: entry.h:263
bool callerGraph
do we need to draw the caller graph?
Definition: entry.h:265
QList< Grouping > * groups
list of groups this entry belongs to
Definition: entry.h:297
QGString initializer
initial value (for variables)
Definition: entry.h:274
QCString inbodyFile
file in which the body doc was found
Definition: entry.h:285
QCString brief
brief description (doc block)
Definition: entry.h:280
int endBodyLine
line number where the definition ends
Definition: entry.h:294
ArgumentList * typeConstr
where clause (C#) for type constraints
Definition: entry.h:292
addtogroup
Definition: entry.h:192
QCString name
the name of the base class
Definition: entry.h:44
Specifier virt
virtualness
Definition: entry.h:46
QList< SectionInfo > * anchors
list of anchors defined in this entry
Definition: entry.h:298
Specifier
Virtualness of a member.
Definition: types.h:30
QCString exception
throw specification
Definition: entry.h:291
int startLine
start line of entry in the source
Definition: entry.h:300
QCString args
member argument string
Definition: entry.h:269
QCString write
property write accessor
Definition: entry.h:289
Class representing a section in a page.
Definition: section.h:27
Protection protection
class protection
Definition: entry.h:256
QCString metaData
Slice metadata.
Definition: entry.h:309
Protection prot
inheritance type
Definition: entry.h:45
const char * groupDocCmd() const
return the command name used to define GROUPDOC_SEC
Definition: entry.h:315
RelatesType relatesType
how relates is handled
Definition: entry.h:287
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
QCString inbodyDocs
documentation inside the body of a function
Definition: entry.h:283
QCString doc
documentation block (partly parsed)
Definition: entry.h:277
Specifier virt
virtualness of the entry
Definition: entry.h:268
Definition: types.h:101
bool artificial
Artificially introduced item.
Definition: entry.h:305
This is an alternative implementation of QCString.
Definition: qgstring.h:19
defgroup
Definition: entry.h:191
QCString fileName
file this entry was extracted from
Definition: entry.h:299
bool explicitExternal
explicitly defined as external?
Definition: entry.h:261
QCString bitfields
member&#39;s bit fields
Definition: entry.h:270
QCString inside
name of the class in which documents are found
Definition: entry.h:290
MethodTypes
Kind of method.
Definition: types.h:33
Protection
Protection level of members.
Definition: types.h:27
QCString docFile
file in which the documentation was found
Definition: entry.h:279
MethodTypes mtype
signal, slot, (dcop) method, or property?
Definition: entry.h:257
RelatesType
Type of member relation.
Definition: types.h:36
QCString relates
related class (doc block)
Definition: entry.h:286
const std::vector< std::unique_ptr< Entry > > & children() const
Definition: entry.h:212
SrcLangExt lang
programming language in which this entry was found
Definition: entry.h:303
This is an alternative implementation of QCString.
Definition: qcstring.h:131
int inbodyLine
line number at which the body doc was found
Definition: entry.h:284
This class stores information about an inheritance relation.
Definition: entry.h:39
GroupDocType
Definition: entry.h:189
QList< BaseInfo > * extends
list of base classes
Definition: entry.h:296
membership in group was defined via @add[to]group
Definition: types.h:71
QCString type
member type
Definition: entry.h:251
int section
entry type (see Sections);
Definition: entry.h:250
int bodyLine
line number of the definition in the source
Definition: entry.h:293
QCString briefFile
file in which the brief desc. was found
Definition: entry.h:282
QList< ListItemInfo > * sli
special lists (test/todo/bug/deprecated/..) this entry is in
Definition: entry.h:302