Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Config Class Reference

#include <config.h>

Public Member Functions

QListIterator< ConfigOptioniterator ()
 
void writeTemplate (FTextStream &t, bool shortIndex, bool updateOnly)
 
void setHeader (const char *header)
 
void convertStrToVal ()
 
void substituteEnvironmentVars ()
 
void check ()
 
void init ()
 
bool parseString (const char *fn, const char *str, bool upd=FALSE)
 
bool parse (const char *fn, bool upd=FALSE)
 
void create ()
 
void appendStartComment (const QCString &u)
 
void appendUserComment (const QCString &u)
 
QCString takeStartComment ()
 
QCString takeUserComment ()
 
 Config (const fhicl::ParameterSet &pset)
 
 Config (const fhicl::ParameterSet &pset)
 
Getting configuration values.
QCStringgetString (const char *fileName, int num, const char *name) const
 
QStrListgetList (const char *fileName, int num, const char *name) const
 
QCStringgetEnum (const char *fileName, int num, const char *name) const
 
int & getInt (const char *fileName, int num, const char *name) const
 
boolgetBool (const char *fileName, int num, const char *name) const
 
ConfigOptionget (const char *name) const
 
Adding configuration options.
ConfigInfoaddInfo (const char *name, const char *doc)
 
ConfigStringaddString (const char *name, const char *doc)
 
ConfigEnumaddEnum (const char *name, const char *doc, const char *defVal)
 
ConfigListaddList (const char *name, const char *doc)
 
ConfigIntaddInt (const char *name, const char *doc, int minVal, int maxVal, int defVal)
 
ConfigBooladdBool (const char *name, const char *doc, bool defVal)
 
ConfigOptionaddObsolete (const char *name)
 
ConfigOptionaddDisabled (const char *name)
 

Static Public Member Functions

static Configinstance ()
 
static void deleteInstance ()
 

Public Attributes

std::string fOutputFormat
 
std::string fTreeName
 
std::string fTrainingBranchObjectName
 
std::string fTestOutputDir
 
std::string fTrainOutputDir
 
unsigned int fNTrainPerTest
 Number of training examples for each test sample, e.g. 4 for 80/20 split. More...
 
unsigned int fProgressInterval
 Number of examples in between progress updates (% complete) More...
 
bool fErrorIfExists
 
bool fSetLog
 
bool fCreateIfMissing
 
bool fWriteSync
 
unsigned int fMaxKeyLength
 
unsigned int fWriteBufferSize
 
std::string fLabeling
 
unsigned int fLabelingMode
 
bool fUseGeV
 
bool fWriteRegressionHDF5
 Flag to control whether or not we write HDF5 regression features. More...
 
std::string fRegressionHDF5NameTrain
 
std::string fRegressionHDF5NameTest
 
float fMaxEnergyForLabel
 
unsigned int fNEvents
 Limit the number of entries in the tree to consider. More...
 
int fPlaneLimit
 Limit the number of wires in the output image. More...
 
int fTDCLimit
 Limit the number of TDCs in the output image. More...
 
std::vector< boolfReverseViews
 Views to reverse. More...
 
std::string fOutputDir
 

Protected Member Functions

 Config ()
 
 ~Config ()
 

Private Member Functions

void checkFileName (const char *)
 

Private Attributes

QList< ConfigOption > * m_options
 
QList< ConfigOption > * m_obsolete
 
QList< ConfigOption > * m_disabled
 
QDict< ConfigOption > * m_dict
 
QCString m_startComment
 
QCString m_userComment
 
bool m_initialized
 
QCString m_header
 

Static Private Attributes

static Configm_instance = 0
 

Detailed Description

Singleton for configuration variables.

This object holds the global static variables read from a user-supplied configuration file. The static member instance() can be used to get a pointer to the one and only instance.

Set all variables to their default values by calling Config::instance()->init()

Definition at line 291 of file config.h.

Constructor & Destructor Documentation

Config::Config ( )
inlineprotected

Definition at line 543 of file config.h.

544  {
548  m_dict = new QDict<ConfigOption>(257);
553  create();
554  }
QList< ConfigOption > * m_disabled
Definition: config.h:567
void create()
Definition: config.cpp:3641
bool m_initialized
Definition: config.h:572
const bool FALSE
Definition: qglobal.h:370
QDict< ConfigOption > * m_dict
Definition: config.h:568
QList< ConfigOption > * m_options
Definition: config.h:565
QList< ConfigOption > * m_obsolete
Definition: config.h:566
void setAutoDelete(bool enable)
Definition: qlist.h:99
const bool TRUE
Definition: qglobal.h:371
Config::~Config ( )
inlineprotected

Definition at line 555 of file config.h.

556  {
557  delete m_options;
558  delete m_obsolete;
559  delete m_disabled;
560  delete m_dict;
561  }
QList< ConfigOption > * m_disabled
Definition: config.h:567
QDict< ConfigOption > * m_dict
Definition: config.h:568
QList< ConfigOption > * m_options
Definition: config.h:565
QList< ConfigOption > * m_obsolete
Definition: config.h:566
Config::Config ( const fhicl::ParameterSet pset)
inline

Definition at line 63 of file cvnCreateDB.cc.

63  :
64  fOutputFormat (pset.get<std::string>("OutputFormat")),
65  fTreeName (pset.get<std::string>("TreeName")),
66  fTrainingBranchObjectName (pset.get<std::string>("TrainingDataBranchName")),
67  fTestOutputDir (pset.get<std::string>("TestOutputDir")),
68  fTrainOutputDir (pset.get<std::string>("TrainOutputDir")),
69  fNTrainPerTest (pset.get<unsigned int>("NTrainPerTest")),
70  fProgressInterval (pset.get<unsigned int>("ProgressInterval")),
71  fErrorIfExists (pset.get<bool>("ErrorIfExists")),
72  fSetLog (pset.get<bool>("SetLog")),
73  fCreateIfMissing (pset.get<bool>("CreateIfMissing")),
74  fWriteSync (pset.get<bool>("WriteSync")),
75  fMaxKeyLength (pset.get<unsigned int>("MaxKeyLength")),
76  fWriteBufferSize (pset.get<unsigned int>("WriteBufferSize")),
77  fLabeling (pset.get<std::string>("Labeling")),
78  fUseGeV (pset.get<bool>("UseGeV")),
79  fWriteRegressionHDF5 (pset.get<bool>("WriteRegressionHDF5")),
80  fRegressionHDF5NameTrain (pset.get<std::string>("RegressionHDF5NameTrain")),
81  fRegressionHDF5NameTest (pset.get<std::string>("RegressionHDF5NameTest")),
82  fMaxEnergyForLabel (pset.get<float>("MaxEnergyForLabel")),
83  fNEvents (pset.get<unsigned int>("NEvents")),
84  fPlaneLimit (pset.get<unsigned int>("PlaneLimit")),
85  fTDCLimit (pset.get<unsigned int>("TDCLimit")),
86  fReverseViews(pset.get<std::vector<bool> >("ReverseViews"))
87  {
88  if(!fLabeling.compare("all")) fLabelingMode = kAll;
89  if(!fLabeling.compare("numu")) fLabelingMode = kNumu;
90  if(!fLabeling.compare("nue")) fLabelingMode = kNue;
91  if(!fLabeling.compare("nc")) fLabelingMode = kNC;
92  if(!fLabeling.compare("energy")) fLabelingMode = kEnergy;
93  };
Label is conversion of fNuEnergy to int.
Definition: cvnCreateDB.cc:56
bool fSetLog
Definition: cvnCreateDB.cc:108
std::string string
Definition: nybbler.cc:12
std::string fRegressionHDF5NameTest
Definition: cvnCreateDB.cc:122
bool fUseGeV
Definition: cvnCreateDB.cc:117
float fMaxEnergyForLabel
Definition: cvnCreateDB.cc:123
unsigned int fMaxKeyLength
Definition: cvnCreateDB.cc:111
bool fWriteSync
Definition: cvnCreateDB.cc:110
std::string fRegressionHDF5NameTrain
Definition: cvnCreateDB.cc:121
Label all interaction types separately.
Definition: cvnCreateDB.cc:52
Label NC:1, else 0.
Definition: cvnCreateDB.cc:55
bool fWriteRegressionHDF5
Flag to control whether or not we write HDF5 regression features.
Definition: cvnCreateDB.cc:120
unsigned int fNTrainPerTest
Number of training examples for each test sample, e.g. 4 for 80/20 split.
Definition: cvnCreateDB.cc:103
Label numu:1, else 0.
Definition: cvnCreateDB.cc:53
std::string fLabeling
Definition: cvnCreateDB.cc:114
T get(std::string const &key) const
Definition: ParameterSet.h:271
int fTDCLimit
Limit the number of TDCs in the output image.
Definition: cvnCreateDB.cc:129
bool fErrorIfExists
Definition: cvnCreateDB.cc:107
bool fCreateIfMissing
Definition: cvnCreateDB.cc:109
unsigned int fNEvents
Limit the number of entries in the tree to consider.
Definition: cvnCreateDB.cc:125
std::string fOutputFormat
Definition: cvnCreateDB.cc:93
std::string fTrainOutputDir
Definition: cvnCreateDB.cc:100
std::vector< bool > fReverseViews
Views to reverse.
Definition: cvnCreateDB.cc:131
int fPlaneLimit
Limit the number of wires in the output image.
Definition: cvnCreateDB.cc:127
std::string fTrainingBranchObjectName
Definition: cvnCreateDB.cc:98
unsigned int fProgressInterval
Number of examples in between progress updates (% complete)
Definition: cvnCreateDB.cc:105
std::string fTestOutputDir
Definition: cvnCreateDB.cc:99
Label nue:1, else 0.
Definition: cvnCreateDB.cc:54
unsigned int fWriteBufferSize
Definition: cvnCreateDB.cc:112
std::string fTreeName
Definition: cvnCreateDB.cc:97
Config::Config ( const fhicl::ParameterSet pset)
inline

Definition at line 41 of file cvnCreateZlibImages.cc.

41  :
42  fTreeName (pset.get<std::string>("TreeName")),
43  fOutputDir (pset.get<std::string>("OutputDir")),
44  fSetLog (pset.get<bool>("SetLog")),
45  fNEvents (pset.get<unsigned int>("NEvents")),
46  fPlaneLimit (pset.get<unsigned int>("PlaneLimit")),
47  fTDCLimit (pset.get<unsigned int>("TDCLimit")),
48  fReverseViews(pset.get<std::vector<bool> >("ReverseViews"))
49  {
50  };
bool fSetLog
Definition: cvnCreateDB.cc:108
std::string string
Definition: nybbler.cc:12
T get(std::string const &key) const
Definition: ParameterSet.h:271
int fTDCLimit
Limit the number of TDCs in the output image.
Definition: cvnCreateDB.cc:129
std::string fOutputDir
unsigned int fNEvents
Limit the number of entries in the tree to consider.
Definition: cvnCreateDB.cc:125
std::vector< bool > fReverseViews
Views to reverse.
Definition: cvnCreateDB.cc:131
int fPlaneLimit
Limit the number of wires in the output image.
Definition: cvnCreateDB.cc:127
std::string fTreeName
Definition: cvnCreateDB.cc:97

Member Function Documentation

ConfigBool* Config::addBool ( const char *  name,
const char *  doc,
bool  defVal 
)
inline

Adds a new boolean option with name and documentation doc. The boolean has a default value of defVal.

Returns
An object representing the option.

Definition at line 435 of file config.h.

438  {
439  ConfigBool *result = new ConfigBool(name,doc,defVal);
440  m_options->append(result);
441  m_dict->insert(name,result);
442  return result;
443  }
static QCString name
Definition: declinfo.cpp:673
static QCString result
void append(const type *d)
Definition: qlist.h:73
QDict< ConfigOption > * m_dict
Definition: config.h:568
QList< ConfigOption > * m_options
Definition: config.h:565
QCString doc
ConfigOption* Config::addDisabled ( const char *  name)
inline

Adds an option that has been disabled at compile time.

Definition at line 453 of file config.h.

454  {
455  ConfigDisabled *option = new ConfigDisabled(name);
456  m_dict->insert(name,option);
457  m_disabled->append(option);
458  return option;
459  }
static QCString name
Definition: declinfo.cpp:673
QList< ConfigOption > * m_disabled
Definition: config.h:567
void append(const type *d)
Definition: qlist.h:73
QDict< ConfigOption > * m_dict
Definition: config.h:568
ConfigEnum* Config::addEnum ( const char *  name,
const char *  doc,
const char *  defVal 
)
inline

Adds a new enumeration option with name and documentation doc and initial value defVal.

Returns
An object representing the option.

Definition at line 394 of file config.h.

397  {
398  ConfigEnum *result = new ConfigEnum(name,doc,defVal);
399  m_options->append(result);
400  m_dict->insert(name,result);
401  return result;
402  }
static QCString name
Definition: declinfo.cpp:673
static QCString result
void append(const type *d)
Definition: qlist.h:73
QDict< ConfigOption > * m_dict
Definition: config.h:568
QList< ConfigOption > * m_options
Definition: config.h:565
QCString doc
ConfigInfo* Config::addInfo ( const char *  name,
const char *  doc 
)
inline

Starts a new configuration section with name and description doc.

Returns
An object representing the option.

Definition at line 371 of file config.h.

372  {
374  m_options->append(result);
375  return result;
376  }
static QCString name
Definition: declinfo.cpp:673
static QCString result
void append(const type *d)
Definition: qlist.h:73
QList< ConfigOption > * m_options
Definition: config.h:565
QCString doc
ConfigInt* Config::addInt ( const char *  name,
const char *  doc,
int  minVal,
int  maxVal,
int  defVal 
)
inline

Adds a new integer option with name and documentation doc. The integer has a range between minVal and maxVal and a default value of defVal.

Returns
An object representing the option.

Definition at line 421 of file config.h.

424  {
425  ConfigInt *result = new ConfigInt(name,doc,minVal,maxVal,defVal);
426  m_options->append(result);
427  m_dict->insert(name,result);
428  return result;
429  }
static QCString name
Definition: declinfo.cpp:673
static QCString result
void append(const type *d)
Definition: qlist.h:73
QDict< ConfigOption > * m_dict
Definition: config.h:568
QList< ConfigOption > * m_options
Definition: config.h:565
QCString doc
ConfigList* Config::addList ( const char *  name,
const char *  doc 
)
inline

Adds a new string option with name and documentation doc.

Returns
An object representing the option.

Definition at line 407 of file config.h.

409  {
411  m_options->append(result);
412  m_dict->insert(name,result);
413  return result;
414  }
static QCString name
Definition: declinfo.cpp:673
static QCString result
void append(const type *d)
Definition: qlist.h:73
QDict< ConfigOption > * m_dict
Definition: config.h:568
QList< ConfigOption > * m_options
Definition: config.h:565
QCString doc
ConfigOption* Config::addObsolete ( const char *  name)
inline

Adds an option that has become obsolete.

Definition at line 445 of file config.h.

446  {
447  ConfigObsolete *option = new ConfigObsolete(name);
448  m_dict->insert(name,option);
449  m_obsolete->append(option);
450  return option;
451  }
static QCString name
Definition: declinfo.cpp:673
void append(const type *d)
Definition: qlist.h:73
QDict< ConfigOption > * m_dict
Definition: config.h:568
QList< ConfigOption > * m_obsolete
Definition: config.h:566
ConfigString* Config::addString ( const char *  name,
const char *  doc 
)
inline

Adds a new string option with name and documentation doc.

Returns
An object representing the option.

Definition at line 381 of file config.h.

383  {
385  m_options->append(result);
386  m_dict->insert(name,result);
387  return result;
388  }
static QCString name
Definition: declinfo.cpp:673
static QCString result
void append(const type *d)
Definition: qlist.h:73
QDict< ConfigOption > * m_dict
Definition: config.h:568
QList< ConfigOption > * m_options
Definition: config.h:565
QCString doc
void Config::appendStartComment ( const QCString u)
inline

Append user start comment

Definition at line 512 of file config.h.

513  {
514  m_startComment += u;
515  }
QCString m_startComment
Definition: config.h:570
void Config::appendUserComment ( const QCString u)
inline

Append user comment

Definition at line 518 of file config.h.

519  {
520  m_userComment += u;
521  }
QCString m_userComment
Definition: config.h:571
void Config::check ( )

Checks if the values of the variable are correct, adjusts them if needed, and report any errors.

Definition at line 3084 of file config.cpp.

3085 {
3086  //if (!projectName.isEmpty())
3087  //{
3088  // projectName[0]=toupper(projectName[0]);
3089  //}
3090 
3091  QCString &warnFormat = Config_getString("WARN_FORMAT");
3092  if (warnFormat.stripWhiteSpace().isEmpty())
3093  {
3094  warnFormat="$file:$line $text";
3095  }
3096  else
3097  {
3098  if (warnFormat.find("$file")==-1)
3099  {
3100  config_warn("warning format does not contain a $file tag!\n");
3101  }
3102  if (warnFormat.find("$line")==-1)
3103  {
3104  config_warn("warning format does not contain a $line tag!\n");
3105  }
3106  if (warnFormat.find("$text")==-1)
3107  {
3108  config_warn("warning format foes not contain a $text tag!\n");
3109  }
3110  }
3111 
3112  QCString &manExtension = Config_getString("MAN_EXTENSION");
3113 
3114  // set default man page extension if non is given by the user
3115  if (manExtension.isEmpty())
3116  {
3117  manExtension=".3";
3118  }
3119 
3120  QCString &paperType = Config_getEnum("PAPER_TYPE");
3121  paperType=paperType.lower().stripWhiteSpace();
3122  if (paperType.isEmpty() || paperType=="a4wide")
3123  {
3124  paperType = "a4";
3125  }
3126  if (paperType!="a4" && paperType!="letter" &&
3127  paperType!="legal" && paperType!="executive")
3128  {
3129  config_err("Unknown page type specified\n");
3130  paperType="a4";
3131  }
3132 
3133  QCString &outputLanguage=Config_getEnum("OUTPUT_LANGUAGE");
3134  outputLanguage=outputLanguage.stripWhiteSpace();
3135  if (outputLanguage.isEmpty())
3136  {
3137  outputLanguage = "English";
3138  }
3139 
3140  QCString &htmlFileExtension=Config_getString("HTML_FILE_EXTENSION");
3141  htmlFileExtension=htmlFileExtension.stripWhiteSpace();
3142  if (htmlFileExtension.isEmpty())
3143  {
3144  htmlFileExtension = ".html";
3145  }
3146 
3147  // expand the relative stripFromPath values
3148  QStrList &stripFromPath = Config_getList("STRIP_FROM_PATH");
3149  char *sfp = stripFromPath.first();
3150  if (sfp==0) // by default use the current path
3151  {
3152  stripFromPath.append(QDir::currentDirPath().utf8()+"/");
3153  }
3154  else
3155  {
3156  cleanUpPaths(stripFromPath);
3157  }
3158 
3159  // expand the relative stripFromPath values
3160  QStrList &stripFromIncPath = Config_getList("STRIP_FROM_INC_PATH");
3161  cleanUpPaths(stripFromIncPath);
3162 
3163  // Test to see if HTML header is valid
3164  QCString &headerFile = Config_getString("HTML_HEADER");
3165  if (!headerFile.isEmpty())
3166  {
3167  QFileInfo fi(headerFile);
3168  if (!fi.exists())
3169  {
3170  config_err("tag HTML_HEADER: header file `%s' "
3171  "does not exist\n",headerFile.data());
3172  exit(1);
3173  }
3174  }
3175  // Test to see if HTML footer is valid
3176  QCString &footerFile = Config_getString("HTML_FOOTER");
3177  if (!footerFile.isEmpty())
3178  {
3179  QFileInfo fi(footerFile);
3180  if (!fi.exists())
3181  {
3182  config_err("tag HTML_FOOTER: footer file `%s' "
3183  "does not exist\n",footerFile.data());
3184  exit(1);
3185  }
3186  }
3187 
3188  // Test to see if MathJax code file is valid
3189  if (Config_getBool("USE_MATHJAX"))
3190  {
3191  QCString &MathJaxCodefile = Config_getString("MATHJAX_CODEFILE");
3192  if (!MathJaxCodefile.isEmpty())
3193  {
3194  QFileInfo fi(MathJaxCodefile);
3195  if (!fi.exists())
3196  {
3197  config_err("tag MATHJAX_CODEFILE file `%s' "
3198  "does not exist\n",MathJaxCodefile.data());
3199  exit(1);
3200  }
3201  }
3202  QCString &path = Config_getString("MATHJAX_RELPATH");
3203  if (!path.isEmpty() && path.at(path.length()-1)!='/')
3204  {
3205  path+="/";
3206  }
3207 
3208  }
3209 
3210  // Test to see if LaTeX header is valid
3211  QCString &latexHeaderFile = Config_getString("LATEX_HEADER");
3212  if (!latexHeaderFile.isEmpty())
3213  {
3214  QFileInfo fi(latexHeaderFile);
3215  if (!fi.exists())
3216  {
3217  config_err("tag LATEX_HEADER: header file `%s' "
3218  "does not exist\n",latexHeaderFile.data());
3219  exit(1);
3220  }
3221  }
3222  // Test to see if LaTeX footer is valid
3223  QCString &latexFooterFile = Config_getString("LATEX_FOOTER");
3224  if (!latexFooterFile.isEmpty())
3225  {
3226  QFileInfo fi(latexFooterFile);
3227  if (!fi.exists())
3228  {
3229  config_err("tag LATEX_FOOTER: footer file `%s' "
3230  "does not exist\n",latexFooterFile.data());
3231  exit(1);
3232  }
3233  }
3234 
3235  // check include path
3236  QStrList &includePath = Config_getList("INCLUDE_PATH");
3237  char *s=includePath.first();
3238  while (s)
3239  {
3240  QFileInfo fi(s);
3241  if (!fi.exists()) config_warn("tag INCLUDE_PATH: include path `%s' "
3242  "does not exist\n",s);
3243  s=includePath.next();
3244  }
3245 
3246  // check aliases
3247  QStrList &aliasList = Config_getList("ALIASES");
3248  s=aliasList.first();
3249  while (s)
3250  {
3251  QRegExp re1("[a-z_A-Z][a-z_A-Z0-9]*[ \t]*="); // alias without argument
3252  QRegExp re2("[a-z_A-Z][a-z_A-Z0-9]*{[0-9]*}[ \t]*="); // alias with argument
3253  QCString alias=s;
3254  alias=alias.stripWhiteSpace();
3255  if (alias.find(re1)!=0 && alias.find(re2)!=0)
3256  {
3257  config_err("Illegal alias format `%s'. Use \"name=value\" or \"name(n)=value\", where n is the number of arguments\n",
3258  alias.data());
3259  }
3260  s=aliasList.next();
3261  }
3262 
3263  // check if GENERATE_TREEVIEW and GENERATE_HTMLHELP are both enabled
3264  if (Config_getBool("GENERATE_TREEVIEW") && Config_getBool("GENERATE_HTMLHELP"))
3265  {
3266  config_err("When enabling GENERATE_HTMLHELP the tree view (GENERATE_TREEVIEW) should be disabled. I'll do it for you.\n");
3267  Config_getBool("GENERATE_TREEVIEW")=FALSE;
3268  }
3269  if (Config_getBool("SEARCHENGINE") && Config_getBool("GENERATE_HTMLHELP"))
3270  {
3271  config_err("When enabling GENERATE_HTMLHELP the search engine (SEARCHENGINE) should be disabled. I'll do it for you.\n");
3272  Config_getBool("SEARCHENGINE")=FALSE;
3273  }
3274 
3275  // check if SEPARATE_MEMBER_PAGES and INLINE_GROUPED_CLASSES are both enabled
3276  if (Config_getBool("SEPARATE_MEMBER_PAGES") && Config_getBool("INLINE_GROUPED_CLASSES"))
3277  {
3278  config_err("When enabling INLINE_GROUPED_CLASSES the SEPARATE_MEMBER_PAGES option should be disabled. I'll do it for you.\n");
3279  Config_getBool("SEPARATE_MEMBER_PAGES")=FALSE;
3280  }
3281 
3282  // check dot image format
3283  QCString &dotImageFormat=Config_getEnum("DOT_IMAGE_FORMAT");
3284  dotImageFormat=dotImageFormat.stripWhiteSpace();
3285  if (dotImageFormat.isEmpty())
3286  {
3287  dotImageFormat = "png";
3288  }
3289  //else if (dotImageFormat!="gif" && dotImageFormat!="png" && dotImageFormat!="jpg")
3290  //{
3291  // config_err("Invalid value for DOT_IMAGE_FORMAT: `%s'. Using the default.\n",dotImageFormat.data());
3292  // dotImageFormat = "png";
3293  //}
3294 
3295  QCString &dotFontName=Config_getString("DOT_FONTNAME");
3296  if (dotFontName=="FreeSans" || dotFontName=="FreeSans.ttf")
3297  {
3298  config_warn("doxygen no longer ships with the FreeSans font.\n"
3299  "You may want to clear or change DOT_FONTNAME.\n"
3300  "Otherwise you run the risk that the wrong font is being used for dot generated graphs.\n");
3301  }
3302 
3303 
3304  // check dot path
3305  QCString &dotPath = Config_getString("DOT_PATH");
3306  if (!dotPath.isEmpty())
3307  {
3308  QFileInfo fi(dotPath);
3309  if (fi.exists() && fi.isFile()) // user specified path + exec
3310  {
3311  dotPath=fi.dirPath(TRUE).utf8()+"/";
3312  }
3313  else
3314  {
3315  QFileInfo dp(dotPath+"/dot"+portable_commandExtension());
3316  if (!dp.exists() || !dp.isFile())
3317  {
3318  config_warn("the dot tool could not be found at %s\n",dotPath.data());
3319  dotPath="";
3320  }
3321  else
3322  {
3323  dotPath=dp.dirPath(TRUE).utf8()+"/";
3324  }
3325  }
3326 #if defined(_WIN32) // convert slashes
3327  uint i=0,l=dotPath.length();
3328  for (i=0;i<l;i++) if (dotPath.at(i)=='/') dotPath.at(i)='\\';
3329 #endif
3330  }
3331  else // make sure the string is empty but not null!
3332  {
3333  dotPath="";
3334  }
3335 
3336  // check mscgen path
3337  QCString &mscgenPath = Config_getString("MSCGEN_PATH");
3338  if (!mscgenPath.isEmpty())
3339  {
3340  QFileInfo dp(mscgenPath+"/mscgen"+portable_commandExtension());
3341  if (!dp.exists() || !dp.isFile())
3342  {
3343  config_warn("the mscgen tool could not be found at %s\n",mscgenPath.data());
3344  mscgenPath="";
3345  }
3346  else
3347  {
3348  mscgenPath=dp.dirPath(TRUE).utf8()+"/";
3349 #if defined(_WIN32) // convert slashes
3350  uint i=0,l=mscgenPath.length();
3351  for (i=0;i<l;i++) if (mscgenPath.at(i)=='/') mscgenPath.at(i)='\\';
3352 #endif
3353  }
3354  }
3355  else // make sure the string is empty but not null!
3356  {
3357  mscgenPath="";
3358  }
3359 
3360  // check plantuml path
3361  QCString &plantumlJarPath = Config_getString("PLANTUML_JAR_PATH");
3362  if (!plantumlJarPath.isEmpty())
3363  {
3364  QFileInfo pu(plantumlJarPath);
3365  if (pu.exists() && pu.isDir()) // PLANTUML_JAR_PATH is directory
3366  {
3367  QFileInfo jar(plantumlJarPath+portable_pathSeparator()+"plantuml.jar");
3368  if (jar.exists() && jar.isFile())
3369  {
3370  plantumlJarPath = jar.dirPath(TRUE).utf8()+portable_pathSeparator();
3371  }
3372  else
3373  {
3374  config_err("Jar file plantuml.jar not found at location "
3375  "specified via PLANTUML_JAR_PATH: '%s'\n",plantumlJarPath.data());
3376  plantumlJarPath="";
3377  }
3378  }
3379  else if (pu.exists() && pu.isFile() && plantumlJarPath.right(4)==".jar") // PLANTUML_JAR_PATH is file
3380  {
3381  plantumlJarPath = pu.dirPath(TRUE).utf8()+portable_pathSeparator();
3382  }
3383  else
3384  {
3385  config_err("path specified via PLANTUML_JAR_PATH does not exist or not a directory: %s\n",
3386  plantumlJarPath.data());
3387  plantumlJarPath="";
3388  }
3389  }
3390 
3391  // check dia path
3392  QCString &diaPath = Config_getString("DIA_PATH");
3393  if (!diaPath.isEmpty())
3394  {
3395  QFileInfo dp(diaPath+"/dia"+portable_commandExtension());
3396  if (!dp.exists() || !dp.isFile())
3397  {
3398  config_warn("dia could not be found at %s\n",diaPath.data());
3399  diaPath="";
3400  }
3401  else
3402  {
3403  diaPath=dp.dirPath(TRUE).utf8()+"/";
3404 #if defined(_WIN32) // convert slashes
3405  uint i=0,l=diaPath.length();
3406  for (i=0;i<l;i++) if (diaPath.at(i)=='/') diaPath.at(i)='\\';
3407 #endif
3408  }
3409  }
3410  else // make sure the string is empty but not null!
3411  {
3412  diaPath="";
3413  }
3414 
3415  // check input
3416  QStrList &inputSources=Config_getList("INPUT");
3417  if (inputSources.count()==0)
3418  {
3419  // use current dir as the default
3420  inputSources.append(QDir::currentDirPath().utf8());
3421  }
3422  else
3423  {
3424  s=inputSources.first();
3425  while (s)
3426  {
3427  QFileInfo fi(s);
3428  if (!fi.exists())
3429  {
3430  config_warn("tag INPUT: input source `%s' does not exist\n",s);
3431  }
3432  s=inputSources.next();
3433  }
3434  }
3435 
3436  initFilePattern();
3437 
3438  // add default pattern if needed
3439  QStrList &examplePatternList = Config_getList("EXAMPLE_PATTERNS");
3440  if (examplePatternList.isEmpty())
3441  {
3442  examplePatternList.append("*");
3443  }
3444 
3445  // if no output format is enabled, warn the user
3446  if (!Config_getBool("GENERATE_HTML") &&
3447  !Config_getBool("GENERATE_LATEX") &&
3448  !Config_getBool("GENERATE_MAN") &&
3449  !Config_getBool("GENERATE_RTF") &&
3450  !Config_getBool("GENERATE_XML") &&
3451  !Config_getBool("GENERATE_PERLMOD") &&
3452  !Config_getBool("GENERATE_RTF") &&
3453  !Config_getBool("GENERATE_DOCBOOK") &&
3454  !Config_getBool("GENERATE_AUTOGEN_DEF") &&
3455  Config_getString("GENERATE_TAGFILE").isEmpty()
3456  )
3457  {
3458  config_warn("No output formats selected! Set at least one of the main GENERATE_* options to YES.\n");
3459  }
3460 
3461  // check HTMLHELP creation requirements
3462  if (!Config_getBool("GENERATE_HTML") &&
3463  Config_getBool("GENERATE_HTMLHELP"))
3464  {
3465  config_warn("GENERATE_HTMLHELP=YES requires GENERATE_HTML=YES.\n");
3466  }
3467 
3468  // check QHP creation requirements
3469  if (Config_getBool("GENERATE_QHP"))
3470  {
3471  if (Config_getString("QHP_NAMESPACE").isEmpty())
3472  {
3473  config_err("GENERATE_QHP=YES requires QHP_NAMESPACE to be set. Using 'org.doxygen.doc' as default!.\n");
3474  Config_getString("QHP_NAMESPACE")="org.doxygen.doc";
3475  }
3476 
3477  if (Config_getString("QHP_VIRTUAL_FOLDER").isEmpty())
3478  {
3479  config_err("GENERATE_QHP=YES requires QHP_VIRTUAL_FOLDER to be set. Using 'doc' as default!\n");
3480  Config_getString("QHP_VIRTUAL_FOLDER")="doc";
3481  }
3482  }
3483 
3484  if (Config_getBool("OPTIMIZE_OUTPUT_JAVA") && Config_getBool("INLINE_INFO"))
3485  {
3486  // don't show inline info for Java output, since Java has no inline
3487  // concept.
3488  Config_getBool("INLINE_INFO")=FALSE;
3489  }
3490 
3491  int &depth = Config_getInt("MAX_DOT_GRAPH_DEPTH");
3492  if (depth==0)
3493  {
3494  depth=1000;
3495  }
3496 
3497  int &hue = Config_getInt("HTML_COLORSTYLE_HUE");
3498  if (hue<0)
3499  {
3500  hue=0;
3501  }
3502  else if (hue>=360)
3503  {
3504  hue=hue%360;
3505  }
3506 
3507  int &sat = Config_getInt("HTML_COLORSTYLE_SAT");
3508  if (sat<0)
3509  {
3510  sat=0;
3511  }
3512  else if (sat>255)
3513  {
3514  sat=255;
3515  }
3516  int &gamma = Config_getInt("HTML_COLORSTYLE_GAMMA");
3517  if (gamma<40)
3518  {
3519  gamma=40;
3520  }
3521  else if (gamma>240)
3522  {
3523  gamma=240;
3524  }
3525 
3526  QCString mathJaxFormat = Config_getEnum("MATHJAX_FORMAT");
3527  if (!mathJaxFormat.isEmpty() && mathJaxFormat!="HTML-CSS" &&
3528  mathJaxFormat!="NativeMML" && mathJaxFormat!="SVG")
3529  {
3530  config_err("Unsupported value for MATHJAX_FORMAT: Should be one of HTML-CSS, NativeMML, or SVG\n");
3531  Config_getEnum("MATHJAX_FORMAT")="HTML-CSS";
3532  }
3533 
3534  // add default words if needed
3535  QStrList &annotationFromBrief = Config_getList("ABBREVIATE_BRIEF");
3536  if (annotationFromBrief.isEmpty())
3537  {
3538  annotationFromBrief.append("The $name class");
3539  annotationFromBrief.append("The $name widget");
3540  annotationFromBrief.append("The $name file");
3541  annotationFromBrief.append("is");
3542  annotationFromBrief.append("provides");
3543  annotationFromBrief.append("specifies");
3544  annotationFromBrief.append("contains");
3545  annotationFromBrief.append("represents");
3546  annotationFromBrief.append("a");
3547  annotationFromBrief.append("an");
3548  annotationFromBrief.append("the");
3549  }
3550 
3551  // some default settings for vhdl
3552  if (Config_getBool("OPTIMIZE_OUTPUT_VHDL") &&
3553  (Config_getBool("INLINE_INHERITED_MEMB") ||
3554  Config_getBool("INHERIT_DOCS") ||
3555  !Config_getBool("HIDE_SCOPE_NAMES") ||
3556  !Config_getBool("EXTRACT_PRIVATE") ||
3557  !Config_getBool("EXTRACT_PACKAGE")
3558  )
3559  )
3560  {
3561  bool b1 = Config_getBool("INLINE_INHERITED_MEMB");
3562  bool b2 = Config_getBool("INHERIT_DOCS");
3563  bool b3 = Config_getBool("HIDE_SCOPE_NAMES");
3564  bool b4 = Config_getBool("EXTRACT_PRIVATE");
3565  bool b5 = Config_getBool("SKIP_FUNCTION_MACROS");
3566  bool b6 = Config_getBool("EXTRACT_PACKAGE");
3567  const char *s1,*s2,*s3,*s4,*s5,*s6;
3568  if (b1) s1=" INLINE_INHERITED_MEMB = NO (was YES)\n"; else s1="";
3569  if (b2) s2=" INHERIT_DOCS = NO (was YES)\n"; else s2="";
3570  if (!b3) s3=" HIDE_SCOPE_NAMES = YES (was NO)\n"; else s3="";
3571  if (!b4) s4=" EXTRACT_PRIVATE = YES (was NO)\n"; else s4="";
3572  if (b5) s5=" ENABLE_PREPROCESSING = NO (was YES)\n"; else s5="";
3573  if (!b6) s6=" EXTRACT_PACKAGE = YES (was NO)\n"; else s6="";
3574 
3575 
3576  config_warn("enabling OPTIMIZE_OUTPUT_VHDL assumes the following settings:\n"
3577  "%s%s%s%s%s%s",s1,s2,s3,s4,s5,s6
3578  );
3579 
3580  Config_getBool("INLINE_INHERITED_MEMB") = FALSE;
3581  Config_getBool("INHERIT_DOCS") = FALSE;
3582  Config_getBool("HIDE_SCOPE_NAMES") = TRUE;
3583  Config_getBool("EXTRACT_PRIVATE") = TRUE;
3584  Config_getBool("ENABLE_PREPROCESSING") = FALSE;
3585  Config_getBool("EXTRACT_PACKAGE") = TRUE;
3586  }
3587 
3588  checkFileName("GENERATE_TAGFILE");
3589 
3590 #if 0 // TODO: this breaks test 25; SOURCEBROWSER = NO and SOURCE_TOOLTIPS = YES.
3591  // So this and other regressions should be analysed and fixed before this can be enabled
3592  // disable any boolean options that depend on disabled options
3594  ConfigOption *option;
3595  for (it.toFirst();(option=it.current());++it)
3596  {
3597  QCString depName = option->dependsOn(); // option has a dependency
3598  if (!depName.isEmpty())
3599  {
3600  ConfigOption * dep = Config::instance()->get(depName);
3601  if (dep->kind()==ConfigOption::O_Bool &&
3602  Config_getBool(depName)==FALSE) // dependent option is disabled
3603  {
3604  if (option->kind()==ConfigOption::O_Bool)
3605  {
3606  printf("disabling option %s\n",option->name().data());
3607  Config_getBool(option->name())=FALSE; // also disable this option
3608  }
3609  }
3610  }
3611  }
3612 #endif
3613 }
intermediate_table::iterator iterator
QCString stripWhiteSpace() const
Definition: qcstring.cpp:295
bool isEmpty() const
Definition: qcstring.h:189
The QRegExp class provides pattern matching using regular expressions or wildcards.
Definition: qregexp.h:46
uint length() const
Definition: qcstring.h:195
void checkFileName(const char *)
Definition: config.cpp:3072
type * first()
Definition: qinternallist.h:87
char & at(uint i) const
Definition: qcstring.h:326
const bool FALSE
Definition: qglobal.h:370
const std::string instance
#define Config_getList(val)
Definition: config.cpp:662
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
OptionType kind() const
Definition: config.h:65
void config_err(const char *fmt,...)
Definition: config.cpp:669
static QStrList * l
Definition: config.cpp:1044
#define Config_getEnum(val)
Definition: config.cpp:663
static QCString stripFromPath(const QCString &path, QStrList &l)
Definition: util.cpp:274
#define Config_getInt(val)
Definition: config.cpp:661
QCString right(uint len) const
Definition: qcstring.cpp:231
static QString currentDirPath()
Definition: qdir_unix.cpp:141
static void cleanUpPaths(QStrList &str)
Definition: config.cpp:3037
void append(const type *d)
Definition: qinternallist.h:61
void initFilePattern(void)
Definition: util.cpp:8569
const char * data() const
Definition: qcstring.h:207
#define Config_getString(val)
Definition: config.cpp:660
type * current() const
Definition: qlist.h:146
#define Config_getBool(val)
Definition: config.cpp:664
double gamma(double KE, const simb::MCParticle *part)
type * next()
Definition: qinternallist.h:89
QCString name() const
Definition: config.h:66
void config_warn(const char *fmt,...)
Definition: config.cpp:676
bool isEmpty() const
Definition: qinternallist.h:57
QCString dependsOn() const
Definition: config.h:69
const char * portable_commandExtension()
Definition: portable.cpp:382
char portable_pathSeparator()
Definition: portable.cpp:355
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:51
QCString lower() const
Definition: qcstring.cpp:263
uint count() const
Definition: qinternallist.h:56
unsigned uint
Definition: qglobal.h:351
static QCString * s
Definition: config.cpp:1042
const bool TRUE
Definition: qglobal.h:371
type * toFirst()
Definition: qlist.h:135
void Config::checkFileName ( const char *  optionName)
private

Definition at line 3072 of file config.cpp.

3073 {
3074  QCString &s = Config_getString(optionName);
3076  if ((val=="yes" || val=="true" || val=="1" || val=="all") ||
3077  (val=="no" || val=="false" || val=="0" || val=="none"))
3078  {
3079  config_err("file name expected for option %s, got %s instead. Ignoring...\n",optionName,s.data());
3080  s=""; // note the use of &s above: this will change the option value!
3081  }
3082 }
QCString stripWhiteSpace() const
Definition: qcstring.cpp:295
void config_err(const char *fmt,...)
Definition: config.cpp:669
const char * data() const
Definition: qcstring.h:207
#define Config_getString(val)
Definition: config.cpp:660
QCString lower() const
Definition: qcstring.cpp:263
static QCString * s
Definition: config.cpp:1042
void Config::convertStrToVal ( )

Converts the string values read from the configuration file to real values for non-string type options (like int, and bools)

Definition at line 2887 of file config.cpp.

2888 {
2890  ConfigOption *option;
2891  for (;(option=it.current());++it)
2892  {
2893  option->convertStrToVal();
2894  }
2895 }
intermediate_table::iterator iterator
virtual void convertStrToVal()
Definition: config.h:76
type * current() const
Definition: qlist.h:146
void Config::create ( )

Called from the constructor, will add doxygen's default options to the configuration object

Definition at line 3641 of file config.cpp.

3642 {
3643  if (m_initialized) return;
3644  m_initialized = TRUE;
3645  addConfigOptions(this);
3646 }
void addConfigOptions(Config *cfg)
bool m_initialized
Definition: config.h:572
const bool TRUE
Definition: qglobal.h:371
static void Config::deleteInstance ( )
inlinestatic

Delete the instance

Definition at line 305 of file config.h.

306  {
307  delete m_instance;
308  m_instance=0;
309  }
static Config * m_instance
Definition: config.h:569
ConfigOption* Config::get ( const char *  name) const
inline

Returns the ConfigOption corresponding with name or 0 if the option is not supported.

Definition at line 357 of file config.h.

358  {
359  return m_dict->find(name);
360  }
static QCString name
Definition: declinfo.cpp:673
QDict< ConfigOption > * m_dict
Definition: config.h:568
bool & Config::getBool ( const char *  fileName,
int  num,
const char *  name 
) const

Returns the value of the boolean option with name fileName. The arguments num and name are for debugging purposes only. There is a convenience function Config_getBool() for this.

Definition at line 892 of file config.cpp.

893 {
894  ConfigOption *opt = m_dict->find(name);
895  if (opt==0)
896  {
897  config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
898  exit(1);
899  }
900  else if (opt->kind()!=ConfigOption::O_Bool)
901  {
902  config_err("%s<%d>: Internal error: Requested option %s not of boolean type!\n",fileName,num,name);
903  exit(1);
904  }
905  return *((ConfigBool *)opt)->valueRef();
906 }
static QCString name
Definition: declinfo.cpp:673
opt
Definition: train.py:196
QDict< ConfigOption > * m_dict
Definition: config.h:568
OptionType kind() const
Definition: config.h:65
void config_err(const char *fmt,...)
Definition: config.cpp:669
fileName
Definition: dumpTree.py:9
QCString & Config::getEnum ( const char *  fileName,
int  num,
const char *  name 
) const

Returns the value of the enum option with name fileName. The arguments num and name are for debugging purposes only. There is a convenience function Config_getEnum() for this.

Definition at line 860 of file config.cpp.

861 {
862  ConfigOption *opt = m_dict->find(name);
863  if (opt==0)
864  {
865  config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
866  exit(1);
867  }
868  else if (opt->kind()!=ConfigOption::O_Enum)
869  {
870  config_err("%s<%d>: Internal error: Requested option %s not of enum type!\n",fileName,num,name);
871  exit(1);
872  }
873  return *((ConfigEnum *)opt)->valueRef();
874 }
static QCString name
Definition: declinfo.cpp:673
opt
Definition: train.py:196
QDict< ConfigOption > * m_dict
Definition: config.h:568
OptionType kind() const
Definition: config.h:65
void config_err(const char *fmt,...)
Definition: config.cpp:669
fileName
Definition: dumpTree.py:9
int & Config::getInt ( const char *  fileName,
int  num,
const char *  name 
) const

Returns the value of the integer option with name fileName. The arguments num and name are for debugging purposes only. There is a convenience function Config_getInt() for this.

Definition at line 876 of file config.cpp.

877 {
878  ConfigOption *opt = m_dict->find(name);
879  if (opt==0)
880  {
881  config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
882  exit(1);
883  }
884  else if (opt->kind()!=ConfigOption::O_Int)
885  {
886  config_err("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name);
887  exit(1);
888  }
889  return *((ConfigInt *)opt)->valueRef();
890 }
static QCString name
Definition: declinfo.cpp:673
opt
Definition: train.py:196
QDict< ConfigOption > * m_dict
Definition: config.h:568
OptionType kind() const
Definition: config.h:65
void config_err(const char *fmt,...)
Definition: config.cpp:669
fileName
Definition: dumpTree.py:9
QStrList & Config::getList ( const char *  fileName,
int  num,
const char *  name 
) const

Returns the value of the list option with name fileName. The arguments num and name are for debugging purposes only. There is a convenience function Config_getList() for this.

Definition at line 844 of file config.cpp.

845 {
846  ConfigOption *opt = m_dict->find(name);
847  if (opt==0)
848  {
849  config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
850  exit(1);
851  }
852  else if (opt->kind()!=ConfigOption::O_List)
853  {
854  config_err("%s<%d>: Internal error: Requested option %s not of list type!\n",fileName,num,name);
855  exit(1);
856  }
857  return *((ConfigList *)opt)->valueRef();
858 }
static QCString name
Definition: declinfo.cpp:673
opt
Definition: train.py:196
QDict< ConfigOption > * m_dict
Definition: config.h:568
OptionType kind() const
Definition: config.h:65
void config_err(const char *fmt,...)
Definition: config.cpp:669
fileName
Definition: dumpTree.py:9
QCString & Config::getString ( const char *  fileName,
int  num,
const char *  name 
) const

Returns the value of the string option with name fileName. The arguments num and name are for debugging purposes only. There is a convenience function Config_getString() for this.

Definition at line 828 of file config.cpp.

829 {
830  ConfigOption *opt = m_dict->find(name);
831  if (opt==0)
832  {
833  config_err("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
834  exit(1);
835  }
836  else if (opt->kind()!=ConfigOption::O_String)
837  {
838  config_err("%s<%d>: Internal error: Requested option %s not of string type!\n",fileName,num,name);
839  exit(1);
840  }
841  return *((ConfigString *)opt)->valueRef();
842 }
static QCString name
Definition: declinfo.cpp:673
opt
Definition: train.py:196
QDict< ConfigOption > * m_dict
Definition: config.h:568
OptionType kind() const
Definition: config.h:65
void config_err(const char *fmt,...)
Definition: config.cpp:669
fileName
Definition: dumpTree.py:9
void Config::init ( )

Initialize config variables to their default value

Definition at line 3615 of file config.cpp.

3616 {
3618  ConfigOption *option;
3619  for (;(option=it.current());++it)
3620  {
3621  option->init();
3622  }
3623 
3624  // sanity check if all depends relations are valid
3625  for (it.toFirst();(option=it.current());++it)
3626  {
3627  QCString depName = option->dependsOn();
3628  if (!depName.isEmpty())
3629  {
3630  ConfigOption * opt = Config::instance()->get(depName);
3631  if (opt==0)
3632  {
3633  config_warn("Config option '%s' has invalid depends relation on unknown option '%s'\n",
3634  option->name().data(),depName.data());
3635  exit(1);
3636  }
3637  }
3638  }
3639 }
intermediate_table::iterator iterator
bool isEmpty() const
Definition: qcstring.h:189
opt
Definition: train.py:196
const std::string instance
const char * data() const
Definition: qcstring.h:207
type * current() const
Definition: qlist.h:146
QCString name() const
Definition: config.h:66
void config_warn(const char *fmt,...)
Definition: config.cpp:676
QCString dependsOn() const
Definition: config.h:69
virtual void init()
Definition: config.h:78
type * toFirst()
Definition: qlist.h:135
static Config* Config::instance ( )
inlinestatic

Returns the one and only instance of this class

Definition at line 299 of file config.h.

300  {
301  if (m_instance==0) m_instance = new Config;
302  return m_instance;
303  }
static Config * m_instance
Definition: config.h:569
typename config_impl< T >::type Config
Definition: ModuleMacros.h:52
QListIterator<ConfigOption> Config::iterator ( )
inline

Returns an iterator that can by used to iterate over the configuration options.

Definition at line 314 of file config.h.

315  {
316  return QListIterator<ConfigOption>(*m_options);
317  }
bool Config::parse ( const char *  fn,
bool  upd = FALSE 
)

Parse a configuration file with name fn.

Returns
TRUE if successful, FALSE if the file could not be opened or read.

Definition at line 3726 of file config.cpp.

3727 {
3728  int retval;
3729  encoding = "UTF-8";
3730  printlex(configYY_flex_debug, TRUE, __FILE__, fn);
3731  retval = parseString(fn,configFileToString(fn), update);
3732  printlex(configYY_flex_debug, FALSE, __FILE__, fn);
3733  return retval;
3734 }
void printlex(int dbg, bool enter, const char *lexName, const char *fileName)
Definition: message.cpp:242
bool parseString(const char *fn, const char *str, bool upd=FALSE)
Definition: config.cpp:3707
const bool FALSE
Definition: qglobal.h:370
int configYY_flex_debug
Definition: config.cpp:600
static QCString configFileToString(const char *name)
Definition: config.cpp:3648
QAsciiDict< Entry > fn
static QCString encoding
Definition: config.cpp:1052
const bool TRUE
Definition: qglobal.h:371
bool Config::parseString ( const char *  fn,
const char *  str,
bool  upd = FALSE 
)

Parse a configuration data in string str.

Returns
TRUE if successful, or FALSE if the string could not be parsed.

Definition at line 3707 of file config.cpp.

3708 {
3710  inputString = str;
3711  inputPosition = 0;
3712  yyFileName = fn;
3713  yyLineNr = 1;
3714  includeStack.setAutoDelete(TRUE);
3715  includeStack.clear();
3716  includeDepth = 0;
3718  BEGIN( PreStart );
3719  config_upd = update;
3720  configYYlex();
3721  config_upd = FALSE;
3722  inputString = 0;
3723  return TRUE;
3724 }
static int inputPosition
Definition: config.cpp:1038
static const char * inputString
Definition: config.cpp:1037
static int yyLineNr
Definition: config.cpp:1039
const bool FALSE
Definition: qglobal.h:370
const std::string instance
FILE * configYYin
Definition: config.cpp:359
static int includeDepth
Definition: config.cpp:1049
static QStack< ConfigFileState > includeStack
Definition: config.cpp:1048
QAsciiDict< Entry > fn
int configYYlex(void)
static bool config_upd
Definition: config.cpp:1050
static Config * config
Definition: config.cpp:1054
#define PreStart
Definition: config.cpp:1228
static QCString yyFileName
Definition: config.cpp:1040
void configYYrestart(FILE *input_file)
Definition: config.cpp:2305
#define BEGIN
Definition: config.cpp:144
const bool TRUE
Definition: qglobal.h:371
static QCString str
void Config::setHeader ( const char *  header)
inline

Definition at line 468 of file config.h.

468 { m_header = header; }
QCString m_header
Definition: config.h:573
void Config::substituteEnvironmentVars ( )

Replaces references to environment variable by the actual value of the environment variable.

Definition at line 3027 of file config.cpp.

3028 {
3030  ConfigOption *option;
3031  for (;(option=it.current());++it)
3032  {
3033  option->substEnvVars();
3034  }
3035 }
intermediate_table::iterator iterator
type * current() const
Definition: qlist.h:146
virtual void substEnvVars()=0
QCString Config::takeStartComment ( )
inline

Take the user start comment and reset it internally

Returns
user start comment

Definition at line 525 of file config.h.

526  {
529  return result.replace(QRegExp("\r"),"");
530  }
bool resize(uint newlen)
Definition: qcstring.h:225
static QCString result
The QRegExp class provides pattern matching using regular expressions or wildcards.
Definition: qregexp.h:46
QCString m_startComment
Definition: config.h:570
QCString & replace(uint index, uint len, const char *s)
Definition: qcstring.cpp:411
QCString Config::takeUserComment ( )
inline

Take the user comment and reset it internally

Returns
user comment

Definition at line 534 of file config.h.

535  {
538  return result.replace(QRegExp("\r"),"");
539  }
bool resize(uint newlen)
Definition: qcstring.h:225
static QCString result
The QRegExp class provides pattern matching using regular expressions or wildcards.
Definition: qregexp.h:46
QCString m_userComment
Definition: config.h:571
QCString & replace(uint index, uint len, const char *s)
Definition: qcstring.cpp:411
void Config::writeTemplate ( FTextStream t,
bool  shortIndex,
bool  updateOnly 
)

Writes a template configuration to stream t. If shortIndex is TRUE the description of each configuration option will be omitted.

Definition at line 2861 of file config.cpp.

2862 {
2863  /* print first lines of user comment that were at the beginning of the file, might have special meaning for editors */
2864  if (m_startComment)
2865  {
2866  t << takeStartComment() << endl;
2867  }
2868  t << "# Doxyfile " << versionString << endl << endl;
2869  if (!sl)
2870  {
2871  t << convertToComment(m_header,"");
2872  }
2874  ConfigOption *option;
2875  for (;(option=it.current());++it)
2876  {
2877  option->writeTemplate(t,sl,upd);
2878  }
2879  /* print last lines of user comment that were at the end of the file */
2880  if (m_userComment)
2881  {
2882  t << "\n";
2883  t << takeUserComment();
2884  }
2885 }
intermediate_table::iterator iterator
static QCString convertToComment(const QCString &s, const QCString &u)
Definition: config.cpp:694
QCString takeStartComment()
Definition: config.h:525
char versionString[]
Definition: version.cpp:1
type * current() const
Definition: qlist.h:146
QCString takeUserComment()
Definition: config.h:534
QTextStream & endl(QTextStream &s)
virtual void writeTemplate(FTextStream &t, bool sl, bool upd)=0

Member Data Documentation

bool Config::fCreateIfMissing

Definition at line 109 of file cvnCreateDB.cc.

bool Config::fErrorIfExists

Definition at line 107 of file cvnCreateDB.cc.

std::string Config::fLabeling

Definition at line 114 of file cvnCreateDB.cc.

unsigned int Config::fLabelingMode

Definition at line 115 of file cvnCreateDB.cc.

float Config::fMaxEnergyForLabel

Definition at line 123 of file cvnCreateDB.cc.

unsigned int Config::fMaxKeyLength

Definition at line 111 of file cvnCreateDB.cc.

unsigned int Config::fNEvents

Limit the number of entries in the tree to consider.

Flag to control whether or not we write HDF5 regression features Limit the number of entries in the tree to consider

Definition at line 125 of file cvnCreateDB.cc.

unsigned int Config::fNTrainPerTest

Number of training examples for each test sample, e.g. 4 for 80/20 split.

Definition at line 103 of file cvnCreateDB.cc.

std::string Config::fOutputDir

Definition at line 54 of file cvnCreateZlibImages.cc.

std::string Config::fOutputFormat

Definition at line 93 of file cvnCreateDB.cc.

int Config::fPlaneLimit

Limit the number of wires in the output image.

Definition at line 127 of file cvnCreateDB.cc.

unsigned int Config::fProgressInterval

Number of examples in between progress updates (% complete)

Definition at line 105 of file cvnCreateDB.cc.

std::string Config::fRegressionHDF5NameTest

Definition at line 122 of file cvnCreateDB.cc.

std::string Config::fRegressionHDF5NameTrain

Definition at line 121 of file cvnCreateDB.cc.

std::vector< bool > Config::fReverseViews

Views to reverse.

Definition at line 131 of file cvnCreateDB.cc.

bool Config::fSetLog

Number of training examples for each test sample, e.g. 4 for 80/20 split Number of examples in between progress updates (% complete)

Definition at line 108 of file cvnCreateDB.cc.

int Config::fTDCLimit

Limit the number of TDCs in the output image.

Definition at line 129 of file cvnCreateDB.cc.

std::string Config::fTestOutputDir

Definition at line 99 of file cvnCreateDB.cc.

std::string Config::fTrainingBranchObjectName

Definition at line 98 of file cvnCreateDB.cc.

std::string Config::fTrainOutputDir

Definition at line 100 of file cvnCreateDB.cc.

std::string Config::fTreeName

Definition at line 97 of file cvnCreateDB.cc.

bool Config::fUseGeV

Definition at line 117 of file cvnCreateDB.cc.

unsigned int Config::fWriteBufferSize

Definition at line 112 of file cvnCreateDB.cc.

bool Config::fWriteRegressionHDF5

Flag to control whether or not we write HDF5 regression features.

Definition at line 120 of file cvnCreateDB.cc.

bool Config::fWriteSync

Definition at line 110 of file cvnCreateDB.cc.

QDict<ConfigOption>* Config::m_dict
private

Definition at line 568 of file config.h.

QList<ConfigOption>* Config::m_disabled
private

Definition at line 567 of file config.h.

QCString Config::m_header
private

Definition at line 573 of file config.h.

bool Config::m_initialized
private

Definition at line 572 of file config.h.

Config * Config::m_instance = 0
staticprivate

Definition at line 569 of file config.h.

QList<ConfigOption>* Config::m_obsolete
private

Definition at line 566 of file config.h.

QList<ConfigOption>* Config::m_options
private

Definition at line 565 of file config.h.

QCString Config::m_startComment
private

Definition at line 570 of file config.h.

QCString Config::m_userComment
private

Definition at line 571 of file config.h.


The documentation for this class was generated from the following files: