#!/usr/bin/perl
# -----------------------------------------------------------------------------
# TWC
# Treuwert-Computer GmbH
# Schloßbergring 9
# 79098 Freiburg
#
# Author: Klaus Reger <K.Reger@twc.de>
#
# -----------------------------------------------------------------------------
# Program-Data
# -----------------------------------------------------------------------------
# Project  :
# System   :
# Program  :
# Module   : $RCSfile: TestConfigFile.t,v $
# Version  : $Revision: 1.1 $
# Date     : $Date: 2002/02/28 15:23:50 $
# State    : $State: Exp $
#
# Description:
#   This module handles all the things of WWWdb, which have
#   to do with ConfigFile
#
# Change-log (See at end of this file)
#
# --- Known Bugs -------------
# please look at the BUGS-File
# --- TODO -------------------
# please look at the TODO-File
# ----------------------------------------------------------------------------


use WWWdb::ConfigFile;

$cTmpFileGL = "/tmp/ConfigFile_$$.ini";

# Put the __END__ section in a file
open TMP, ">" . $cTmpFileGL or
    die "Can't open '$cTmpFileGL'!\n";

while (<DATA>)
{
   print TMP $_;
}

close TMP;

# system ("cp ../lib/WWWdb/Demo/Contacts.rc $cTmpFileGL");

$oConfigFileGL = ConfigFile->new($cTmpFileGL);

$cValue = $oConfigFileGL->getValue("Section1", "entry1_1", "NULL");
$oConfigFileGL->setValue("Section1", "entry1_1", "XXX" . "$cValue" . "XXX");
$oConfigFileGL->setValue("Section_New", "entry_new", "Empty");
$oConfigFileGL->setValue("Section_New", "entry_new", "N*E*W");

$oConfigFileGL->WriteFile_Ini();
$oConfigFileGL->WriteFile_XML();

$oConfigFileGL->ShowAttributes();

$oConfigFileGL->Dump();


# print "ENTER:";
# <STDIN>;

unlink $cTmpFileGL;

exit 0;

__END__
# This is a demo config-file
# And this comment is for the complete file

; Here is the Data for section1 (before)
[Section1]
# This (after) comment belongs to Section1


multi_lined_entry = <<EOF
1
2
3
4
5
EOF

# Comment before entry1_1
entry1_1 = Value1_1
# Comment after entry1_1


# Comment before entry1_2

entry1_2 = Value1_2
# Comment after entry1_2

# Another comment after entry1_2


entry1_3 = Value1_3


# Comment after entry1_3

# Another comment after entry1_3



; Here is the Data for section2
# Comment before Section2
[Section2]

entry2_1 = Value2_1
# Comment after entry2_1


# End-Comment of this document

# line 1

# line 2

# line 3

# line 4


