filesystem_diff.hpp
Go to the documentation of this file.
/*********************************************************************/
// dar - disk archive - a backup/restoration program
// Copyright (C) 2002-2023 Denis Corbin
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// to contact the author, see the AUTHOR file
/*********************************************************************/
#ifndef FILESYSTEM_DIFF_HPP
#define FILESYSTEM_DIFF_HPP
#include "../my_config.h"
extern "C"
{
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
} // end extern "C"
#include <deque>
#include "cat_nomme.hpp"
#include "filesystem_hard_link_read.hpp"
#include <set>
namespace libdar
{
class filesystem_diff : public filesystem_hard_link_read
{
public:
filesystem_diff(const std::shared_ptr<user_interaction> & dialog,
const path &root,
bool x_info_details,
const mask & x_ea_mask,
bool alter_atime,
bool furtive_read_mode,
const fsa_scope & scope);
filesystem_diff(const filesystem_diff & ref) = delete;
filesystem_diff(filesystem_diff && ref) = delete;
filesystem_diff & operator = (const filesystem_diff & ref) = delete;
filesystem_diff & operator = (filesystem_diff && ref) = delete;
~filesystem_diff() { detruire(); };
void reset_read();
bool read_filename(const std::string & name, cat_nomme * &ref);
// looks for a file of name given in argument, in current reading directory
// if this is a directory, subsequent read take place in it
void skip_read_filename_in_parent_dir();
// subsequent calls to read_filename will take place in parent directory.
private:
struct filename_struct
{
datetime last_acc;
datetime last_mod;
};
path *fs_root;
bool info_details;
mask *ea_mask;
bool alter_atime;
bool furtive_read_mode;
path *current_dir;
std::deque<filename_struct> filename_pile;
void detruire();
};
} // end of namespace
#endif
cat_nomme.hpp
base class of all objects contained in a catalogue and that can be named
libdar::cat_nomme
the base class for all entry that have a name
Definition: cat_nomme.hpp:45
libdar::datetime
stores time information
Definition: datetime.hpp:59
libdar::filesystem_diff
make a flow of inode to feed the difference filter routine
Definition: filesystem_diff.hpp:56
libdar::filesystem_hard_link_read
keep trace of hard links when reading the filesystem
Definition: filesystem_hard_link_read.hpp:58
libdar::mask
the generic class, parent of all masks
Definition: mask.hpp:62
libdar::path
the class path is here to manipulate paths in the Unix notation: using'/'
Definition: path.hpp:51
filesystem_hard_link_read.hpp
filesystem_hard_link_read classes manages hardlinked inode read from filesystem
libdar::fsa_scope
std::set< fsa_family > fsa_scope
set of fsa families
Definition: fsa_family.hpp:70
libdar
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47