Disk ARchive  2.5.12
Full featured and portable backup and archiving tool
cat_tools.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 CAT_TOOLS_HPP
27 #define CAT_TOOLS_HPP
28 
29 #include "../my_config.h"
30 
31 #include <string>
32 
33 #include "cat_inode.hpp"
34 
35 
36 extern "C"
37 {
38 } // end extern "C"
39 
40 
41 #define REMOVE_TAG gettext("[--- REMOVED ENTRY ----]")
42 #define SAVED_FAKE_BIT 0x80
43 
44 namespace libdar
45 {
46 
49 
50 
51  extern std::string local_perm(const cat_inode & ref, bool hard);
52  extern std::string local_uid(const cat_inode & ref);
53  extern std::string local_gid(const cat_inode & ref);
54  extern std::string local_size(const cat_inode & ref, bool sizes_in_bytes);
55  extern std::string local_storage_size(const cat_inode & ref);
56  extern std::string local_date(const cat_inode & ref);
57  extern std::string local_flag(const cat_inode & ref, bool isolated, bool dirty_seq);
58  extern void xml_listing_attributes(user_interaction & dialog, //< for user interaction
59  const std::string & beginning, //< character std::string to use as margin
60  const std::string & data, //< ("saved" | "referenced" | "deleted")
61  const std::string & metadata, //< ("saved" | "referenced" | "absent")
62  const cat_entree * obj = nullptr, //< the object to display cat_inode information about
63  bool list_ea = false); //< whether to list Extended Attributes
64  extern bool extract_base_and_status(unsigned char signature, unsigned char & base, saved_status & saved);
65  extern void local_display_ea(user_interaction & dialog, const cat_inode * ino, const std::string &prefix, const std::string &suffix, bool xml_output = false);
66  extern unsigned char mk_signature(unsigned char base, saved_status state);
67  extern void unmk_signature(unsigned char sig, unsigned char & base, saved_status & state, bool isolated);
68  extern bool compatible_signature(unsigned char a, unsigned char b);
69  extern unsigned char get_base_signature(unsigned char a);
70 
74  extern std::string entree_to_string(const cat_entree *obj);
75 
77 
78 } // end of namespace
79 
80 #endif
std::string entree_to_string(const cat_entree *obj)
base object for all inode types, managed EA and FSA, dates, permissions, ownership, ...
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47