Doxygen
Loading...
Searching...
No Matches
config.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2015 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 CONFIG_H
17#define CONFIG_H
18
19// note: this header file is generated from config.xml
20#include "configvalues.h"
21
22//! @{
23//! some convenience macros for accessing the config options
24//! mainly done like this for backward compatibility
25//#if DYNAMIC_LOOKUP // for debug purposes
26//#define Config_getString(val) (ConfigValues::instance().*((ConfigValues::InfoString*)ConfigValues::instance().get(#val))->item)
27//#define Config_getBool(val) (ConfigValues::instance().*((ConfigValues::InfoBool*)ConfigValues::instance().get(#val))->item)
28//#define Config_getInt(val) (ConfigValues::instance().*((ConfigValues::InfoInt*)ConfigValues::instance().get(#val))->item)
29//#define Config_getEnum(val) (ConfigValues::instance().*((ConfigValues::InfoString*)ConfigValues::instance().get(#val))->item)
30//#define Config_getList(val) (ConfigValues::instance().*((ConfigValues::InfoList*)ConfigValues::instance().get(#val))->item)
31//#else // direct access
32#define Config_getString(name) (ConfigValues::instance().name())
33#define Config_getBool(name) (ConfigValues::instance().name())
34#define Config_getInt(name) (ConfigValues::instance().name())
35#define Config_getEnum(name) (ConfigValues::instance().name())
36#define Config_getEnumAsString(name) (ConfigValues::instance().name##_str())
37#define Config_getStringAsEnum(name,value) (name##_str2enum(value))
38#define Config_getList(name) (ConfigValues::instance().name())
39#define Config_updateString(name,value) (ConfigValues::instance().update_##name(value));
40#define Config_updateBool(name,value) (ConfigValues::instance().update_##name(value));
41#define Config_updateInt(name,value) (ConfigValues::instance().update_##name(value));
42#define Config_updateEnum(name,value) (ConfigValues::instance().update_##name(value));
43#define Config_updateList(name,...) (ConfigValues::instance().update_##name(__VA_ARGS__));
44
45#define Config_isAvailableEnum(name,value) (ConfigValues::instance().isAvailable_##name(value))
46//#endif
47//! @}
48
49class TextStream;
50
51/** \brief Public function to deal with the configuration file. */
52namespace Config
53{
55
56 /*! Initialize configuration variables to their default value */
57 void init();
58
59 /*! Writes a template configuration to stream \a t. If \a shortList
60 * is \c TRUE the description of each configuration option will
61 * be omitted.
62 */
63 void writeTemplate(TextStream &t,bool shortList,bool updateOnly=FALSE);
64
65 /*! Writes a the differences between the current configuration and the
66 * template configuration to stream \a t.
67 */
68 void compareDoxyfile(TextStream &t, CompareMode compareMode);
69
70 /*! Writes a the used settings of the current configuration as XML format
71 * to stream \a t.
72 */
74
75 /*! Writes all possible setting ids to an XSD file for validation
76 * through the stream \a t.
77 */
79
80 /*! Parses a configuration file with name \a fn.
81 * \returns TRUE if successful, FALSE if the file could not be
82 * opened or read.
83 */
84 bool parse(const QCString &fileName,bool update=FALSE, CompareMode compareMode = CompareMode::Full);
85
86 /*! Post processed the parsed data. Replaces raw string values by the actual values.
87 * and replaces environment variables.
88 * \param clearHeaderAndFooter set to TRUE when writing header and footer templates.
89 * \param compareMode signals if we in Doxyfile compare (`-x` or `-x_noenv`) mode are or not.
90 * Influences setting of the default value and replacement of environment variables and CMake type replacement variables.
91 */
92 void postProcess(bool clearHeaderAndFooter, CompareMode compareMode = CompareMode::Full);
93
94 /*! Check the validity of the parsed options and correct or warn the user where needed.
95 * \param quiet setting for the QUIET option (can have been overruled by means of a command line option)
96 * \param check check HTML / LaTeX header file etc. on existence (and terminate when not present)
97 */
98 void checkAndCorrect(bool quiet, const bool check);
99
100 /*! Adjust any configuration values based on the value of obsolete options. */
101 void updateObsolete();
102
103 /*! Clean up any data */
104 void deinit();
105}
106
107#endif
This is an alternative implementation of QCString.
Definition qcstring.h:101
Text streaming class that buffers data.
Definition textstream.h:36
Public function to deal with the configuration file.
Definition config.h:53
void postProcess(bool clearHeaderAndFooter, CompareMode compareMode=CompareMode::Full)
CompareMode
Definition config.h:54
void checkAndCorrect(bool quiet, const bool check)
void writeXMLDoxyfile(TextStream &t)
void compareDoxyfile(TextStream &t, CompareMode compareMode)
void deinit()
bool parse(const QCString &fileName, bool update=FALSE, CompareMode compareMode=CompareMode::Full)
void writeXSDDoxyfile(TextStream &t)
void init()
void writeTemplate(TextStream &t, bool shortList, bool updateOnly=FALSE)
void updateObsolete()
#define FALSE
Definition qcstring.h:34