user_interaction_blind.hpp
Go to the documentation of this file.
/*********************************************************************/
// dar - disk archive - a backup/restoration program
// Copyright (C) 2002-2023 Denis Corbin
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
//
// to contact the author, see the AUTHOR file
/*********************************************************************/
#ifndef USER_INTERACTION_BLIND_HPP
#define USER_INTERACTION_BLIND_HPP
#include "../my_config.h"
#include <string>
#include "user_interaction.hpp"
#include "secu_string.hpp"
namespace libdar
{
class user_interaction_blind : public user_interaction
{
public:
user_interaction_blind() {};
user_interaction_blind(const user_interaction_blind & ref) = default;
user_interaction_blind(user_interaction_blind && ref) noexcept = default;
user_interaction_blind & operator = (const user_interaction_blind & ref) = default;
user_interaction_blind & operator = (user_interaction_blind && ref) noexcept = default;
~user_interaction_blind() = default;
protected:
virtual void inherited_message(const std::string & message) override { }; // do nothing
virtual bool inherited_pause(const std::string & message) override { return false; };
virtual std::string inherited_get_string(const std::string & message, bool echo) override { return "user_interaction_blind, is blindly answering no"; };
virtual secu_string inherited_get_secu_string(const std::string & message, bool echo) override { return secu_string(); };
};
} // end of namespace
#endif
libdar::secu_string
class secu_string
Definition: secu_string.hpp:54
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
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::user_interaction_blind::inherited_message
virtual void inherited_message(const std::string &message) override
Definition: user_interaction_blind.hpp:57
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_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::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
libdar namespace encapsulate all libdar symbols
Definition: archive.hpp:47
secu_string.hpp
this file contains the definition of secu_string class, a std::string like class but allocated in sec...
user_interaction.hpp
defines the interaction interface between libdar and users.