Disk ARchive
2.4.5
|
00001 /*********************************************************************/ 00002 // dar - disk archive - a backup/restoration program 00003 // Copyright (C) 2002-2052 Denis Corbin 00004 // 00005 // This program is free software; you can redistribute it and/or 00006 // modify it under the terms of the GNU General Public License 00007 // as published by the Free Software Foundation; either version 2 00008 // of the License, or (at your option) any later version. 00009 // 00010 // This program is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with this program; if not, write to the Free Software 00017 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00018 // 00019 // to contact the author : dar.linux@free.fr 00020 /*********************************************************************/ 00021 // $Id$ 00022 // 00023 /*********************************************************************/ 00024 00025 #ifndef FILTRE_HPP 00026 #define FILTRE_HPP 00027 00028 #include <vector> 00029 #include "mask.hpp" 00030 #include "compressor.hpp" 00031 #include "catalogue.hpp" 00032 #include "path.hpp" 00033 00034 struct statistics 00035 { 00036 infinint treated; // saved | restored 00037 infinint hard_links; // hard linked stored 00038 infinint skipped; // not changed since last backup | file not restored because not saved in backup 00039 infinint ignored; // ignored due to filter 00040 infinint tooold; // ignored because less recent than the filesystem entry 00041 infinint errored; // could not be saved | could not be restored (filesystem access wrights) 00042 infinint deleted; // deleted file seen | number of files deleted 00043 infinint ea_treated; // number of EA saved | number of EA restored 00044 00045 void clear() { treated = hard_links = skipped = ignored = tooold = errored = deleted = ea_treated = 0; }; 00046 infinint total() const 00047 { 00048 return treated+skipped+ignored+tooold+errored+deleted; 00049 // hard_link are also counted in other counters 00050 }; 00051 }; 00052 00053 extern void filtre_restore(const mask &filtre, 00054 const mask & subtree, 00055 catalogue & cat, 00056 bool detruire, 00057 const path & fs_racine, 00058 bool fs_allow_overwrite, 00059 bool fs_warn_overwrite, 00060 bool info_details, statistics & st, 00061 bool only_if_more_recent, 00062 bool restore_ea_root, 00063 bool restore_ea_user, 00064 bool flat, 00065 bool ignore_owner); 00066 00067 extern void filtre_sauvegarde(const mask &filtre, 00068 const mask &subtree, 00069 compressor *stockage, 00070 catalogue & cat, 00071 catalogue &ref, 00072 const path & fs_racine, 00073 bool info_details, 00074 statistics & st, 00075 bool make_empty_dir, 00076 bool save_ea_root, 00077 bool save_ea_user, 00078 const mask &compr_mask, 00079 const infinint & min_compr_size, 00080 bool nodump); 00081 00082 extern void filtre_difference(const mask &filtre, 00083 const mask &subtree, 00084 catalogue & cat, 00085 const path & fs_racine, 00086 bool info_details, statistics & st, 00087 bool check_ea_root, 00088 bool check_ea_user); 00089 00090 extern void filtre_test(const mask &filtre, 00091 const mask &subtree, 00092 catalogue & cat, 00093 bool info_details, 00094 statistics & st); 00095 00096 extern void filtre_isolate(catalogue & cat, 00097 catalogue & ref, 00098 bool info_details); 00099 00100 #endif