| Disk ARchive 2.8.5 Full featured and portable backup and archiving tool

Loading...
Searching...
No Matches
restore_tree.hpp
Go to the documentation of this file.
1/*********************************************************************/
2// dar - disk archive - a backup/restoration program
3// Copyright (C) 2002-2026 Denis Corbin
4//
5// This program is free software; you can redistribute it and/or
6// modify it under the terms of the GNU General Public License
7// as published by the Free Software Foundation; either version 2
8// of the License, or (at your option) any later version.
9//
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.
14//
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.
18//
19// to contact the author, see the AUTHOR file
20/*********************************************************************/
21
37
38#ifndef RESTORE_TREE_HPP
39#define RESTORE_TREE_HPP
40
41#include "../my_config.h"
42
43 extern "C"
44{
45} // end extern "C"
46
47#include <string>
48#include <memory>
49#include <map>
50
51#include "path.hpp"
52#include "data_tree.hpp"
53#include "datetime.hpp"
54#include "mask.hpp"
55
56 namespace libdar
57{
58 class restore_tree
59 {
60 public:
61 restore_tree(const data_tree* source, const datetime & ignore_more_recent_than_that);
62 restore_tree(const restore_tree & ref) = delete;
63 restore_tree(restore_tree && ref) noexcept = default;
64 restore_tree & operator = (const restore_tree & ref) = delete;
65 restore_tree & operator = (restore_tree && ref) noexcept = default;
66 ~restore_tree() = default;
67
69
73 std::set<archive_num> get_locations(path & current_path,
74 const std::shared_ptr<mask> & the_mask) const;
75
76
78
84 bool restore_from(const path & chem, archive_num num) const;
85
86 private:
87 std::set<archive_num> locations;
88 std::map<std::string, std::unique_ptr<restore_tree> > children;
89
90 const restore_tree* lookup(const path & chem) const;
91 bool result_for(archive_num num) const { return locations.find(num) != locations.end(); };
92
93 };
94
95} // end of namespace
96
97#endif
data_tree.hpp
base classes used to store entree information in dar_manager databases
datetime.hpp
this file contains the definition of class datetime that stores unix times in a portable way
mask.hpp
here lies a collection of mask classes
my_config.h
include macro defined by the configure script and some specific additional ones
libdar
libdar namespace encapsulate all libdar symbols
Definition archive.hpp:47
path.hpp
here is the definition of the path class