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

archive_options_listing_shell.hpp
Go to the documentation of this file.
1 /*********************************************************************/
2 // dar - disk archive - a backup/restoration program
3 // Copyright (C) 2002-2020 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 : http://dar.linux.free.fr/email.html
20 /*********************************************************************/
21
25
26 #ifndef ARCHIVE_OPTIONS_LISTING_SHELL_HPP
27 #define ARCHIVE_OPTIONS_LISTING_SHELL_HPP
28
29 #include "../my_config.h"
30 #include "archive_options.hpp"
31
32 namespace libdar
33 {
34
37
38
39 // ///////////////////////////////////////////////////////
40 // //// OPTIONS FOR LISTING AN ARCHIVE AS IN SHELL ///////
41 // ///////////////////////////////////////////////////////
42
44
47 class archive_options_listing_shell: public archive_options_listing
48 {
49 public:
50 archive_options_listing_shell() { clear(); };
51 archive_options_listing_shell(const archive_options_listing_shell & ref) = default;
52 archive_options_listing_shell(archive_options_listing_shell && ref) noexcept = default;
53 archive_options_listing_shell & operator = (const archive_options_listing_shell & ref) = default;
54 archive_options_listing_shell & operator = (archive_options_listing_shell && ref) noexcept = default;
55 ~archive_options_listing_shell() = default;
56
57 virtual void clear() override;
58
60
61 enum listformat
62 {
63 normal,
64 tree,
65 xml,
66 slicing
67 };
68
69
71 // setting methods
72
73 void set_list_mode(listformat list_mode) { x_list_mode = list_mode; set_slicing_location(list_mode == slicing); };
74 void set_sizes_in_bytes(bool arg) { x_sizes_in_bytes = arg; };
75
77 // getting methods
78
79 listformat get_list_mode() const { return x_list_mode; };
80 bool get_sizes_in_bytes() const { return x_sizes_in_bytes; };
81
82 private:
83 listformat x_list_mode;
84 bool x_sizes_in_bytes;
85 };
86
88
89 } // end of namespace
90
91 #endif
libdar::archive_options_listing_shell::tree
@ tree
the original dar's tree listing (for those that like forest)
Definition: archive_options_listing_shell.hpp:64
libdar::archive_options_listing_shell::slicing
@ slicing
the slicing output (give info about where files are located)
Definition: archive_options_listing_shell.hpp:66
libdar::archive_options_listing
class holding optional parameters used to list the contents of an existing archive
Definition: archive_options.hpp:1337
archive_options.hpp
this file contains a set of classes used to transmit options to archive operation
libdar::archive_options_listing_shell::normal
@ normal
the tar-like listing (this is the default)
Definition: archive_options_listing_shell.hpp:63
libdar::archive_options_listing::set_slicing_location
void set_slicing_location(bool val)
whether to calculate the slice location of each file
Definition: archive_options.hpp:1369
libdar::archive_options_listing_shell::listformat
listformat
defines the way archive listing is done:
Definition: archive_options_listing_shell.hpp:62
libdar::archive_options_listing_shell::xml
@ xml
the xml catalogue output
Definition: archive_options_listing_shell.hpp:65
libdar::archive_options_listing_shell
class holding optional shell specific parameters used to list the contents of an existing archive
Definition: archive_options_listing_shell.hpp:48
libdar
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47