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

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

label.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
25
26 #ifndef LABEL_HPP
27 #define LABEL_HPP
28
29 #include "../my_config.h"
30
31 #include "integers.hpp"
32 #include "generic_file.hpp"
33 #include "on_pool.hpp"
34
35 namespace libdar
36 {
37
40
41 class label : public on_pool
42 {
43 public:
44 label(); // builds a label equal to 'zero'
45 label(const label & ref) { copy_from(ref); };
46 const label & operator = (const label & ref) { copy_from(ref); return *this; };
47
48 bool operator == (const label & ref) const;
49 bool operator != (const label & ref) const { return ! ((*this) == ref); };
50
51 void clear();
52 bool is_cleared() const;
53
54 void generate_internal_filename();
55
56 void read(generic_file & f);
57 void dump(generic_file & f) const;
58
59 void invert_first_byte() { val[0] = ~val[0]; };
60
61 // avoid using these two calls, only here for backward compatibility
62 // where the cost to move to object is really too heavy than
63 // sticking with an char array.
64 U_I size() const { return LABEL_SIZE; };
65 char *data() { return (char *)&val; };
66 const char *data() const { return (char *)&val; };
67
68 static U_I common_size() { return LABEL_SIZE; };
69
70 private:
71 static const U_I LABEL_SIZE = 10;
72
73 char val[LABEL_SIZE];
74
75 void copy_from(const label & ref);
76 };
77
78
79 extern const label label_zero;
80
82
83 } // end of namespace
84
85 #endif
integers.hpp
are defined here basic integer types that tend to be portable
generic_file.hpp
class generic_file is defined here as well as class fichierthe generic_file interface is widely used ...
on_pool.hpp
this is the base class of object that can be allocated on a memory pool
libdar
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47