Disk ARchive: restore_tree.hpp Source File

| Disk ARchive 2.8.1 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-2025 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
43extern "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
55namespace libdar
56{
57 class restore_tree
58 {
59 public:
60 restore_tree(const data_tree* source, const datetime & ignore_more_recent_than_that);
61 restore_tree(const restore_tree & ref) = delete;
62 restore_tree(restore_tree && ref) noexcept = default;
63 restore_tree & operator = (const restore_tree & ref) = delete;
64 restore_tree & operator = (restore_tree && ref) noexcept = default;
65 ~restore_tree() = default;
66
68
74 bool restore_from(const std::string & chem, archive_num num) const;
75
76 private:
77 std::set<archive_num> locations;
78 std::map<std::string, std::unique_ptr<restore_tree> > children;
79
80 const restore_tree* lookup(path & chem) const;
81 bool result_for(archive_num num) const { return locations.find(num) != locations.end(); };
82 };
83
84} // end of namespace
85
86#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
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