LogService
libdadi: utility tools for distributed applications
ReadConfig.hh
1 /****************************************************************************/
2 /* Header of the ReadConfig class */
3 /* */
4 /* Author(s): */
5 /* - Georg Hoesch (hoesch@in.tum.de) */
6 /* - Cyrille Pontvieux (cyrille.pontvieux@edu.univ-fcomte.fr) */
7 /* */
8 /* This file is part of DIET . */
9 /* */
10 /* Copyright (C) 2000-2003 ENS Lyon, LIFC, INSA, INRIA and SysFera (2000) */
11 /* */
12 /* - Frederic.Desprez@ens-lyon.fr (Project Manager) */
13 /* - Eddy.Caron@ens-lyon.fr (Technical Manager) */
14 /* - Tech@sysfera.com (Maintainer and Technical Support) */
15 /* */
16 /* This software is a computer program whose purpose is to provide an */
17 /* distributed logging services. */
18 /* */
19 /* */
20 /* This software is governed by the CeCILL license under French law and */
21 /* abiding by the rules of distribution of free software. You can use, */
22 /* modify and/ or redistribute the software under the terms of the CeCILL */
23 /* license as circulated by CEA, CNRS and INRIA at the following URL */
24 /* "http://www.cecill.info". */
25 /* */
26 /* As a counterpart to the access to the source code and rights to copy, */
27 /* modify and redistribute granted by the license, users are provided */
28 /* only with a limited warranty and the software's author, the holder */
29 /* of the economic rights, and the successive licensors have only */
30 /* limited liability. */
31 /* */
32 /* In this respect, the user's attention is drawn to the risks */
33 /* associated with loading, using, modifying and/or developing or */
34 /* reproducing the software by the user in light of its specific status */
35 /* of free software, that may mean that it is complicated to */
36 /* manipulate, and that also therefore means that it is reserved for */
37 /* developers and experienced professionals having in-depth computer */
38 /* knowledge. Users are therefore encouraged to load and test the */
39 /* software's suitability as regards their requirements in conditions */
40 /* enabling the security of their systems and/or data to be ensured and, */
41 /* more generally, to use and operate it in the same conditions as */
42 /* regards security. */
43 /* */
44 /* The fact that you are presently reading this means that you have had */
45 /* knowledge of the CeCILL license and that you accept its terms. */
46 /* */
47 /****************************************************************************/
48 /* $Id$
49  * $Log$
50  * Revision 1.1 2004/01/09 11:07:12 ghoesch
51  * Restructured the whole LogService source tree.
52  * Added autotools make process. Cleaned up code.
53  * Removed some testers. Ready to release.
54  *
55  ***************************************************************************/
56 
57 #ifndef _READCONFIG_HH_
58 #define _READCONFIG_HH_
59 
60 #include <cstdio>
61 #include "LogTypes.hh"
62 
63 const short LS_PARSE_ALREADYPARSED = 1;
64 const short LS_PARSE_FILEERROR = 2;
65 const short LS_PARSE_SECTIONNOTFOUND = 3;
66 
67 class ReadConfig {
68 public:
69  ReadConfig(const char* configFilename, bool* success);
70 
71  ~ReadConfig();
72 
77  short
78  parse();
79 
84  unsigned int
85  getTracelevel();
86 
91  unsigned int
92  getPort();
93 
98  char*
100 
105  char*
107 
114  tag_list_t*
115  getDynamicTags();
116 
121  tag_list_t*
122  getStaticTags();
123 
130  tag_list_t*
131  getUniqueTags();
132 
137  tag_list_t*
138  getVolatileTags();
139 
144  tag_list_t*
145  getStateTags();
146 
151  tag_list_t*
152  getAllTags();
153 
154 private:
155  char*
156  readLine(FILE* file);
157 
158  short
159  parseTagSection(FILE* file, const char* sectionName, tag_list_t* taglist);
160 
161  void
162  appendToList(tag_list_t* list, tag_list_t* appendlist);
163 
164  char* filename;
165  bool alreadyParsed;
166 
167  unsigned int tracelevel;
168  unsigned int port;
169  char* startSuffix;
170  char* stopSuffix;
171  tag_list_t* dynamicTags;
172  tag_list_t* staticTags;
173  tag_list_t* uniqueTags;
174  tag_list_t* volatileTags;
175 };
176 
177 #endif
178 
unsigned int getTracelevel()
char * getDynamicStartSuffix()
tag_list_t * getDynamicTags()
tag_list_t * getStateTags()
tag_list_t * getVolatileTags()
unsigned int getPort()
short parse()
Definition: LogTypes.hh:221
Definition: ReadConfig.hh:67
tag_list_t * getUniqueTags()
char * getDynamicStopSuffix()
tag_list_t * getAllTags()
tag_list_t * getStaticTags()