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
49
class
TextStream
;
50
51
/** \brief Public function to deal with the configuration file. */
52
namespace
Config
53
{
54
enum class
CompareMode
{
Full
,
Compressed
,
CompressedNoEnv
};
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
*/
73
void
writeXMLDoxyfile
(
TextStream
&t);
74
75
/*! Writes all possible setting ids to an XSD file for validation
76
* through the stream \a t.
77
*/
78
void
writeXSDDoxyfile
(
TextStream
&t);
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
QCString
This is an alternative implementation of QCString.
Definition
qcstring.h:101
TextStream
Text streaming class that buffers data.
Definition
textstream.h:36
Config
Public function to deal with the configuration file.
Definition
config.h:53
Config::postProcess
void postProcess(bool clearHeaderAndFooter, CompareMode compareMode=CompareMode::Full)
Definition
configimpl.l:2373
Config::CompareMode
CompareMode
Definition
config.h:54
Config::CompareMode::Compressed
@ Compressed
Definition
config.h:54
Config::CompareMode::CompressedNoEnv
@ CompressedNoEnv
Definition
config.h:54
Config::CompareMode::Full
@ Full
Definition
config.h:54
Config::checkAndCorrect
void checkAndCorrect(bool quiet, const bool check)
Definition
configimpl.l:1761
Config::writeXMLDoxyfile
void writeXMLDoxyfile(TextStream &t)
Definition
configimpl.l:2349
Config::compareDoxyfile
void compareDoxyfile(TextStream &t, CompareMode compareMode)
Definition
configimpl.l:2343
Config::deinit
void deinit()
Definition
configimpl.l:2391
Config::parse
bool parse(const QCString &fileName, bool update=FALSE, CompareMode compareMode=CompareMode::Full)
Definition
configimpl.l:2359
Config::writeXSDDoxyfile
void writeXSDDoxyfile(TextStream &t)
Definition
configimpl.l:2354
Config::init
void init()
Definition
configimpl.l:1670
Config::writeTemplate
void writeTemplate(TextStream &t, bool shortList, bool updateOnly=FALSE)
Definition
configimpl.l:2338
Config::updateObsolete
void updateObsolete()
Definition
configimpl.l:2238
FALSE
#define FALSE
Definition
qcstring.h:34
src
config.h
Generated by
1.13.0