My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
config.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright (C) 1997-2015 by Dimitri van Heesch.
4  *
5  * Permission to use, copy, modify, and distribute this software and its
6  * documentation under the terms of the GNU General Public License is hereby
7  * granted. No representations are made about the suitability of this software
8  * for any purpose. It is provided "as is" without express or implied warranty.
9  * See the GNU General Public License for more details.
10  *
11  * Documents produced by Doxygen are derivative works derived from the
12  * input used in their production; they are not affected by this license.
13  *
14  */
15 
16 #ifndef CONFIG_H
17 #define CONFIG_H
18 
19 class FTextStream;
20 
21 // note: this header file is generated from config.xml
22 #include "configvalues.h"
23 
27 #if DYNAMIC_LOOKUP // for debug purposes
28 #define Config_getString(val) (ConfigValues::instance().*((ConfigValues::InfoString*)ConfigValues::instance().get(#val))->item)
29 #define Config_getBool(val) (ConfigValues::instance().*((ConfigValues::InfoBool*)ConfigValues::instance().get(#val))->item)
30 #define Config_getInt(val) (ConfigValues::instance().*((ConfigValues::InfoInt*)ConfigValues::instance().get(#val))->item)
31 #define Config_getEnum(val) (ConfigValues::instance().*((ConfigValues::InfoString*)ConfigValues::instance().get(#val))->item)
32 #define Config_getList(val) (ConfigValues::instance().*((ConfigValues::InfoList*)ConfigValues::instance().get(#val))->item)
33 #else // direct access
34 #define Config_getString(val) (ConfigValues::instance().val)
35 #define Config_getBool(val) (ConfigValues::instance().val)
36 #define Config_getInt(val) (ConfigValues::instance().val)
37 #define Config_getEnum(val) (ConfigValues::instance().val)
38 #define Config_getList(val) (ConfigValues::instance().val)
39 #endif
40 
41 
43 namespace Config
44 {
46  void init();
47 
52  void writeTemplate(FTextStream &t,bool shortList,bool updateOnly=FALSE);
53 
58  bool parse(const char *fileName,bool update=FALSE);
59 
64  void postProcess(bool clearHeaderAndFooter);
65 
67  void checkAndCorrect();
68 
70  void deinit();
71 }
72 
73 #endif