Doxygen
Loading...
Searching...
No Matches
configimpl.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 *
4 *
5 *
6 * Copyright (C) 1997-2015 by Dimitri van Heesch.
7 *
8 * Permission to use, copy, modify, and distribute this software and its
9 * documentation under the terms of the GNU General Public License is hereby
10 * granted. No representations are made about the suitability of this software
11 * for any purpose. It is provided "as is" without express or implied warranty.
12 * See the GNU General Public License for more details.
13 *
14 * Documents produced by Doxygen are derivative works derived from the
15 * input used in their production; they are not affected by this license.
16 *
17 */
18
19#ifndef CONFIGIMPL_H
20#define CONFIGIMPL_H
21
22#include <vector>
23#include <unordered_map>
24#include <string>
25#include <memory>
26#include <iostream>
27
28#include "containers.h"
29#include "qcstring.h"
30#include "config.h"
31#include "construct.h"
32
33class TextStream;
34
35/** Abstract base class for any configuration option.
36 */
38{
39 friend class ConfigImpl;
40
41 public:
43
44 /*! The type of option */
46 {
47 O_Info, //!< A section header
48 O_List, //!< A list of items
49 O_Enum, //!< A fixed set of items
50 O_String, //!< A single item
51 O_Int, //!< An integer value
52 O_Bool, //!< A boolean value
53 O_Obsolete, //!< An obsolete option
54 O_Disabled //!< Disabled compile time option
55 };
56 enum
57 {
58 /*! Maximum length of an option in the config file. Used for
59 * alignment purposes.
60 */
62 };
64 {
65 m_spaces.fill(' ',40);
66 }
67
68 /*! returns the kind of option this is. */
69 OptionType kind() const { return m_kind; }
70 QCString name() const { return m_name; }
71 QCString docs() const { return m_doc; }
72
73 QCString dependsOn() const { return m_dependency; }
74 void addDependency(const char *dep) { m_dependency = dep; }
75 void setEncoding(const QCString &e) { m_encoding = e; }
76 void setUserComment(const QCString &u) { m_userComment += u; }
77
78 protected:
79 virtual void writeTemplate(TextStream &t,bool sl,bool upd) = 0;
80 virtual void compareDoxyfile(TextStream &t,Config::CompareMode compareMode) = 0;
81 virtual void writeXMLDoxyfile(TextStream &t) = 0;
82 virtual void writeXSDDoxyfile(TextStream &t) = 0;
84 virtual void emptyValueToDefault() {}
85 virtual void substEnvVars() = 0;
86 virtual void init() {}
87 virtual bool isDefault() { return true; }
88
89 void writeBoolValue(TextStream &t,bool v,bool initSpace = true);
90 void writeIntValue(TextStream &t,int i,bool initSpace = true);
91 void writeStringValue(TextStream &t,const QCString &s,bool initSpace = true,bool wasQuoted = false);
92 void writeStringList(TextStream &t,const StringVector &l);
93
101};
102
103/** Section marker for grouping the configuration options.
104 */
106{
107 public:
108 ConfigInfo(const char *name,const char *doc)
110 {
111 m_name = name;
112 m_doc = doc;
113 }
114 void writeTemplate(TextStream &t, bool sl,bool) override;
116 void writeXMLDoxyfile(TextStream &) override {}
117 void writeXSDDoxyfile(TextStream &t) override {}
118 void substEnvVars() override {}
119};
120
121/** Class representing a list type option.
122 */
124{
125 public:
127 ConfigList(const char *name,const char *doc)
129 {
130 m_name = name;
131 m_doc = doc;
133 }
134 void addValue(const char *v) { m_defaultValue.emplace_back(v); }
139 void emptyValueToDefault() override { if (m_value.empty() && !m_defaultValue.empty()) m_value=m_defaultValue; };
140 void writeTemplate(TextStream &t,bool sl,bool) override;
141 void compareDoxyfile(TextStream &t,Config::CompareMode compareMode) override;
142 void writeXMLDoxyfile(TextStream &t) override;
143 void writeXSDDoxyfile(TextStream &t) override;
144 void substEnvVars() override;
145 void init() override { m_value = m_defaultValue; }
146 bool isDefault() override;
147 private:
151};
152
153/** Class representing an enum type option.
154 */
156{
157 public:
158 ConfigEnum(const char *name,const char *doc,const char *defVal)
160 {
161 m_name = name;
162 m_doc = doc;
163 m_value = defVal;
164 m_defValue = defVal;
165 }
166 void addValue(const char *v) { m_valueRange.emplace_back(v); }
167 const std::vector<QCString> &values() const { return m_valueRange; }
168 QCString *valueRef() { return &m_value; }
169 void substEnvVars() override;
170 void writeTemplate(TextStream &t,bool sl,bool) override;
171 void convertStrToVal(Config::CompareMode compareMode) override;
172 void compareDoxyfile(TextStream &t,Config::CompareMode compareMode) override;
173 void writeXMLDoxyfile(TextStream &t) override;
174 void writeXSDDoxyfile(TextStream &t) override;
175 void init() override { m_value = m_defValue; }
176 bool isDefault() override { return m_value == m_defValue; }
177
178 private:
179 std::vector<QCString> m_valueRange;
182};
183
184/** Class representing a string type option.
185 */
187{
188 public:
190 ConfigString(const char *name,const char *doc)
192 {
193 m_name = name;
194 m_doc = doc;
196 }
199 void setDefaultValue(const char *v) { m_defValue = v; }
200 QCString *valueRef() { return &m_value; }
201 void writeTemplate(TextStream &t,bool sl,bool) override;
202 void compareDoxyfile(TextStream &t,Config::CompareMode compareMode) override;
203 void writeXMLDoxyfile(TextStream &t) override;
204 void writeXSDDoxyfile(TextStream &t) override;
205 void substEnvVars() override;
206 void init() override { m_value = m_defValue; }
207 void emptyValueToDefault() override { if (m_value.isEmpty()) m_value=m_defValue; };
208 bool isDefault() override { return m_value.stripWhiteSpace() == m_defValue.stripWhiteSpace(); }
209
210 private:
214};
215
216/** Class representing an integer type option.
217 */
219{
220 public:
221 ConfigInt(const char *name,const char *doc,int minVal,int maxVal,int defVal)
223 {
224 m_name = name;
225 m_doc = doc;
226 m_value = defVal;
227 m_defValue = defVal;
230 }
232 int *valueRef() { return &m_value; }
233 int minVal() const { return m_minVal; }
234 int maxVal() const { return m_maxVal; }
235 void convertStrToVal(Config::CompareMode compareMode) override;
236 void substEnvVars() override;
237 void writeTemplate(TextStream &t,bool sl,bool upd) override;
238 void compareDoxyfile(TextStream &t,Config::CompareMode compareMode) override;
239 void writeXMLDoxyfile(TextStream &t) override;
240 void writeXSDDoxyfile(TextStream &t) override;
241 void init() override { m_value = m_defValue; }
242 bool isDefault() override { return m_value == m_defValue; }
243 private:
249};
250
251/** Class representing a Boolean type option.
252 */
254{
255 public:
256 ConfigBool(const char *name,const char *doc,bool defVal)
258 {
259 m_name = name;
260 m_doc = doc;
261 m_value = defVal;
262 m_defValue = defVal;
263 }
265 bool *valueRef() { return &m_value; }
266 void convertStrToVal(Config::CompareMode compareMode) override;
267 void substEnvVars() override;
268 void setValueString(const QCString &v) { m_valueString = v; }
269 void writeTemplate(TextStream &t,bool sl,bool upd) override;
270 void compareDoxyfile(TextStream &t,Config::CompareMode compareMode) override;
271 void writeXMLDoxyfile(TextStream &t) override;
272 void writeXSDDoxyfile(TextStream &t) override;
273 void init() override { m_value = m_defValue; }
274 bool isDefault() override { return m_value == m_defValue; }
275 private:
279};
280
281/** Section marker for obsolete options
282 */
284{
285 public:
288 void writeTemplate(TextStream &,bool,bool) override;
290 void writeXMLDoxyfile(TextStream &) override {}
291 void writeXSDDoxyfile(TextStream &) override {}
292 void substEnvVars() override {}
293 OptionType orgType() const { return m_orgType; }
296 void markAsPresent() { m_present = true; }
297 bool isPresent() const { return m_present; }
298 private:
302 bool m_present = false;
303};
304
305/** Section marker for compile time optional options
306 */
308{
309 public:
312 void writeTemplate(TextStream &,bool,bool) override;
314 void writeXMLDoxyfile(TextStream &) override {}
315 void writeXSDDoxyfile(TextStream &) override;
316 void substEnvVars() override {}
317};
318
319// some convenience macros for access the config options
320#define ConfigImpl_getString(val) ConfigImpl::instance()->getString(__FILE__,__LINE__,val)
321#define ConfigImpl_getInt(val) ConfigImpl::instance()->getInt(__FILE__,__LINE__,val)
322#define ConfigImpl_getList(val) ConfigImpl::instance()->getList(__FILE__,__LINE__,val)
323#define ConfigImpl_getEnum(val) ConfigImpl::instance()->getEnum(__FILE__,__LINE__,val)
324#define ConfigImpl_getBool(val) ConfigImpl::instance()->getBool(__FILE__,__LINE__,val)
325
326
327using ConfigOptionList = std::vector< std::unique_ptr<ConfigOption> >;
328using ConfigOptionMap = std::unordered_map< std::string, ConfigOption* >;
329
330/** Singleton for configuration variables.
331 *
332 * This object holds the global static variables
333 * read from a user-supplied configuration file.
334 * The static member instance() can be used to get
335 * a pointer to the one and only instance.
336 *
337 * Set all variables to their default values by
338 * calling Config::instance()->init()
339 *
340 */
342{
343 public:
344 /////////////////////////////
345 // public API
346 /////////////////////////////
347 ConfigImpl();
348
349 /*! Returns the one and only instance of this class */
351 {
352 if (!m_instance) m_instance = std::make_unique<ConfigImpl>();
353 return m_instance.get();
354 }
355 /*! Delete the instance */
356 static void deleteInstance()
357 {
358 m_instance.reset();
359 }
360
361 /*!
362 * @name Getting configuration values.
363 * @{
364 */
365
366 /*! Returns the value of the string option with name \a fileName.
367 * The arguments \a num and \a name are for debugging purposes only.
368 * There is a convenience function Config_getString() for this.
369 */
370 QCString &getString(const char *fileName,int num,const char *name) const;
371
372 /*! Returns the value of the list option with name \a fileName.
373 * The arguments \a num and \a name are for debugging purposes only.
374 * There is a convenience function Config_getList() for this.
375 */
376 StringVector &getList(const char *fileName,int num,const char *name) const;
377
378 /*! Returns the value of the enum option with name \a fileName.
379 * The arguments \a num and \a name are for debugging purposes only.
380 * There is a convenience function Config_getEnum() for this.
381 */
382 QCString &getEnum(const char *fileName,int num,const char *name) const;
383
384 /*! Returns the value of the integer option with name \a fileName.
385 * The arguments \a num and \a name are for debugging purposes only.
386 * There is a convenience function Config_getInt() for this.
387 */
388 int &getInt(const char *fileName,int num,const char *name) const;
389
390 /*! Returns the value of the boolean option with name \a fileName.
391 * The arguments \a num and \a name are for debugging purposes only.
392 * There is a convenience function Config_getBool() for this.
393 */
394 bool &getBool(const char *fileName,int num,const char *name) const;
395
396 /*! Returns the ConfigOption corresponding with \a name or 0 if
397 * the option is not supported.
398 */
399 ConfigOption *get(const QCString &name) const
400 {
401 auto it = m_dict.find(name.str());
402 return it!=m_dict.end() ? it->second : nullptr;
403 }
404 /* @} */
405
406 /*!
407 * @name Adding configuration options.
408 * @{
409 */
410
411 /*! Starts a new configuration section with \a name and description \a doc.
412 * \returns An object representing the option.
413 */
414 ConfigInfo *addInfo(const char *name,const char *doc)
415 {
416 ConfigInfo *result = new ConfigInfo(name,doc);
417 m_options.push_back(std::unique_ptr<ConfigOption>(result));
418 return result;
419 }
420
421 /*! Adds a new string option with \a name and documentation \a doc.
422 * \returns An object representing the option.
423 */
424 ConfigString *addString(const char *name,
425 const char *doc)
426 {
427 ConfigString *result = new ConfigString(name,doc);
428 m_options.push_back(std::unique_ptr<ConfigOption>(result));
429 m_dict.emplace(name,result);
430 return result;
431 }
432
433 /*! Adds a new enumeration option with \a name and documentation \a doc
434 * and initial value \a defVal.
435 * \returns An object representing the option.
436 */
437 ConfigEnum *addEnum(const char *name,
438 const char *doc,
439 const char *defVal)
440 {
441 ConfigEnum *result = new ConfigEnum(name,doc,defVal);
442 m_options.push_back(std::unique_ptr<ConfigOption>(result));
443 m_dict.emplace(name,result);
444 return result;
445 }
446
447 /*! Adds a new string option with \a name and documentation \a doc.
448 * \returns An object representing the option.
449 */
450 ConfigList *addList(const char *name,
451 const char *doc)
452 {
453 ConfigList *result = new ConfigList(name,doc);
454 m_options.push_back(std::unique_ptr<ConfigOption>(result));
455 m_dict.emplace(name,result);
456 return result;
457 }
458
459 /*! Adds a new integer option with \a name and documentation \a doc.
460 * The integer has a range between \a minVal and \a maxVal and a
461 * default value of \a defVal.
462 * \returns An object representing the option.
463 */
464 ConfigInt *addInt(const char *name,
465 const char *doc,
466 int minVal,int maxVal,int defVal)
467 {
468 ConfigInt *result = new ConfigInt(name,doc,minVal,maxVal,defVal);
469 m_options.push_back(std::unique_ptr<ConfigOption>(result));
470 m_dict.emplace(name,result);
471 return result;
472 }
473
474 /*! Adds a new boolean option with \a name and documentation \a doc.
475 * The boolean has a default value of \a defVal.
476 * \returns An object representing the option.
477 */
478 ConfigBool *addBool(const char *name,
479 const char *doc,
480 bool defVal)
481 {
482 ConfigBool *result = new ConfigBool(name,doc,defVal);
483 m_options.push_back(std::unique_ptr<ConfigOption>(result));
484 m_dict.emplace(name,result);
485 return result;
486 }
487
488 /*! Adds an option that has become obsolete. */
490 {
491 ConfigObsolete *result = new ConfigObsolete(name,orgType);
492 m_obsolete.push_back(std::unique_ptr<ConfigOption>(result));
493 m_dict.emplace(name,result);
494 return result;
495 }
496
497 /*! Adds an option that has been disabled at compile time. */
498 ConfigOption *addDisabled(const char *name)
499 {
500 ConfigDisabled *result = new ConfigDisabled(name);
501 m_disabled.push_back(std::unique_ptr<ConfigOption>(result));
502 m_dict.emplace(name,result);
503 return result;
504 }
505 /*! @} */
506
507 /*! Writes a template configuration to stream \a t. If \a shortIndex
508 * is \c TRUE the description of each configuration option will
509 * be omitted.
510 */
511 void writeTemplate(TextStream &t,bool shortIndex,bool updateOnly);
512
513 /*! Writes a the differences between the current configuration and the
514 * template configuration to stream \a t.
515 */
517
518 /*! Writes a the used settings of the current configuration as XML format
519 * to stream \a t.
520 */
522
523 /*! Writes all possible setting ids to an XSD file for validation
524 * through the stream \a t.
525 */
527
528 void setHeader(const char *header) { m_header = header; }
529
530 /////////////////////////////
531 // internal API
532 /////////////////////////////
533
534 /*! Converts the string values read from the configuration file
535 * to real values for non-string type options (like int, and bools)
536 */
537 void convertStrToVal(Config::CompareMode compareMode);
538
539 /*! Sets default value in case value is empty
540 */
541 void emptyValueToDefault();
542
543 /*! Replaces references to environment variable by the actual value
544 * of the environment variable.
545 */
547
548 /*! Initialize config variables to their default value */
549 void init();
550
551 /*! Parse a configuration data in string \a str.
552 * \returns TRUE if successful, or FALSE if the string could not be
553 * parsed.
554 */
555 bool parseString(const QCString &fn,const QCString &str,bool upd = FALSE);
556
557 /*! Parse a configuration file with name \a fn.
558 * \returns TRUE if successful, FALSE if the file could not be
559 * opened or read.
560 */
561 bool parse(const QCString &fn,bool upd = FALSE);
562
563 /*! Append user start comment
564 */
566 {
567 m_startComment += u;
568 }
569 /*! Append user comment
570 */
572 {
573 m_userComment += u;
574 }
575 /*! Append replacement string
576 */
578 {
579 m_storeRepl += u;
580 }
581 /*! Take the user start comment and reset it internally
582 * \returns user start comment
583 */
585 {
587 m_startComment.clear();
588 return substitute(result,"\r","");
589 }
590 /*! Take the user comment and reset it internally
591 * \returns user comment
592 */
594 {
595 QCString result=m_userComment;
596 m_userComment.clear();
597 return substitute(result,"\r","");
598 }
599 /*! Take the replacement string
600 * \returns the replacement string
601 */
603 {
604 QCString result=m_storeRepl;
605 m_storeRepl.clear();
606 return substitute(result,"\r","");
607 }
608
609 static void config_err(const char *fmt, ...);
610 static void config_term(const char *fmt, ...);
611 static void config_warn(const char *fmt, ...);
612
613 private:
618 static std::unique_ptr<ConfigImpl> m_instance;
623};
624
625#endif
Class representing a Boolean type option.
Definition configimpl.h:254
ConfigBool(const char *name, const char *doc, bool defVal)
Definition configimpl.h:256
void init() override
Definition configimpl.h:273
void writeTemplate(TextStream &t, bool sl, bool upd) override
Definition configimpl.l:582
bool isDefault() override
Definition configimpl.h:274
void writeXMLDoxyfile(TextStream &t) override
Definition configimpl.l:612
bool * valueRef()
Definition configimpl.h:265
void writeXSDDoxyfile(TextStream &t) override
Definition configimpl.l:624
void substEnvVars() override
QCString * valueStringRef()
Definition configimpl.h:264
void compareDoxyfile(TextStream &t, Config::CompareMode compareMode) override
Definition configimpl.l:607
void convertStrToVal(Config::CompareMode compareMode) override
Definition configimpl.l:247
bool m_defValue
Definition configimpl.h:277
QCString m_valueString
Definition configimpl.h:278
void setValueString(const QCString &v)
Definition configimpl.h:268
Section marker for compile time optional options.
Definition configimpl.h:308
void writeXSDDoxyfile(TextStream &) override
Definition configimpl.l:632
void writeXMLDoxyfile(TextStream &) override
Definition configimpl.h:314
ConfigDisabled(const char *name)
Definition configimpl.h:310
void compareDoxyfile(TextStream &, Config::CompareMode) override
Definition configimpl.h:313
void writeTemplate(TextStream &, bool, bool) override
Definition configimpl.l:631
void substEnvVars() override
Definition configimpl.h:316
Class representing an enum type option.
Definition configimpl.h:156
void writeTemplate(TextStream &t, bool sl, bool) override
Definition configimpl.l:456
QCString m_defValue
Definition configimpl.h:181
void writeXSDDoxyfile(TextStream &t) override
Definition configimpl.l:490
void compareDoxyfile(TextStream &t, Config::CompareMode compareMode) override
Definition configimpl.l:473
bool isDefault() override
Definition configimpl.h:176
void writeXMLDoxyfile(TextStream &t) override
Definition configimpl.l:478
void init() override
Definition configimpl.h:175
void addValue(const char *v)
Definition configimpl.h:166
QCString * valueRef()
Definition configimpl.h:168
std::vector< QCString > m_valueRange
Definition configimpl.h:179
const std::vector< QCString > & values() const
Definition configimpl.h:167
ConfigEnum(const char *name, const char *doc, const char *defVal)
Definition configimpl.h:158
void substEnvVars() override
void convertStrToVal(Config::CompareMode compareMode) override
Definition configimpl.l:269
QCString m_value
Definition configimpl.h:180
ConfigInt * addInt(const char *name, const char *doc, int minVal, int maxVal, int defVal)
Definition configimpl.h:464
QCString takeStoreRepl()
Definition configimpl.h:602
ConfigEnum * addEnum(const char *name, const char *doc, const char *defVal)
Definition configimpl.h:437
ConfigOptionList m_options
Definition configimpl.h:614
static void deleteInstance()
Definition configimpl.h:356
QCString m_storeRepl
Definition configimpl.h:621
static void config_term(const char *fmt,...)
Definition configimpl.l:68
ConfigOptionList m_obsolete
Definition configimpl.h:615
ConfigOptionMap m_dict
Definition configimpl.h:617
void compareDoxyfile(TextStream &t, Config::CompareMode compareMode)
void convertStrToVal(Config::CompareMode compareMode)
void appendUserComment(const QCString &u)
Definition configimpl.h:571
ConfigOption * addDisabled(const char *name)
Definition configimpl.h:498
static ConfigImpl * instance()
Definition configimpl.h:350
void init()
ConfigList * addList(const char *name, const char *doc)
Definition configimpl.h:450
void substituteEnvironmentVars()
bool parseString(const QCString &fn, const QCString &str, bool upd=FALSE)
static void config_warn(const char *fmt,...)
Definition configimpl.l:78
void setHeader(const char *header)
Definition configimpl.h:528
QCString & getEnum(const char *fileName, int num, const char *name) const
Definition configimpl.l:323
bool parse(const QCString &fn, bool upd=FALSE)
QCString takeStartComment()
Definition configimpl.h:584
ConfigOption * get(const QCString &name) const
Definition configimpl.h:399
void appendStoreRepl(const QCString &u)
Definition configimpl.h:577
static void config_err(const char *fmt,...)
Definition configimpl.l:60
void appendStartComment(const QCString &u)
Definition configimpl.h:565
void writeXMLDoxyfile(TextStream &t)
StringVector & getList(const char *fileName, int num, const char *name) const
Definition configimpl.l:309
void writeXSDDoxyfile(TextStream &t)
QCString takeUserComment()
Definition configimpl.h:593
ConfigString * addString(const char *name, const char *doc)
Definition configimpl.h:424
void writeTemplate(TextStream &t, bool shortIndex, bool updateOnly)
ConfigInfo * addInfo(const char *name, const char *doc)
Definition configimpl.h:414
ConfigBool * addBool(const char *name, const char *doc, bool defVal)
Definition configimpl.h:478
QCString m_startComment
Definition configimpl.h:619
static std::unique_ptr< ConfigImpl > m_instance
Definition configimpl.h:618
bool & getBool(const char *fileName, int num, const char *name) const
Definition configimpl.l:351
ConfigOptionList m_disabled
Definition configimpl.h:616
QCString m_userComment
Definition configimpl.h:620
int & getInt(const char *fileName, int num, const char *name) const
Definition configimpl.l:337
ConfigOption * addObsolete(const char *name, ConfigOption::OptionType orgType)
Definition configimpl.h:489
void emptyValueToDefault()
QCString m_header
Definition configimpl.h:622
QCString & getString(const char *fileName, int num, const char *name) const
Definition configimpl.l:295
Section marker for grouping the configuration options.
Definition configimpl.h:106
void substEnvVars() override
Definition configimpl.h:118
void writeXMLDoxyfile(TextStream &) override
Definition configimpl.h:116
void writeXSDDoxyfile(TextStream &t) override
Definition configimpl.h:117
ConfigInfo(const char *name, const char *doc)
Definition configimpl.h:108
void compareDoxyfile(TextStream &, Config::CompareMode) override
Definition configimpl.h:115
void writeTemplate(TextStream &t, bool sl, bool) override
Definition configimpl.l:367
Class representing an integer type option.
Definition configimpl.h:219
ConfigInt(const char *name, const char *doc, int minVal, int maxVal, int defVal)
Definition configimpl.h:221
void init() override
Definition configimpl.h:241
QCString * valueStringRef()
Definition configimpl.h:231
int * valueRef()
Definition configimpl.h:232
bool isDefault() override
Definition configimpl.h:242
int maxVal() const
Definition configimpl.h:234
void writeXMLDoxyfile(TextStream &t) override
Definition configimpl.l:565
void convertStrToVal(Config::CompareMode compareMode) override
Definition configimpl.l:205
void writeXSDDoxyfile(TextStream &t) override
Definition configimpl.l:577
void compareDoxyfile(TextStream &t, Config::CompareMode compareMode) override
Definition configimpl.l:560
int m_defValue
Definition configimpl.h:245
QCString m_valueString
Definition configimpl.h:248
void writeTemplate(TextStream &t, bool sl, bool upd) override
Definition configimpl.l:536
int minVal() const
Definition configimpl.h:233
void substEnvVars() override
Class representing a list type option.
Definition configimpl.h:124
WidgetType m_widgetType
Definition configimpl.h:150
void setWidgetType(WidgetType w)
Definition configimpl.h:135
void substEnvVars() override
StringVector * valueRef()
Definition configimpl.h:137
void writeTemplate(TextStream &t, bool sl, bool) override
Definition configimpl.l:378
void init() override
Definition configimpl.h:145
void addValue(const char *v)
Definition configimpl.h:134
StringVector getDefault()
Definition configimpl.h:138
bool isDefault() override
Definition configimpl.l:395
ConfigList(const char *name, const char *doc)
Definition configimpl.h:127
StringVector m_defaultValue
Definition configimpl.h:149
StringVector m_value
Definition configimpl.h:148
void writeXMLDoxyfile(TextStream &t) override
Definition configimpl.l:432
WidgetType widgetType() const
Definition configimpl.h:136
void emptyValueToDefault() override
Definition configimpl.h:139
void writeXSDDoxyfile(TextStream &t) override
Definition configimpl.l:451
void compareDoxyfile(TextStream &t, Config::CompareMode compareMode) override
Definition configimpl.l:427
Section marker for obsolete options.
Definition configimpl.h:284
void writeXSDDoxyfile(TextStream &) override
Definition configimpl.h:291
OptionType m_orgType
Definition configimpl.h:299
ConfigObsolete(const char *name, OptionType orgType)
Definition configimpl.h:286
void markAsPresent()
Definition configimpl.h:296
bool isPresent() const
Definition configimpl.h:297
StringVector m_listvalue
Definition configimpl.h:300
QCString m_valueString
Definition configimpl.h:301
void writeTemplate(TextStream &, bool, bool) override
Definition configimpl.l:629
StringVector * valueListRef()
Definition configimpl.h:294
QCString * valueStringRef()
Definition configimpl.h:295
OptionType orgType() const
Definition configimpl.h:293
void substEnvVars() override
Definition configimpl.h:292
void writeXMLDoxyfile(TextStream &) override
Definition configimpl.h:290
void compareDoxyfile(TextStream &, Config::CompareMode) override
Definition configimpl.h:289
Abstract base class for any configuration option.
Definition configimpl.h:38
virtual void convertStrToVal(Config::CompareMode)
Definition configimpl.h:83
void setEncoding(const QCString &e)
Definition configimpl.h:75
virtual void init()
Definition configimpl.h:86
QCString m_doc
Definition configimpl.h:96
void addDependency(const char *dep)
Definition configimpl.h:74
virtual void writeXMLDoxyfile(TextStream &t)=0
void writeStringValue(TextStream &t, const QCString &s, bool initSpace=true, bool wasQuoted=false)
Definition configimpl.l:149
QCString docs() const
Definition configimpl.h:71
ConfigOption(OptionType t)
Definition configimpl.h:63
QCString m_encoding
Definition configimpl.h:98
QCString m_name
Definition configimpl.h:95
QCString m_dependency
Definition configimpl.h:97
virtual void writeTemplate(TextStream &t, bool sl, bool upd)=0
void setUserComment(const QCString &u)
Definition configimpl.h:76
QCString m_userComment
Definition configimpl.h:99
OptionType m_kind
Definition configimpl.h:100
void writeIntValue(TextStream &t, int i, bool initSpace=true)
Definition configimpl.l:143
void writeStringList(TextStream &t, const StringVector &l)
Definition configimpl.l:181
virtual void writeXSDDoxyfile(TextStream &t)=0
friend class ConfigImpl
Definition configimpl.h:39
QCString dependsOn() const
Definition configimpl.h:73
QCString m_spaces
Definition configimpl.h:94
virtual void emptyValueToDefault()
Definition configimpl.h:84
QCString name() const
Definition configimpl.h:70
virtual void compareDoxyfile(TextStream &t, Config::CompareMode compareMode)=0
@ O_Disabled
Disabled compile time option.
Definition configimpl.h:54
@ O_List
A list of items.
Definition configimpl.h:48
@ O_Enum
A fixed set of items.
Definition configimpl.h:49
@ O_Bool
A boolean value.
Definition configimpl.h:52
@ O_String
A single item.
Definition configimpl.h:50
@ O_Obsolete
An obsolete option.
Definition configimpl.h:53
@ O_Int
An integer value.
Definition configimpl.h:51
@ O_Info
A section header.
Definition configimpl.h:47
virtual void substEnvVars()=0
void writeBoolValue(TextStream &t, bool v, bool initSpace=true)
Definition configimpl.l:137
OptionType kind() const
Definition configimpl.h:69
virtual bool isDefault()
Definition configimpl.h:87
Class representing a string type option.
Definition configimpl.h:187
QCString m_value
Definition configimpl.h:211
void substEnvVars() override
bool isDefault() override
Definition configimpl.h:208
void setWidgetType(WidgetType w)
Definition configimpl.h:197
void writeXSDDoxyfile(TextStream &t) override
Definition configimpl.l:531
WidgetType m_widgetType
Definition configimpl.h:213
WidgetType widgetType() const
Definition configimpl.h:198
void writeXMLDoxyfile(TextStream &t) override
Definition configimpl.l:517
QCString * valueRef()
Definition configimpl.h:200
void writeTemplate(TextStream &t, bool sl, bool) override
Definition configimpl.l:495
void setDefaultValue(const char *v)
Definition configimpl.h:199
void emptyValueToDefault() override
Definition configimpl.h:207
QCString m_defValue
Definition configimpl.h:212
void init() override
Definition configimpl.h:206
void compareDoxyfile(TextStream &t, Config::CompareMode compareMode) override
Definition configimpl.l:512
ConfigString(const char *name, const char *doc)
Definition configimpl.h:190
This is an alternative implementation of QCString.
Definition qcstring.h:101
const std::string & str() const
Definition qcstring.h:537
Text streaming class that buffers data.
Definition textstream.h:36
std::vector< std::unique_ptr< ConfigOption > > ConfigOptionList
Definition configimpl.h:327
std::unordered_map< std::string, ConfigOption * > ConfigOptionMap
Definition configimpl.h:328
#define ABSTRACT_BASE_CLASS(cls)
Macro to implement rule of 5 for an abstract base class.
Definition construct.h:20
std::vector< std::string > StringVector
Definition containers.h:33
CompareMode
Definition config.h:54
Definition trace.h:153
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:477
#define FALSE
Definition qcstring.h:34