Fix for UBSan build
[platform/upstream/doxygen.git] / src / docsets.h
1 /******************************************************************************
2  *
3  * Copyright (C) 1997-2012 by Dimitri van Heesch.
4  *
5  * Permission to use, copy, modify, and distribute this software and its
6  * documentation under the terms of the GNU General Public License is hereby 
7  * granted. No representations are made about the suitability of this software 
8  * for any purpose. It is provided "as is" without express or implied warranty.
9  * See the GNU General Public License for more details.
10  *
11  * Documents produced by Doxygen are derivative works derived from the
12  * input used in their production; they are not affected by this license.
13  *
14  */
15
16 #ifndef DOCSETS_H
17 #define DOCSETS_H
18
19 #include "qtbc.h"
20 #include <qstrlist.h>
21 #include "sortdict.h"
22 #include "ftextstream.h"
23 #include "index.h"
24
25 class QFile;
26 class Definition;
27
28 /** A class that generates docset files.
29  *
30  *  These files can be used to create context help 
31  *  for use within Apple's Xcode 3.0 development environment
32  */
33 class DocSets  : public IndexIntf
34 {
35
36   public:
37     DocSets();
38    ~DocSets();
39     void initialize();
40     void finalize();
41     void incContentsDepth();
42     void decContentsDepth();
43     void addContentsItem(bool isDir,
44                          const char *name, 
45                          const char *ref, 
46                          const char *file,
47                          const char *anchor,
48                          bool separateIndex,
49                          bool addToNavIndex,
50                          Definition *def
51                         );
52     void addIndexItem(Definition *context,MemberDef *md,const char *title);
53     void addIndexFile(const char *name);
54     void addImageFile(const char *) {}
55     void addStyleSheetFile(const char *) {}
56
57   private:
58     void writeToken(FTextStream &t, const Definition *d,
59                     const QCString &type, const QCString &lang,
60                     const char *scope=0, const char *anchor=0,
61                     const char *decl=0);
62     struct NodeDef
63     {
64       NodeDef(bool d,const QCString &n,const QCString &r,
65                     const QCString &f,const QCString &a,int i) :
66                    isDir(d), name(n), ref(r), file(f), anchor(a),id(i) {}
67       bool isDir;
68       QCString name;
69       QCString ref;
70       QCString file;
71       QCString anchor;
72       int id;
73     };
74     QCString indent();
75     QFile *m_nf;
76     QFile *m_tf;
77     FTextStream m_nts;
78     FTextStream m_tts;
79     int m_dc;
80     int m_id;
81     QArray<bool> m_firstNode;
82     SDict<NodeDef> m_nodes;
83     SDict<void> m_scopes;
84 };
85
86 #endif /* DOCSETS_H */
87