Warning: That file was not part of the compilation database. It may have many parsing errors.

1/****************************************************************************
2**
3** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4** Contact: http://www.qt-project.org/legal
5**
6** This file is part of the tools applications of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and
14** conditions see http://qt.digia.com/licensing. For further information
15** use the contact form at http://qt.digia.com/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 2.1 requirements
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**
25** In addition, as a special exception, Digia gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**
29** GNU General Public License Usage
30** Alternatively, this file may be used under the terms of the GNU
31** General Public License version 3.0 as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL included in the
33** packaging of this file. Please review the following information to
34** ensure the GNU General Public License version 3.0 requirements will be
35** met: http://www.gnu.org/copyleft/gpl.html.
36**
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42/*
43 config.h
44*/
45
46#ifndef CONFIG_H
47#define CONFIG_H
48
49#include <QMap>
50#include <QSet>
51#include <QStringList>
52
53#include "location.h"
54
55QT_BEGIN_NAMESPACE
56
57typedef QMultiMap<QString, QString> QStringMultiMap;
58
59class Config
60{
61 public:
62 Config(const QString& programName);
63 ~Config();
64
65 void load(const QString& fileName);
66 void unload(const QString& fileName);
67 void setStringList(const QString& var, const QStringList& values);
68
69 const QString& programName() const { return prog; }
70 const Location& location() const { return loc; }
71 const Location& lastLocation() const { return lastLoc; }
72 bool getBool(const QString& var) const;
73 int getInt(const QString& var) const;
74 QString getString(const QString& var) const;
75 QSet<QString> getStringSet(const QString& var) const;
76 QStringList getStringList(const QString& var) const;
77 QRegExp getRegExp(const QString& var) const;
78 QList<QRegExp> getRegExpList(const QString& var) const;
79 QSet<QString> subVars(const QString& var) const;
80 void subVarsAndValues(const QString& var, QStringMultiMap& t) const;
81 QStringList getAllFiles(const QString& filesVar,
82 const QString& dirsVar,
83 const QSet<QString> &excludedDirs = QSet<QString>());
84
85 static QStringList getFilesHere(const QString& dir,
86 const QString& nameFilter,
87 const QSet<QString> &excludedDirs = QSet<QString>());
88 static QString findFile(const Location& location,
89 const QStringList &files,
90 const QStringList& dirs,
91 const QString& fileName,
92 QString& userFriendlyFilePath);
93 static QString findFile(const Location &location,
94 const QStringList &files,
95 const QStringList &dirs,
96 const QString &fileBase,
97 const QStringList &fileExtensions,
98 QString &userFriendlyFilePath);
99 static QString copyFile(const Location& location,
100 const QString& sourceFilePath,
101 const QString& userFriendlySourceFilePath,
102 const QString& targetDirPath);
103 static int numParams(const QString& value);
104 static bool removeDirContents(const QString& dir);
105
106 QT_STATIC_CONST QString dot;
107
108 private:
109 static bool isMetaKeyChar(QChar ch);
110 void load(Location location, const QString& fileName);
111
112 QString prog;
113 Location loc;
114 Location lastLoc;
115 QMap<QString, Location> locMap;
116 QMap<QString, QStringList> stringListValueMap;
117 QMap<QString, QString> stringValueMap;
118
119 static QMap<QString, QString> uncompressedFiles;
120 static QMap<QString, QString> extractedDirs;
121 static int numInstances;
122};
123
124#define CONFIG_ALIAS "alias"
125#define CONFIG_BASE "base" // ### don't document for now
126#define CONFIG_CODEINDENT "codeindent"
127#define CONFIG_DEFINES "defines"
128#define CONFIG_DESCRIPTION "description"
129#define CONFIG_EDITION "edition"
130#define CONFIG_ENDHEADER "endheader"
131#define CONFIG_EXAMPLEDIRS "exampledirs"
132#define CONFIG_EXAMPLES "examples"
133#define CONFIG_EXCLUDEDIRS "excludedirs"
134#define CONFIG_EXTRAIMAGES "extraimages"
135#define CONFIG_FALSEHOODS "falsehoods"
136#define CONFIG_FORMATTING "formatting"
137#define CONFIG_GENERATEINDEX "generateindex"
138#define CONFIG_HEADERDIRS "headerdirs"
139#define CONFIG_HEADERS "headers"
140#define CONFIG_HEADERSCRIPTS "headerscripts"
141#define CONFIG_HEADERSTYLES "headerstyles"
142#define CONFIG_IGNOREDIRECTIVES "ignoredirectives"
143#define CONFIG_IGNORETOKENS "ignoretokens"
144#define CONFIG_IMAGEDIRS "imagedirs"
145#define CONFIG_IMAGES "images"
146#define CONFIG_INDEXES "indexes"
147#define CONFIG_LANGUAGE "language"
148#define CONFIG_MACRO "macro"
149#define CONFIG_NATURALLANGUAGE "naturallanguage"
150#define CONFIG_OBSOLETELINKS "obsoletelinks"
151#define CONFIG_OUTPUTDIR "outputdir"
152#define CONFIG_OUTPUTENCODING "outputencoding"
153#define CONFIG_OUTPUTLANGUAGE "outputlanguage"
154#define CONFIG_OUTPUTFORMATS "outputformats"
155#define CONFIG_OUTPUTPREFIXES "outputprefixes"
156#define CONFIG_PROJECT "project"
157#define CONFIG_QHP "qhp"
158#define CONFIG_QUOTINGINFORMATION "quotinginformation"
159#define CONFIG_SCRIPTDIRS "scriptdirs"
160#define CONFIG_SCRIPTS "scripts"
161#define CONFIG_SLOW "slow"
162#define CONFIG_SHOWINTERNAL "showinternal"
163#define CONFIG_SOURCEDIRS "sourcedirs"
164#define CONFIG_SOURCEENCODING "sourceencoding"
165#define CONFIG_SOURCES "sources"
166#define CONFIG_SPURIOUS "spurious"
167#define CONFIG_STYLEDIRS "styledirs"
168#define CONFIG_STYLE "style"
169#define CONFIG_STYLES "styles"
170#define CONFIG_STYLESHEETS "stylesheets"
171#define CONFIG_SYNTAXHIGHLIGHTING "syntaxhighlighting"
172#define CONFIG_TEMPLATEDIR "templatedir"
173#define CONFIG_TABSIZE "tabsize"
174#define CONFIG_TAGFILE "tagfile"
175#define CONFIG_TRANSLATORS "translators" // ### don't document for now
176#define CONFIG_URL "url"
177#define CONFIG_VERSION "version"
178#define CONFIG_VERSIONSYM "versionsym"
179
180#define CONFIG_FILEEXTENSIONS "fileextensions"
181#define CONFIG_IMAGEEXTENSIONS "imageextensions"
182
183#ifdef QDOC_QML
184#define CONFIG_QMLONLY "qmlonly"
185#endif
186
187QT_END_NAMESPACE
188
189#endif
190

Warning: That file was not part of the compilation database. It may have many parsing errors.