Creation of gcm_input and a first approach to a web interface
[gnucomo.git] / src / lib / gnucomo_config.cpp
1
2 /**************************************************************************
3 **  (c) Copyright 2002, Andromeda Technology & Automation
4 ***************************************************************************
5 ** MODULE INFORMATION *
6 ***********************
7 **      FILE NAME      : gnucomo_config.cpp
8 **      SYSTEM NAME    : Gnucomo - Gnu Computer Monitoring
9 **      VERSION NUMBER : $Revision: 1.1 $
10 **
11 **  DESCRIPTION      :  Implementation of the gnucomo_config class.
12 **
13 **  EXPORTED OBJECTS : 
14 **  LOCAL    OBJECTS : 
15 **  MODULES  USED    :
16 ***************************************************************************
17 **  ADMINISTRATIVE INFORMATION *
18 ********************************
19 **      ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
20 **      CREATION DATE   : Jul 24, 2002
21 **      LAST UPDATE     : Jul 24, 2002
22 **      MODIFICATIONS   : 
23 **************************************************************************/
24
25 /*****************************
26    $Log: gnucomo_config.cpp,v $
27    Revision 1.1  2002-10-05 10:25:49  arjen
28    Creation of gcm_input and a first approach to a web interface
29
30 *****************************/
31
32 static const char *RCSID = "$Id: gnucomo_config.cpp,v 1.1 2002-10-05 10:25:49 arjen Exp $";
33
34 #include "gnucomo_config.h"
35
36
37
38 /*=========================================================================
39 **  NAME           : Database
40 **  SYNOPSIS       : String gnucomo_config::Database()
41 **  PARAMETERS     : 
42 **  RETURN VALUE   : The database access string
43 **
44 **  DESCRIPTION    : 
45 **
46 **  VARS USED      :
47 **  VARS CHANGED   :
48 **  FUNCTIONS USED :
49 **  SEE ALSO       :
50 **  LAST MODIFIED  : 
51 **=========================================================================
52 */
53
54 String gnucomo_config::Database()
55 {
56    String param;
57    String access_string("");
58
59    param = find_parameter("database", "name");
60    if (param != "")
61    {
62       access_string += "dbname=" + param;
63    }
64
65    param = find_parameter("database", "user");
66    if (param != "")
67    {
68       access_string += " user=" + param;
69    }
70    param = find_parameter("database", "password");
71    if (param != "")
72    {
73       access_string += " password=" + param;
74    }
75
76    /*  FIXME: This needs a fix in the AXE library first */
77
78    /*
79    param = find_parameter("database", "host");
80    if (param != "")
81    {
82       access_string += " host=" + param;
83    }
84    param = find_parameter("database", "port");
85    if (param != "")
86    {
87       access_string += " port=" + param;
88    }
89 */
90    return access_string;
91 }