Doxygen
configimpl.h
浏览该文件的文档.
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 
31 class TextStream;
32 
33 /** Abstract base class for any configuration option.
34  */
36 {
37  friend class ConfigImpl;
38 
39  public:
40 
41  /*! The type of option */
43  {
44  O_Info, //!< A section header
45  O_List, //!< A list of items
46  O_Enum, //!< A fixed set of items
47  O_String, //!< A single item
48  O_Int, //!< An integer value
49  O_Bool, //!< A boolean value
50  O_Obsolete, //!< An obsolete option
51  O_Disabled //!< Disabled compile time option
52  };
53  enum
54  {
55  /*! Maximum length of an option in the config file. Used for
56  * alignment purposes.
57  */
59  };
61  {
62  m_spaces.fill(' ',40);
63  }
64  virtual ~ConfigOption()
65  {
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) = 0;
81  virtual void writeXMLDoxyfile(TextStream &t) = 0;
82  virtual void convertStrToVal() {}
83  virtual void emptyValueToDefault() {}
84  virtual void substEnvVars() = 0;
85  virtual void init() {}
86  virtual bool isDefault() { return true; }
87 
88  void writeBoolValue(TextStream &t,bool v,bool initSpace = true);
89  void writeIntValue(TextStream &t,int i,bool initSpace = true);
90  void writeStringValue(TextStream &t,const QCString &s,bool initSpace = true);
91  void writeStringList(TextStream &t,const StringVector &l);
92 
100 };
101 
102 /** Section marker for grouping the configuration options.
103  */
104 class ConfigInfo : public ConfigOption
105 {
106  public:
107  ConfigInfo(const char *name,const char *doc)
109  {
110  m_name = name;
111  m_doc = doc;
112  }
113  void writeTemplate(TextStream &t, bool sl,bool);
116  void substEnvVars() {}
117 };
118 
119 /** Class respresenting a list type option.
120  */
121 class ConfigList : public ConfigOption
122 {
123  public:
125  ConfigList(const char *name,const char *doc)
127  {
128  m_name = name;
129  m_doc = doc;
131  }
132  void addValue(const char *v) { m_defaultValue.push_back(v); }
134  WidgetType widgetType() const { return m_widgetType; }
135  StringVector *valueRef() { return &m_value; }
137  void emptyValueToDefault() { if (m_value.empty() && !m_defaultValue.empty()) m_value=m_defaultValue; };
138  void writeTemplate(TextStream &t,bool sl,bool);
139  void compareDoxyfile(TextStream &t);
140  void writeXMLDoxyfile(TextStream &t);
141  void substEnvVars();
143  bool isDefault();
144  private:
148 };
149 
150 /** Class representing an enum type option.
151  */
152 class ConfigEnum : public ConfigOption
153 {
154  public:
155  ConfigEnum(const char *name,const char *doc,const char *defVal)
157  {
158  m_name = name;
159  m_doc = doc;
160  m_value = defVal;
161  m_defValue = defVal;
162  }
163  void addValue(const char *v) { m_valueRange.push_back(v); }
164  const std::vector<QCString> &values() const { return m_valueRange; }
165  QCString *valueRef() { return &m_value; }
166  void substEnvVars();
167  void writeTemplate(TextStream &t,bool sl,bool);
168  void convertStrToVal();
169  void compareDoxyfile(TextStream &t);
170  void writeXMLDoxyfile(TextStream &t);
171  void init() { m_value = m_defValue; }
172  bool isDefault() { return m_value == m_defValue; }
173 
174  private:
175  std::vector<QCString> m_valueRange;
178 };
179 
180 /** Class representing a string type option.
181  */
183 {
184  public:
186  ConfigString(const char *name,const char *doc)
188  {
189  m_name = name;
190  m_doc = doc;
192  }
194  {
195  }
197  WidgetType widgetType() const { return m_widgetType; }
198  void setDefaultValue(const char *v) { m_defValue = v; }
199  QCString *valueRef() { return &m_value; }
200  void writeTemplate(TextStream &t,bool sl,bool);
201  void compareDoxyfile(TextStream &t);
202  void writeXMLDoxyfile(TextStream &t);
203  void substEnvVars();
204  void init() { m_value = m_defValue; }
207 
208  private:
212 };
213 
214 /** Class representing an integer type option.
215  */
216 class ConfigInt : public ConfigOption
217 {
218  public:
219  ConfigInt(const char *name,const char *doc,int minVal,int maxVal,int defVal)
221  {
222  m_name = name;
223  m_doc = doc;
224  m_value = defVal;
225  m_defValue = defVal;
226  m_minVal = minVal;
227  m_maxVal = maxVal;
228  }
230  int *valueRef() { return &m_value; }
231  int minVal() const { return m_minVal; }
232  int maxVal() const { return m_maxVal; }
233  void convertStrToVal();
234  void substEnvVars();
235  void writeTemplate(TextStream &t,bool sl,bool upd);
236  void compareDoxyfile(TextStream &t);
237  void writeXMLDoxyfile(TextStream &t);
238  void init() { m_value = m_defValue; }
239  bool isDefault() { return m_value == m_defValue; }
240  private:
241  int m_value;
243  int m_minVal;
244  int m_maxVal;
246 };
247 
248 /** Class representing a Boolean type option.
249  */
250 class ConfigBool : public ConfigOption
251 {
252  public:
253  ConfigBool(const char *name,const char *doc,bool defVal)
255  {
256  m_name = name;
257  m_doc = doc;
258  m_value = defVal;
259  m_defValue = defVal;
260  }
262  bool *valueRef() { return &m_value; }
263  void convertStrToVal();
264  void substEnvVars();
265  void setValueString(const QCString &v) { m_valueString = v; }
266  void writeTemplate(TextStream &t,bool sl,bool upd);
267  void compareDoxyfile(TextStream &t);
268  void writeXMLDoxyfile(TextStream &t);
269  void init() { m_value = m_defValue; }
270  bool isDefault() { return m_value == m_defValue; }
271  private:
272  bool m_value;
275 };
276 
277 /** Section marker for obsolete options
278  */
280 {
281  public:
283  { m_name = name; }
284  void writeTemplate(TextStream &,bool,bool);
287  void substEnvVars() {}
288  OptionType orgType() const { return m_orgType; }
291  void markAsPresent() { m_present = true; }
292  bool isPresent() const { return m_present; }
293  private:
297  bool m_present = false;
298 };
299 
300 /** Section marker for compile time optional options
301  */
303 {
304  public:
306  { m_name = name; }
307  void writeTemplate(TextStream &,bool,bool);
310  void substEnvVars() {}
311 };
312 
313 // some convenience macros for access the config options
314 #define ConfigImpl_getString(val) ConfigImpl::instance()->getString(__FILE__,__LINE__,val)
315 #define ConfigImpl_getInt(val) ConfigImpl::instance()->getInt(__FILE__,__LINE__,val)
316 #define ConfigImpl_getList(val) ConfigImpl::instance()->getList(__FILE__,__LINE__,val)
317 #define ConfigImpl_getEnum(val) ConfigImpl::instance()->getEnum(__FILE__,__LINE__,val)
318 #define ConfigImpl_getBool(val) ConfigImpl::instance()->getBool(__FILE__,__LINE__,val)
319 
320 
321 using ConfigOptionList = std::vector< std::unique_ptr<ConfigOption> >;
322 using ConfigOptionMap = std::unordered_map< std::string, ConfigOption* >;
323 
324 /** Singleton for configuration variables.
325  *
326  * This object holds the global static variables
327  * read from a user-supplied configuration file.
328  * The static member instance() can be used to get
329  * a pointer to the one and only instance.
330  *
331  * Set all variables to their default values by
332  * calling Config::instance()->init()
333  *
334  */
336 {
337  public:
338  /////////////////////////////
339  // public API
340  /////////////////////////////
341 
342  /*! Returns the one and only instance of this class */
344  {
345  if (m_instance==0) m_instance = new ConfigImpl;
346  return m_instance;
347  }
348  /*! Delete the instance */
349  static void deleteInstance()
350  {
351  delete m_instance;
352  m_instance=0;
353  }
354 
355  /*!
356  * @name Getting configuration values.
357  * @{
358  */
359 
360  /*! Returns the value of the string option with name \a fileName.
361  * The arguments \a num and \a name are for debugging purposes only.
362  * There is a convenience function Config_getString() for this.
363  */
364  QCString &getString(const char *fileName,int num,const char *name) const;
365 
366  /*! Returns the value of the list 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_getList() for this.
369  */
370  StringVector &getList(const char *fileName,int num,const char *name) const;
371 
372  /*! Returns the value of the enum 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_getEnum() for this.
375  */
376  QCString &getEnum(const char *fileName,int num,const char *name) const;
377 
378  /*! Returns the value of the integer 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_getInt() for this.
381  */
382  int &getInt(const char *fileName,int num,const char *name) const;
383 
384  /*! Returns the value of the boolean 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_getBool() for this.
387  */
388  bool &getBool(const char *fileName,int num,const char *name) const;
389 
390  /*! Returns the ConfigOption corresponding with \a name or 0 if
391  * the option is not supported.
392  */
393  ConfigOption *get(const QCString &name) const
394  {
395  auto it = m_dict.find(name.str());
396  return it!=m_dict.end() ? it->second : nullptr;
397  }
398  /* @} */
399 
400  /*!
401  * @name Adding configuration options.
402  * @{
403  */
404 
405  /*! Starts a new configuration section with \a name and description \a doc.
406  * \returns An object representing the option.
407  */
408  ConfigInfo *addInfo(const char *name,const char *doc)
409  {
410  ConfigInfo *result = new ConfigInfo(name,doc);
411  m_options.push_back(std::unique_ptr<ConfigOption>(result));
412  return result;
413  }
414 
415  /*! Adds a new string option with \a name and documentation \a doc.
416  * \returns An object representing the option.
417  */
418  ConfigString *addString(const char *name,
419  const char *doc)
420  {
421  ConfigString *result = new ConfigString(name,doc);
422  m_options.push_back(std::unique_ptr<ConfigOption>(result));
423  m_dict.insert(std::make_pair(name,result));
424  return result;
425  }
426 
427  /*! Adds a new enumeration option with \a name and documentation \a doc
428  * and initial value \a defVal.
429  * \returns An object representing the option.
430  */
431  ConfigEnum *addEnum(const char *name,
432  const char *doc,
433  const char *defVal)
434  {
435  ConfigEnum *result = new ConfigEnum(name,doc,defVal);
436  m_options.push_back(std::unique_ptr<ConfigOption>(result));
437  m_dict.insert(std::make_pair(name,result));
438  return result;
439  }
440 
441  /*! Adds a new string option with \a name and documentation \a doc.
442  * \returns An object representing the option.
443  */
444  ConfigList *addList(const char *name,
445  const char *doc)
446  {
447  ConfigList *result = new ConfigList(name,doc);
448  m_options.push_back(std::unique_ptr<ConfigOption>(result));
449  m_dict.insert(std::make_pair(name,result));
450  return result;
451  }
452 
453  /*! Adds a new integer option with \a name and documentation \a doc.
454  * The integer has a range between \a minVal and \a maxVal and a
455  * default value of \a defVal.
456  * \returns An object representing the option.
457  */
458  ConfigInt *addInt(const char *name,
459  const char *doc,
460  int minVal,int maxVal,int defVal)
461  {
462  ConfigInt *result = new ConfigInt(name,doc,minVal,maxVal,defVal);
463  m_options.push_back(std::unique_ptr<ConfigOption>(result));
464  m_dict.insert(std::make_pair(name,result));
465  return result;
466  }
467 
468  /*! Adds a new boolean option with \a name and documentation \a doc.
469  * The boolean has a default value of \a defVal.
470  * \returns An object representing the option.
471  */
472  ConfigBool *addBool(const char *name,
473  const char *doc,
474  bool defVal)
475  {
476  ConfigBool *result = new ConfigBool(name,doc,defVal);
477  m_options.push_back(std::unique_ptr<ConfigOption>(result));
478  m_dict.insert(std::make_pair(name,result));
479  return result;
480  }
481  /*! Adds an option that has become obsolete. */
483  {
484  ConfigObsolete *result = new ConfigObsolete(name,orgType);
485  m_obsolete.push_back(std::unique_ptr<ConfigOption>(result));
486  m_dict.insert(std::make_pair(name,result));
487  return result;
488  }
489  /*! Adds an option that has been disabled at compile time. */
490  ConfigOption *addDisabled(const char *name)
491  {
492  ConfigDisabled *result = new ConfigDisabled(name);
493  m_disabled.push_back(std::unique_ptr<ConfigOption>(result));
494  m_dict.insert(std::make_pair(name,result));
495  return result;
496  }
497  /*! @} */
498 
499  /*! Writes a template configuration to stream \a t. If \a shortIndex
500  * is \c TRUE the description of each configuration option will
501  * be omitted.
502  */
503  void writeTemplate(TextStream &t,bool shortIndex,bool updateOnly);
504 
505  /*! Writes a the differences between the current configuration and the
506  * template configuration to stream \a t.
507  */
508  void compareDoxyfile(TextStream &t);
509 
510  /*! Writes a the used settings of the current configuration as XML format
511  * to stream \a t.
512  */
513  void writeXMLDoxyfile(TextStream &t);
514 
515  void setHeader(const char *header) { m_header = header; }
516 
517  /////////////////////////////
518  // internal API
519  /////////////////////////////
520 
521  /*! Converts the string values read from the configuration file
522  * to real values for non-string type options (like int, and bools)
523  */
524  void convertStrToVal();
525 
526  /*! Sets default value in case value is empty
527  */
528  void emptyValueToDefault();
529 
530  /*! Replaces references to environment variable by the actual value
531  * of the environment variable.
532  */
534 
535  /*! Initialize config variables to their default value */
536  void init();
537 
538  /*! Parse a configuration data in string \a str.
539  * \returns TRUE if successful, or FALSE if the string could not be
540  * parsed.
541  */
542  bool parseString(const QCString &fn,const QCString &str,bool upd = FALSE);
543 
544  /*! Parse a configuration file with name \a fn.
545  * \returns TRUE if successful, FALSE if the file could not be
546  * opened or read.
547  */
548  bool parse(const QCString &fn,bool upd = FALSE);
549 
550  /*! Called from the constructor, will add doxygen's default options
551  * to the configuration object
552  */
553  void create();
554 
555  /*! Append user start comment
556  */
558  {
559  m_startComment += u;
560  }
561  /*! Append user comment
562  */
564  {
565  m_userComment += u;
566  }
567  /*! Take the user start comment and reset it internally
568  * \returns user start comment
569  */
571  {
572  QCString result=m_startComment;
574  return substitute(result,"\r","");
575  }
576  /*! Take the user comment and reset it internally
577  * \returns user comment
578  */
580  {
581  QCString result=m_userComment;
583  return substitute(result,"\r","");
584  }
585 
586  protected:
587 
589  {
591  create();
592  }
594  {
595  }
596 
597  private:
607 };
608 
609 #endif
StringVector
std::vector< std::string > StringVector
Definition: containers.h:32
ConfigBool::valueStringRef
QCString * valueStringRef()
Definition: configimpl.h:261
ConfigString::substEnvVars
void substEnvVars()
ConfigList::getDefault
StringVector getDefault()
Definition: configimpl.h:136
ConfigEnum::ConfigEnum
ConfigEnum(const char *name, const char *doc, const char *defVal)
Definition: configimpl.h:155
ConfigOption::substEnvVars
virtual void substEnvVars()=0
ConfigImpl::appendUserComment
void appendUserComment(const QCString &u)
Definition: configimpl.h:563
ConfigImpl::m_startComment
QCString m_startComment
Definition: configimpl.h:603
ConfigObsolete::valueListRef
StringVector * valueListRef()
Definition: configimpl.h:289
ConfigEnum::writeTemplate
void writeTemplate(TextStream &t, bool sl, bool)
ConfigImpl::getList
StringVector & getList(const char *fileName, int num, const char *name) const
ConfigString::File
@ File
Definition: configimpl.h:185
ConfigString
Class representing a string type option.
Definition: configimpl.h:182
ConfigObsolete::m_listvalue
StringVector m_listvalue
Definition: configimpl.h:295
ConfigEnum::m_defValue
QCString m_defValue
Definition: configimpl.h:177
ConfigImpl::m_dict
ConfigOptionMap m_dict
Definition: configimpl.h:601
ConfigImpl::takeUserComment
QCString takeUserComment()
Definition: configimpl.h:579
ConfigEnum::addValue
void addValue(const char *v)
Definition: configimpl.h:163
ConfigOption::m_kind
OptionType m_kind
Definition: configimpl.h:99
ConfigOption::MAX_OPTION_LENGTH
@ MAX_OPTION_LENGTH
Definition: configimpl.h:58
ConfigEnum::m_valueRange
std::vector< QCString > m_valueRange
Definition: configimpl.h:175
ConfigImpl::addList
ConfigList * addList(const char *name, const char *doc)
Definition: configimpl.h:444
ConfigOption::kind
OptionType kind() const
Definition: configimpl.h:69
ConfigImpl::setHeader
void setHeader(const char *header)
Definition: configimpl.h:515
ConfigObsolete::ConfigObsolete
ConfigObsolete(const char *name, OptionType orgType)
Definition: configimpl.h:282
ConfigImpl::substituteEnvironmentVars
void substituteEnvironmentVars()
ConfigOption::O_List
@ O_List
A list of items
Definition: configimpl.h:45
ConfigOption::isDefault
virtual bool isDefault()
Definition: configimpl.h:86
ConfigOption::name
QCString name() const
Definition: configimpl.h:70
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
ConfigOptionList
std::vector< std::unique_ptr< ConfigOption > > ConfigOptionList
Definition: configimpl.h:321
ConfigList::isDefault
bool isDefault()
ConfigImpl::deleteInstance
static void deleteInstance()
Definition: configimpl.h:349
ConfigBool::substEnvVars
void substEnvVars()
ConfigEnum::compareDoxyfile
void compareDoxyfile(TextStream &t)
ConfigOption::writeBoolValue
void writeBoolValue(TextStream &t, bool v, bool initSpace=true)
ConfigList::m_defaultValue
StringVector m_defaultValue
Definition: configimpl.h:146
ConfigOption::m_dependency
QCString m_dependency
Definition: configimpl.h:96
ConfigOption::m_spaces
QCString m_spaces
Definition: configimpl.h:93
ConfigInt::valueStringRef
QCString * valueStringRef()
Definition: configimpl.h:229
ConfigBool::valueRef
bool * valueRef()
Definition: configimpl.h:262
ConfigEnum::substEnvVars
void substEnvVars()
QCString::str
std::string str() const
Definition: qcstring.h:442
ConfigInfo::ConfigInfo
ConfigInfo(const char *name, const char *doc)
Definition: configimpl.h:107
ConfigObsolete::markAsPresent
void markAsPresent()
Definition: configimpl.h:291
ConfigInt::m_defValue
int m_defValue
Definition: configimpl.h:242
ConfigList::setWidgetType
void setWidgetType(WidgetType w)
Definition: configimpl.h:133
ConfigImpl::get
ConfigOption * get(const QCString &name) const
Definition: configimpl.h:393
ConfigString::String
@ String
Definition: configimpl.h:185
ConfigString::~ConfigString
~ConfigString()
Definition: configimpl.h:193
ConfigObsolete::isPresent
bool isPresent() const
Definition: configimpl.h:292
ConfigInfo
Section marker for grouping the configuration options.
Definition: configimpl.h:104
ConfigOption::O_String
@ O_String
A single item
Definition: configimpl.h:47
ConfigString::m_defValue
QCString m_defValue
Definition: configimpl.h:210
ConfigBool::m_defValue
bool m_defValue
Definition: configimpl.h:273
ConfigImpl::appendStartComment
void appendStartComment(const QCString &u)
Definition: configimpl.h:557
ConfigList::init
void init()
Definition: configimpl.h:142
ConfigImpl::create
void create()
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
ConfigBool::setValueString
void setValueString(const QCString &v)
Definition: configimpl.h:265
ConfigOption::OptionType
OptionType
Definition: configimpl.h:42
ConfigImpl::m_obsolete
ConfigOptionList m_obsolete
Definition: configimpl.h:599
ConfigImpl::emptyValueToDefault
void emptyValueToDefault()
ConfigOption::writeIntValue
void writeIntValue(TextStream &t, int i, bool initSpace=true)
ConfigList::addValue
void addValue(const char *v)
Definition: configimpl.h:132
ConfigImpl::m_initialized
bool m_initialized
Definition: configimpl.h:605
qcstring.h
ConfigOption::writeStringList
void writeStringList(TextStream &t, const StringVector &l)
ConfigBool
Class representing a Boolean type option.
Definition: configimpl.h:250
ConfigList
Class respresenting a list type option.
Definition: configimpl.h:121
ConfigInfo::writeTemplate
void writeTemplate(TextStream &t, bool sl, bool)
ConfigOption::setUserComment
void setUserComment(const QCString &u)
Definition: configimpl.h:76
ConfigOption::O_Obsolete
@ O_Obsolete
An obsolete option
Definition: configimpl.h:50
ConfigImpl::getEnum
QCString & getEnum(const char *fileName, int num, const char *name) const
ConfigInt::valueRef
int * valueRef()
Definition: configimpl.h:230
ConfigObsolete::m_present
bool m_present
Definition: configimpl.h:297
ConfigString::m_value
QCString m_value
Definition: configimpl.h:209
ConfigObsolete::writeTemplate
void writeTemplate(TextStream &, bool, bool)
ConfigObsolete::compareDoxyfile
void compareDoxyfile(TextStream &)
Definition: configimpl.h:285
ConfigDisabled::ConfigDisabled
ConfigDisabled(const char *name)
Definition: configimpl.h:305
ConfigList::File
@ File
Definition: configimpl.h:124
ConfigImpl::writeXMLDoxyfile
void writeXMLDoxyfile(TextStream &t)
ConfigEnum::isDefault
bool isDefault()
Definition: configimpl.h:172
ConfigObsolete::m_valueString
QCString m_valueString
Definition: configimpl.h:296
ConfigOption::O_Enum
@ O_Enum
A fixed set of items
Definition: configimpl.h:46
ConfigList::valueRef
StringVector * valueRef()
Definition: configimpl.h:135
ConfigBool::writeXMLDoxyfile
void writeXMLDoxyfile(TextStream &t)
ConfigOption::O_Int
@ O_Int
An integer value
Definition: configimpl.h:48
ConfigBool::ConfigBool
ConfigBool(const char *name, const char *doc, bool defVal)
Definition: configimpl.h:253
ConfigInt::maxVal
int maxVal() const
Definition: configimpl.h:232
Image
Class representing a bitmap image generated by doxygen.
Definition: image.h:26
ConfigObsolete::writeXMLDoxyfile
void writeXMLDoxyfile(TextStream &)
Definition: configimpl.h:286
ConfigOption::m_name
QCString m_name
Definition: configimpl.h:94
ConfigOption::dependsOn
QCString dependsOn() const
Definition: configimpl.h:73
ConfigImpl::addInfo
ConfigInfo * addInfo(const char *name, const char *doc)
Definition: configimpl.h:408
ConfigString::Dir
@ Dir
Definition: configimpl.h:185
ConfigOption::convertStrToVal
virtual void convertStrToVal()
Definition: configimpl.h:82
ConfigOption::m_userComment
QCString m_userComment
Definition: configimpl.h:98
ConfigBool::writeTemplate
void writeTemplate(TextStream &t, bool sl, bool upd)
ConfigImpl::convertStrToVal
void convertStrToVal()
ConfigImpl
Singleton for configuration variables.
Definition: configimpl.h:335
QCString::stripWhiteSpace
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition: qcstring.h:243
ConfigImpl::m_userComment
QCString m_userComment
Definition: configimpl.h:604
ConfigString::init
void init()
Definition: configimpl.h:204
ConfigBool::m_value
bool m_value
Definition: configimpl.h:272
ConfigInt::isDefault
bool isDefault()
Definition: configimpl.h:239
ConfigString::setDefaultValue
void setDefaultValue(const char *v)
Definition: configimpl.h:198
ConfigDisabled::writeXMLDoxyfile
void writeXMLDoxyfile(TextStream &)
Definition: configimpl.h:309
ConfigOption
Abstract base class for any configuration option.
Definition: configimpl.h:35
ConfigList::emptyValueToDefault
void emptyValueToDefault()
Definition: configimpl.h:137
ConfigString::writeXMLDoxyfile
void writeXMLDoxyfile(TextStream &t)
ConfigImpl::addDisabled
ConfigOption * addDisabled(const char *name)
Definition: configimpl.h:490
ConfigInt::convertStrToVal
void convertStrToVal()
ConfigOption::~ConfigOption
virtual ~ConfigOption()
Definition: configimpl.h:64
ConfigImpl::m_header
QCString m_header
Definition: configimpl.h:606
ConfigEnum::init
void init()
Definition: configimpl.h:171
ConfigEnum::values
const std::vector< QCString > & values() const
Definition: configimpl.h:164
ConfigList::ConfigList
ConfigList(const char *name, const char *doc)
Definition: configimpl.h:125
ConfigImpl::takeStartComment
QCString takeStartComment()
Definition: configimpl.h:570
ConfigInfo::substEnvVars
void substEnvVars()
Definition: configimpl.h:116
ConfigInt::compareDoxyfile
void compareDoxyfile(TextStream &t)
ConfigBool::m_valueString
QCString m_valueString
Definition: configimpl.h:274
ConfigOption::init
virtual void init()
Definition: configimpl.h:85
ConfigString::isDefault
bool isDefault()
Definition: configimpl.h:206
ConfigImpl::addString
ConfigString * addString(const char *name, const char *doc)
Definition: configimpl.h:418
ConfigInt
Class representing an integer type option.
Definition: configimpl.h:216
ConfigOption::writeTemplate
virtual void writeTemplate(TextStream &t, bool sl, bool upd)=0
ConfigList::writeTemplate
void writeTemplate(TextStream &t, bool sl, bool)
ConfigString::compareDoxyfile
void compareDoxyfile(TextStream &t)
ConfigString::valueRef
QCString * valueRef()
Definition: configimpl.h:199
ConfigImpl::compareDoxyfile
void compareDoxyfile(TextStream &t)
ConfigString::ConfigString
ConfigString(const char *name, const char *doc)
Definition: configimpl.h:186
ConfigOption::O_Bool
@ O_Bool
A boolean value
Definition: configimpl.h:49
ConfigInt::writeTemplate
void writeTemplate(TextStream &t, bool sl, bool upd)
ConfigOption::ConfigOption
ConfigOption(OptionType t)
Definition: configimpl.h:60
ConfigImpl::m_disabled
ConfigOptionList m_disabled
Definition: configimpl.h:600
ConfigList::WidgetType
WidgetType
Definition: configimpl.h:124
ConfigString::setWidgetType
void setWidgetType(WidgetType w)
Definition: configimpl.h:196
ConfigInfo::writeXMLDoxyfile
void writeXMLDoxyfile(TextStream &)
Definition: configimpl.h:115
ConfigOption::compareDoxyfile
virtual void compareDoxyfile(TextStream &t)=0
ConfigEnum::convertStrToVal
void convertStrToVal()
QCString::fill
bool fill(char c, int len=-1)
Fills a string with a predefined character
Definition: qcstring.h:175
ConfigInt::m_minVal
int m_minVal
Definition: configimpl.h:243
ConfigList::m_value
StringVector m_value
Definition: configimpl.h:145
ConfigBool::convertStrToVal
void convertStrToVal()
ConfigList::writeXMLDoxyfile
void writeXMLDoxyfile(TextStream &t)
ConfigEnum
Class representing an enum type option.
Definition: configimpl.h:152
ConfigImpl::m_options
ConfigOptionList m_options
Definition: configimpl.h:598
ConfigEnum::writeXMLDoxyfile
void writeXMLDoxyfile(TextStream &t)
ConfigImpl::writeTemplate
void writeTemplate(TextStream &t, bool shortIndex, bool updateOnly)
ConfigEnum::valueRef
QCString * valueRef()
Definition: configimpl.h:165
ConfigList::String
@ String
Definition: configimpl.h:124
ConfigInt::writeXMLDoxyfile
void writeXMLDoxyfile(TextStream &t)
ConfigObsolete::substEnvVars
void substEnvVars()
Definition: configimpl.h:287
ConfigObsolete
Section marker for obsolete options
Definition: configimpl.h:279
ConfigOptionMap
std::unordered_map< std::string, ConfigOption * > ConfigOptionMap
Definition: configimpl.h:322
ConfigImpl::parseString
bool parseString(const QCString &fn, const QCString &str, bool upd=FALSE)
ConfigOption::addDependency
void addDependency(const char *dep)
Definition: configimpl.h:74
containers.h
ConfigImpl::~ConfigImpl
~ConfigImpl()
Definition: configimpl.h:593
ConfigInfo::compareDoxyfile
void compareDoxyfile(TextStream &)
Definition: configimpl.h:114
ConfigObsolete::orgType
OptionType orgType() const
Definition: configimpl.h:288
ConfigOption::writeStringValue
void writeStringValue(TextStream &t, const QCString &s, bool initSpace=true)
substitute
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition: qcstring.cpp:465
ConfigInt::substEnvVars
void substEnvVars()
ConfigList::FileAndDir
@ FileAndDir
Definition: configimpl.h:124
ConfigImpl::m_instance
static ConfigImpl * m_instance
Definition: configimpl.h:602
ConfigImpl::getInt
int & getInt(const char *fileName, int num, const char *name) const
ConfigInt::m_maxVal
int m_maxVal
Definition: configimpl.h:244
ConfigObsolete::m_orgType
OptionType m_orgType
Definition: configimpl.h:294
ConfigString::emptyValueToDefault
void emptyValueToDefault()
Definition: configimpl.h:205
ConfigBool::init
void init()
Definition: configimpl.h:269
ConfigImpl::instance
static ConfigImpl * instance()
Definition: configimpl.h:343
ConfigInt::m_valueString
QCString m_valueString
Definition: configimpl.h:245
ConfigList::compareDoxyfile
void compareDoxyfile(TextStream &t)
ConfigString::WidgetType
WidgetType
Definition: configimpl.h:185
ConfigEnum::m_value
QCString m_value
Definition: configimpl.h:176
ConfigImpl::getString
QCString & getString(const char *fileName, int num, const char *name) const
ConfigOption::writeXMLDoxyfile
virtual void writeXMLDoxyfile(TextStream &t)=0
ConfigObsolete::valueStringRef
QCString * valueStringRef()
Definition: configimpl.h:290
ConfigImpl::addBool
ConfigBool * addBool(const char *name, const char *doc, bool defVal)
Definition: configimpl.h:472
ConfigBool::isDefault
bool isDefault()
Definition: configimpl.h:270
ConfigOption::m_doc
QCString m_doc
Definition: configimpl.h:95
ConfigOption::O_Disabled
@ O_Disabled
Disabled compile time option
Definition: configimpl.h:51
ConfigList::Dir
@ Dir
Definition: configimpl.h:124
ConfigInt::minVal
int minVal() const
Definition: configimpl.h:231
ConfigImpl::init
void init()
ConfigOption::m_encoding
QCString m_encoding
Definition: configimpl.h:97
ConfigInt::m_value
int m_value
Definition: configimpl.h:241
ConfigString::widgetType
WidgetType widgetType() const
Definition: configimpl.h:197
ConfigOption::emptyValueToDefault
virtual void emptyValueToDefault()
Definition: configimpl.h:83
ConfigBool::compareDoxyfile
void compareDoxyfile(TextStream &t)
ConfigList::widgetType
WidgetType widgetType() const
Definition: configimpl.h:134
ConfigString::m_widgetType
WidgetType m_widgetType
Definition: configimpl.h:211
ConfigOption::docs
QCString docs() const
Definition: configimpl.h:71
ConfigImpl::parse
bool parse(const QCString &fn, bool upd=FALSE)
ConfigInt::init
void init()
Definition: configimpl.h:238
ConfigDisabled::writeTemplate
void writeTemplate(TextStream &, bool, bool)
ConfigDisabled
Section marker for compile time optional options
Definition: configimpl.h:302
ConfigImpl::getBool
bool & getBool(const char *fileName, int num, const char *name) const
ConfigOption::O_Info
@ O_Info
A section header
Definition: configimpl.h:44
ConfigList::m_widgetType
WidgetType m_widgetType
Definition: configimpl.h:147
ConfigImpl::addInt
ConfigInt * addInt(const char *name, const char *doc, int minVal, int maxVal, int defVal)
Definition: configimpl.h:458
ConfigImpl::addObsolete
ConfigOption * addObsolete(const char *name, ConfigOption::OptionType orgType)
Definition: configimpl.h:482
ConfigDisabled::compareDoxyfile
void compareDoxyfile(TextStream &)
Definition: configimpl.h:308
QCString::resize
bool resize(size_t newlen)
Resizes the string to hold newlen characters (this value should also count the 0-terminator).
Definition: qcstring.h:164
ConfigInt::ConfigInt
ConfigInt(const char *name, const char *doc, int minVal, int maxVal, int defVal)
Definition: configimpl.h:219
ConfigImpl::addEnum
ConfigEnum * addEnum(const char *name, const char *doc, const char *defVal)
Definition: configimpl.h:431
ConfigDisabled::substEnvVars
void substEnvVars()
Definition: configimpl.h:310
ConfigString::writeTemplate
void writeTemplate(TextStream &t, bool sl, bool)
ConfigOption::setEncoding
void setEncoding(const QCString &e)
Definition: configimpl.h:75
ConfigImpl::ConfigImpl
ConfigImpl()
Definition: configimpl.h:588
FALSE
#define FALSE
Definition: qcstring.h:33
ConfigList::substEnvVars
void substEnvVars()
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108