1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3#ifndef DOCPRIVATE_H
4#define DOCPRIVATE_H
5
6#include "atom.h"
7#include "config.h"
8#include "codemarker.h"
9#include "doc.h"
10#include "editdistance.h"
11#include "generator.h"
12#include "utilities.h"
13#include "openedlist.h"
14#include "quoter.h"
15#include "text.h"
16#include "tokenizer.h"
17
18#include <QtCore/qdatetime.h>
19#include <QtCore/qfile.h>
20#include <QtCore/qfileinfo.h>
21#include <QtCore/qhash.h>
22#include <QtCore/qmap.h>
23#include <QtCore/qtextstream.h>
24
25#include <cctype>
26#include <climits>
27#include <utility>
28
29QT_BEGIN_NAMESPACE
30
31typedef QMap<QString, ArgList> CommandMap;
32
33struct DocPrivateExtra
34{
35 QList<Atom *> m_tableOfContents {};
36 QList<int> m_tableOfContentsLevels {};
37 QList<Atom *> m_keywords {};
38 QList<Atom *> m_targets {};
39 QStringMultiMap m_metaMap {};
40 QMultiMap<ComparisonCategory, Text> m_comparesWithMap {};
41};
42
43class DocPrivate
44{
45public:
46 explicit DocPrivate(const Location &start = Location(), const Location &end = Location(),
47 QString source = QString())
48 : m_start_loc(start), m_end_loc(end), m_src(std::move(source)), m_hasLegalese(false) {};
49 ~DocPrivate();
50
51 void addAlso(const Text &also);
52 void constructExtra();
53 void ref() { ++count; }
54 bool deref() { return (--count == 0); }
55
56 int count { 1 };
57 // ### move some of this in DocPrivateExtra
58 Location m_start_loc {};
59 Location m_end_loc {};
60 QString m_src {};
61 Text m_text {};
62 QSet<QString> m_params {};
63 QList<Text> m_alsoList {};
64 QStringList m_enumItemList {};
65 QStringList m_omitEnumItemList {};
66 QSet<QString> m_metacommandsUsed {};
67 CommandMap m_metaCommandMap {};
68 DocPrivateExtra *extra { nullptr };
69 TopicList m_topics {};
70
71 bool m_hasLegalese : 1;
72};
73
74QT_END_NAMESPACE
75
76#endif // DOCPRIVATE_H
77

source code of qttools/src/qdoc/qdoc/src/qdoc/docprivate.h