![]() |
Disk ARchive
2.5.2
Full featured and portable backup and archiving tool
|
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 : http://dar.linux.free.fr/email.html 00020 /*********************************************************************/ 00021 // $Id: entrepot.hpp,v 1.1 2012/04/27 11:24:30 edrusb Exp $ 00022 // 00023 /*********************************************************************/ 00024 00025 00036 00038 00039 #ifndef ENTREPOT_LOCAL_HPP 00040 #define ENTREPOT_LOCAL_HPP 00041 00042 #include "../my_config.h" 00043 00044 #include <string> 00045 #include "infinint.hpp" 00046 #include "generic_file.hpp" 00047 #include "user_interaction.hpp" 00048 #include "entrepot.hpp" 00049 #include "fichier_global.hpp" 00050 #include "hash_fichier.hpp" 00051 #include "etage.hpp" 00052 #include "path.hpp" 00053 00054 namespace libdar 00055 { 00058 00062 00063 class entrepot_local : public entrepot 00064 { 00065 public: 00066 entrepot_local(const std::string & user, const std::string & group, bool x_furtive_mode); 00067 entrepot_local(const entrepot_local & ref): entrepot(ref) { copy_from(ref); }; 00068 entrepot_local & operator = (const entrepot_local & ref); 00069 ~entrepot_local() { detruit(); }; 00070 00071 std::string get_url() const { return std::string("file://") + get_full_path().display(); }; 00072 00073 void read_dir_reset(); 00074 bool read_dir_next(std::string & filename); 00075 00076 entrepot *clone() const { return new (get_pool()) entrepot_local(*this); }; 00077 00078 protected: 00079 fichier_global *inherited_open(user_interaction & dialog, 00080 const std::string & filename, 00081 gf_mode mode, 00082 bool force_permission, 00083 U_I permission, 00084 bool fail_if_exists, 00085 bool erase) const; 00086 00087 void inherited_unlink(const std::string & filename) const; 00088 void read_dir_flush() { detruit(); }; 00089 00090 private: 00091 bool furtive_mode; 00092 etage *contents; 00093 00094 void copy_from(const entrepot_local & ref) { furtive_mode = ref.furtive_mode; contents = nullptr; }; 00095 void detruit() { if(contents != nullptr) { delete contents; contents = nullptr; } }; 00096 }; 00097 00099 00100 } // end of namespace 00101 00102 #endif