1 /**************************************************************************
2 ** (c) Copyright 2002, Andromeda Technology & Automation
3 ***************************************************************************
4 ** MODULE INFORMATION *
5 ***********************
6 ** FILE NAME : configuration.h
7 ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation
8 ** VERSION NUMBER : $Revision: 1.1 $
10 ** DESCRIPTION : Definition of configuration class
12 ** EXPORTED OBJECTS : class configuration
14 ** MODULES USED : String
15 ***************************************************************************
16 ** ADMINISTRATIVE INFORMATION *
17 ********************************
18 ** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
19 ** CREATION DATE : Jul 24, 2002
22 **************************************************************************/
24 /*****************************
25 $Log: configuration.h,v $
26 Revision 1.1 2002-07-25 08:01:26 arjen
27 First checkin, AXE release 0.2
29 *****************************/
31 /* static const char *RCSID = "$Id: configuration.h,v 1.1 2002-07-25 08:01:26 arjen Exp $"; */
33 #ifndef CONFIGURATION_H
34 #define CONFIGURATION_H
36 #include <parser.h> // usually in /usr/include/gnome-xml, see xml-config
41 ///////////////////////////////////////////////////////////////////////////
42 // NAME : configuration
48 // DESCRIPTION : Handle configurational parameters for the application.
49 // Many applications need some permanently stored configurational
50 // data. The information is usually stored in two places: A system-
51 // wide configuration file and a configuration file per user.
52 // The content of the configuration file is in XML format.
53 // The configuration base class takes care of finding the configuration
54 // files, e.g. in /etc/app.conf or in /usr/loca/etc/app.conf, along
55 // with the configuration file in the user's home directory.
56 // The config files are parsed with the gnome XML parser and a
57 // framework is provided to find configurational items.
61 // LAST MODIFIED : Jul 24, 2002
62 ///////////////////////////////////////////////////////////////////////////
68 xmlDocPtr system; // The system-wide config tree
69 xmlDocPtr user; // User-specific config tree
70 String app_name; // Name of the application and XML root element
72 xmlNodePtr xmlFindTag(xmlNodePtr, const String);
83 // Find the config files and parse the XML
85 bool read(const String name);
87 // Return the value of a config parameter
89 String find_parameter(const String section, const String parameter);
93 #endif // CONFIGURATION_H