1 #=====================================================================
2 # SQL-Ledger Accounting
5 # Author: Dieter Simader
6 # Email: dsimader@sql-ledger.org
7 # Web: http://www.sql-ledger.org
11 # This program is free software; you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 2 of the License, or
14 # (at your option) any later version.
16 # This program is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write to the Free Software
22 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #=====================================================================
25 # routines to retrieve / manipulate win ini style files
26 # ORDER is used to keep the elements in the order they appear in .ini
28 #=====================================================================
34 my ($type, $file, $level) = @_;
40 $type = ref($self) || $self;
42 open FH, "$file" or Form->error("$file : $!");
53 # remove any trailing whitespace
61 # if there is a level skip
62 if ($skip = ($id !~ /^$level/)) {
66 push @{$self->{ORDER}}, $_;
73 # add key=value to $id
74 my ($key, $value) = split /=/, $_, 2;
76 $self->{$id}{$key} = $value;