Use proper namespace for iostream classes
[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.2 $
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     : Nov 02, 2002
22 **      MODIFICATIONS   : 
23 **************************************************************************/
24
25 /*****************************
26    $Log: gnucomo_config.cpp,v $
27    Revision 1.2  2002-11-04 10:13:36  arjen
28    Use proper namespace for iostream classes
29
30    Revision 1.1  2002/10/05 10:25:49  arjen
31    Creation of gcm_input and a first approach to a web interface
32
33 *****************************/
34
35 static const char *RCSID = "$Id: gnucomo_config.cpp,v 1.2 2002-11-04 10:13:36 arjen Exp $";
36
37 #include "gnucomo_config.h"
38
39
40
41 /*=========================================================================
42 **  NAME           : Database
43 **  SYNOPSIS       : String gnucomo_config::Database()
44 **  PARAMETERS     : 
45 **  RETURN VALUE   : The database access string
46 **
47 **  DESCRIPTION    : 
48 **
49 **  VARS USED      :
50 **  VARS CHANGED   :
51 **  FUNCTIONS USED :
52 **  SEE ALSO       :
53 **  LAST MODIFIED  : Nov 02, 2002
54 **=========================================================================
55 */
56
57 String gnucomo_config::Database()
58 {
59    String param;
60    String access_string("");
61
62    param = find_parameter("database", "name");
63    if (param != "")
64    {
65       access_string += "dbname=" + param;
66    }
67
68    param = find_parameter("database", "user");
69    if (param != "")
70    {
71       access_string += " user=" + param;
72    }
73    param = find_parameter("database", "password");
74    if (param != "")
75    {
76       access_string += " password=" + param;
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    return access_string;
90 }