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

Loading...
Searching...
No Matches
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
37 namespace 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
54 etage(user_interaction & ui,
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;
83 datetime last_mod;
84 datetime last_acc;
85 };
86
88
89} // end of namespace
90
91#endif
libdar::datetime
stores time information
Definition datetime.hpp:59
libdar::etage::last_acc
datetime last_acc
the last_acc of the directory itself
Definition etage.hpp:84
libdar::etage::fichier
std::deque< cell > fichier
holds the list of entry in the directory
Definition etage.hpp:82
libdar::etage::last_mod
datetime last_mod
the last_lod of the directory itself
Definition etage.hpp:83
libdar::user_interaction
This is a pure virtual class that is used by libdar when interaction with the user is required.
Definition user_interaction.hpp:58
datetime.hpp
this file contains the definition of class datetime that stores unix times in a portable way
entrepot_aux.hpp
set of datastructures used to interact with entrepot objects
libdar::inode_type
inode_type
type of inode
Definition entrepot_aux.hpp:42
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
user_interaction.hpp
defines the interaction interface between libdar and users.