Changed Bilan des PC by Bilan des machines.
[BackupPC.git] / lib / BackupPC / Storage.pm
1 #============================================================= -*-perl-*-
2 #
3 # BackupPC::Storage package
4 #
5 # DESCRIPTION
6 #
7 #   This library defines a BackupPC::Storage class for reading/writing
8 #   data like config, host info, backup and restore info.
9 #
10 # AUTHOR
11 #   Craig Barratt  <cbarratt@users.sourceforge.net>
12 #
13 # COPYRIGHT
14 #   Copyright (C) 2004  Craig Barratt
15 #
16 #   This program is free software; you can redistribute it and/or modify
17 #   it under the terms of the GNU General Public License as published by
18 #   the Free Software Foundation; either version 2 of the License, or
19 #   (at your option) any later version.
20 #
21 #   This program is distributed in the hope that it will be useful,
22 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
23 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24 #   GNU General Public License for more details.
25 #
26 #   You should have received a copy of the GNU General Public License
27 #   along with this program; if not, write to the Free Software
28 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
29 #
30 #========================================================================
31 #
32 # Version 2.1.0, released 20 Jun 2004.
33 #
34 # See http://backuppc.sourceforge.net.
35 #
36 #========================================================================
37
38 package BackupPC::Storage;
39
40 use strict;
41 use BackupPC::Storage::Text;
42
43 sub new
44 {
45     my $class = shift;
46     my($paths) = @_;
47     my $flds = {
48         BackupFields => [qw(
49                     num type startTime endTime
50                     nFiles size nFilesExist sizeExist nFilesNew sizeNew
51                     xferErrs xferBadFile xferBadShare tarErrs
52                     compress sizeExistComp sizeNewComp
53                     noFill fillFromNum mangle xferMethod level
54                 )],
55         RestoreFields => [qw(
56                     num startTime endTime result errorMsg nFiles size
57                     tarCreateErrs xferErrs
58                 )],
59         ArchiveFields => [qw(
60                     num startTime endTime result errorMsg
61                 )],
62     };
63
64     return BackupPC::Storage::Text->new($flds, $paths, @_);
65 }
66
67 1;