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

user_interaction_blind.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
27
28
29 #ifndef USER_INTERACTION_BLIND_HPP
30 #define USER_INTERACTION_BLIND_HPP
31
32 #include "../my_config.h"
33
34 #include <string>
35 #include "user_interaction.hpp"
36 #include "secu_string.hpp"
37
38 namespace libdar
39 {
40
43
45
46 class user_interaction_blind : public user_interaction
47 {
48 public:
49 user_interaction_blind() = default;
50 user_interaction_blind(const user_interaction_blind & ref) = default;
51 user_interaction_blind(user_interaction_blind && ref) noexcept = default;
52 user_interaction_blind & operator = (const user_interaction_blind & ref) = default;
53 user_interaction_blind & operator = (user_interaction_blind && ref) noexcept = default;
54 ~user_interaction_blind() = default;
55
56 protected:
57 virtual void inherited_message(const std::string & message) override { }; // do nothing
58 virtual bool inherited_pause(const std::string & message) override { return false; };
59 virtual std::string inherited_get_string(const std::string & message, bool echo) override { return "user_interaction_blind, is blindly answering no"; };
60 virtual secu_string inherited_get_secu_string(const std::string & message, bool echo) override { return secu_string(); };
61 };
62
64
65 } // end of namespace
66
67 #endif
libdar::user_interaction_blind::inherited_get_string
virtual std::string inherited_get_string(const std::string &message, bool echo) override
method used to ask a question that needs an arbitrary answer.
Definition: user_interaction_blind.hpp:59
libdar::user_interaction
This is a pure virtual class that is used by libdar when interaction with the user is required.
Definition: user_interaction.hpp:47
libdar::user_interaction_blind
full implementation class for user_interaction, which shows nothing and assumes answer "no" to any qu...
Definition: user_interaction_blind.hpp:47
user_interaction.hpp
defines the interaction interface between libdar and users.
libdar::user_interaction_blind::inherited_message
virtual void inherited_message(const std::string &message) override
Definition: user_interaction_blind.hpp:57
secu_string.hpp
this file contains the definition of secu_string class, a std::string like class but allocated in sec...
libdar::user_interaction_blind::inherited_get_secu_string
virtual secu_string inherited_get_secu_string(const std::string &message, bool echo) override
same a get_string() but uses libdar::secu_string instead of std::string
Definition: user_interaction_blind.hpp:60
libdar::secu_string
class secu_string
Definition: secu_string.hpp:58
libdar::user_interaction_blind::inherited_pause
virtual bool inherited_pause(const std::string &message) override
method used to ask a boolean question to the user.
Definition: user_interaction_blind.hpp:58
libdar
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47