1 // KDat - a tar-based DAT archiver
2 // Copyright (C) 1998-2000 Sean Vyain, svyain@mail.tds.net
3 // Copyright (C) 2001-2002 Lawrence Widman, kdat@cardiothink.com
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef _BackupProfile_h_
20 #define _BackupProfile_h_
23 #include <q3strlist.h>
26 * @short This class stores all the information necessary to perform a backup.
30 QString _lastSavedName
;
32 QString _workingDirectory
;
33 QStringList _relativeFiles
;
34 QStringList _absoluteFiles
;
37 QString _snapshotFile
;
40 void calcRelativeFiles();
43 * Create a new backup profile.
48 * Load the named backup profile from disk.
50 * @param name The name of the backup profile.
52 BackupProfile( const QString
& name
);
55 * Destroy the backup profile.
60 * Load the backup profile from disk.
65 * Save the backup profile to disk. If the backup profile was renamed,
66 * the old backup profile will be removed.
71 * Query the name of this backup profile.
73 * @return The name of this profile.
78 * Query the name of the archive.
80 * @return The name of the new archive.
82 QString
getArchiveName();
85 * Query the working directory for the tar command.
87 * @return The working directory.
89 QString
getWorkingDirectory();
92 * Query the list of files to backup, relative to the working directory.
94 * @return The file list.
96 const QStringList
& getRelativeFiles();
99 * Query the list of files to backup, with their full paths.
101 * @return The file list.
103 const QStringList
& getAbsoluteFiles();
106 * Query whether or not to cross filesystem boundaries when performing the
109 * @return TRUE if the backup is restricted to a single filesystem, FALSE
110 * if the backup can cross filesystem boundaries.
112 bool isOneFilesystem();
115 * Query whether this is to be a GNU incremental backup.
117 * @return TRUE if incremental, otherwise FALSE.
119 bool isIncremental();
122 * Query the name of the snapshot file to use for an incremental backup.
124 * @return The name of the snapshot file.
126 QString
getSnapshotFile();
129 * Query whether to remove the snapshot file before beginning an
130 * incremental backup. This has the effect of performing a full backup.
132 * @return TRUE if the snapshot file should be removed, otherwise FALSE.
134 bool getRemoveSnapshot();
137 * Set the name of this backup profile.
139 * @param name The name of this profile.
141 void setName( const QString
& name
);
144 * Set the name of the archive.
146 * @param archiveName The name of the new archive.
148 void setArchiveName( const QString
& archiveName
);
151 * Set the working directory for the tar command.
153 * @param workingDirectory The working directory.
155 void setWorkingDirectory( const QString
& workingDirectory
);
158 * Set the list of files to backup, with their full paths.
160 * @param files The file list.
162 void setAbsoluteFiles( const QStringList
& files
);
165 * Set whether or not to cross filesystem boundaries when performing the
168 * @param oneFilesystem TRUE if the backup is restricted to a single
169 * filesystem, FALSE if the backup can cross
170 * filesystem boundaries.
172 void setOneFilesystem( bool oneFilesystem
);
175 * Set whether this is to be a GNU incremental backup.
177 * @param incremental TRUE if incremental, otherwise FALSE.
179 void setIncremental( bool incremental
);
182 * Set the name of the snapshot file to use for an incremental backup.
184 * @param snapshotFile The name of the snapshot file.
186 void setSnapshotFile( const QString
& snapshotFile
);
189 * Set whether to remove the snapshot file before beginning an
190 * incremental backup. This has the effect of performing a full backup.
192 * @param removeSnapshot TRUE if the snapshot file should be removed,
195 void setRemoveSnapshot( bool removeSnapshot
);