Disk ARchive
2.4.5
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
src
libdar
semaphore.hpp
Go to the documentation of this file.
1
/*********************************************************************/
2
// dar - disk archive - a backup/restoration program
3
// Copyright (C) 2002-2052 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
//
19
// to contact the author : http://dar.linux.free.fr/email.html
20
/*********************************************************************/
21
// $Id: semaphore.hpp,v 1.4.2.1 2012/02/19 17:25:09 edrusb Rel $
22
//
23
/*********************************************************************/
24
//
25
29
30
#ifndef SEMAPHORE_HPP
31
#define SEMAPHORE_HPP
32
33
#include "../my_config.h"
34
35
#include "
mem_ui.hpp
"
36
#include "
mask.hpp
"
37
#include "
catalogue.hpp
"
38
39
namespace
libdar
40
{
41
44
46
67
68
69
class
semaphore
:
public
mem_ui
70
{
71
public
:
72
74
81
semaphore
(
user_interaction
& dialog,
82
const
std::string & backup_hook_file_execute,
83
const
mask
& backup_hook_file_mask);
84
86
semaphore
(
const
semaphore
& ref) :
mem_ui
(ref.
get_ui
()) { copy_from(ref); };
87
89
semaphore
&
operator =
(
const
semaphore
& ref) {
detruit
(); copy_from(ref);
return
*
this
; };
90
92
~semaphore
() {
detruit
(); };
93
95
104
void
raise
(
const
std::string &
path
,
105
const
entree
*object,
106
bool
data_to_save);
107
109
void
lower
();
110
111
#ifdef LIBDAR_SPECIAL_ALLOC
112
USE_SPECIAL_ALLOC(
semaphore
);
113
#endif
114
private
:
115
infinint
count;
//< is the number of subdirectories currently saved in the last directory that matched the mask
116
std::string chem;
//< path of the file that has to be call in the "end" context when count will drop to zero
117
std::string filename;
//< filename of that same file
118
infinint
uid;
//< UID of that same file
119
infinint
gid;
//< GID of that same file
120
std::string execute;
//< command to execute
121
const
mask
*match;
//< for which file to run the execute command
122
123
std::string build_string(
const
std::string & context);
124
void
copy_from(
const
semaphore
& ref);
125
void
detruit
();
126
};
127
129
130
}
// end of namespace
131
132
#endif
Generated on Wed Jun 13 2012 09:36:50 for Disk ARchive by
1.8.1