Disk ARchive 2.8.0
Full featured and portable backup and archiving tool
etage.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
25
26
27#ifndef ETAGE_HPP
28#define ETAGE_HPP
29
30#include "../my_config.h"
31#include <deque>
32#include <string>
33#include "datetime.hpp"
34#include "user_interaction.hpp"
35#include "entrepot_aux.hpp"
36
37namespace libdar
38{
39
42
44
49
50 class etage
51 {
52 public:
53 etage() { fichier.clear(); last_mod = datetime(0); last_acc = datetime(0); }; // required to fake an empty dir when one is impossible to open
55 const char *dirname,
56 const datetime & x_last_acc,
57 const datetime & x_last_mod,
58 bool cache_directory_tagging,
59 bool furtive_read_mode);
60 etage(const etage & ref) = default;
61 etage(etage && ref) = default;
62 etage & operator = (const etage & ref) = default;
63 etage & operator = (etage && ref) noexcept = default;
64 ~etage() = default;
65
66 bool read(std::string & ref, inode_type & tp);
67 bool is_empty() const { return fichier.empty(); };
68 datetime get_last_mod() const { return last_mod; };
69 datetime get_last_acc() const { return last_acc; };
70
71 private:
72
73 struct cell
74 {
75 std::string name;
76 inode_type type;
77
78 cell(const std::string & filename,
79 inode_type tp): name(filename), type(tp) {};
80 };
81
82 std::deque<cell> fichier;
85 };
86
88
89} // end of namespace
90
91#endif
stores time information
Definition: datetime.hpp:59
the etage structure keep trace of directory contents
Definition: etage.hpp:51
datetime last_acc
the last_acc of the directory itself
Definition: etage.hpp:84
std::deque< cell > fichier
holds the list of entry in the directory
Definition: etage.hpp:82
datetime last_mod
the last_lod of the directory itself
Definition: etage.hpp:83
This is a pure virtual class that is used by libdar when interaction with the user is required.
this file contains the definition of class datetime that stores unix times in a portable way
set of datastructures used to interact with entrepot objects
inode_type
type of inode
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47
defines the interaction interface between libdar and users.