2 /**************************************************************************
3 ** (c) Copyright 2002, Andromeda Technology & Automation
4 ** This is free software; you can redistribute it and/or modify it under the
5 ** terms of the GNU General Public License, see the file COPYING.
6 ***************************************************************************
7 ** MODULE INFORMATION *
8 ***********************
9 ** FILE NAME : gnucomo_config.cpp
10 ** SYSTEM NAME : Gnucomo - Gnu Computer Monitoring
11 ** VERSION NUMBER : $Revision: 1.3 $
13 ** DESCRIPTION : Implementation of the gnucomo_config class.
18 ***************************************************************************
19 ** ADMINISTRATIVE INFORMATION *
20 ********************************
21 ** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
22 ** CREATION DATE : Jul 24, 2002
23 ** LAST UPDATE : Nov 02, 2002
25 **************************************************************************/
27 /*****************************
28 $Log: gnucomo_config.cpp,v $
29 Revision 1.3 2002-11-09 08:04:27 arjen
30 Added a reference to the GPL
32 Revision 1.2 2002/11/04 10:13:36 arjen
33 Use proper namespace for iostream classes
35 Revision 1.1 2002/10/05 10:25:49 arjen
36 Creation of gcm_input and a first approach to a web interface
38 *****************************/
40 static const char *RCSID = "$Id: gnucomo_config.cpp,v 1.3 2002-11-09 08:04:27 arjen Exp $";
42 #include "gnucomo_config.h"
46 /*=========================================================================
48 ** SYNOPSIS : String gnucomo_config::Database()
50 ** RETURN VALUE : The database access string
58 ** LAST MODIFIED : Nov 02, 2002
59 **=========================================================================
62 String gnucomo_config::Database()
65 String access_string("");
67 param = find_parameter("database", "name");
70 access_string += "dbname=" + param;
73 param = find_parameter("database", "user");
76 access_string += " user=" + param;
78 param = find_parameter("database", "password");
81 access_string += " password=" + param;
84 param = find_parameter("database", "host");
87 access_string += " host=" + param;
89 param = find_parameter("database", "port");
92 access_string += " port=" + param;