26 #ifndef USER_INTERACTION5_HPP
27 #define USER_INTERACTION5_HPP
29 #include "../my_config.h"
106 void warning(
const std::string & msg) { message(msg); };
113 virtual void pause(
const std::string & message)
127 virtual bool pause2(
const std::string & message)
128 {
throw Elibcall(
"user_interaction::pause2",
"user_interaction::pause() or pause2() must be overwritten !"); };
135 virtual std::string
get_string(
const std::string & message,
bool echo) = 0;
163 virtual void listing(
const std::string & flag,
164 const std::string & perm,
165 const std::string & uid,
166 const std::string & gid,
167 const std::string & size,
168 const std::string & date,
169 const std::string & filename,
203 const std::string & chemin,
204 const std::string & archive_name);
239 const std::string & data_date,
240 const std::string & data_presence,
241 const std::string & ea_date,
242 const std::string & ea_presence);
259 virtual void printf(
const char *format, ...)
override;
314 bool use_dar_manager_show_files;
315 bool use_dar_manager_contents;
316 bool use_dar_manager_statistics;
317 bool use_dar_manager_show_version;
This is a pure virtual class that is used by libdar when interaction with the user is required.
virtual void dar_manager_show_files(const std::string &filename, bool data_change, bool ea_change)
virtual secu_string get_secu_string(const std::string &message, bool echo)=0
same a get_string() but uses secu_string instead
virtual void inherited_warning(const std::string &message)=0
to be defined by inherited classes
virtual void inherited_message(const std::string &message) override
need to be overwritten in place of the warning() method since API 3.1.x
user_interaction()
class constructor.
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
virtual void dar_manager_statistics(U_I number, const infinint &data_count, const infinint &total_data, const infinint &ea_count, const infinint &total_ea)
bool get_use_dar_manager_contents() const
this is not a virtual method, it has not to be overwritten in inherited classes.
void set_use_dar_manager_contents(bool val)
method to be called with true as argument if you have defined a dar_manager_contents() method.
void set_use_dar_manager_show_version(bool val)
method to be called with true as argument if you have defined a dar_manager_show_version() method.
void warning_with_more(U_I num)
make a pause each N line of output when calling the warning method
virtual bool pause2(const std::string &message)
alternative method to the pause() method
virtual void listing(const std::string &flag, const std::string &perm, const std::string &uid, const std::string &gid, const std::string &size, const std::string &date, const std::string &filename, bool is_dir, bool has_children)
bool get_use_listing() const
this is not a virtual method, it has not to be overwritten in inherited classes.
virtual bool inherited_pause(const std::string &message) override
method used to ask a boolean question to the user.
virtual void pause(const std::string &message)
method used to ask a boolean question to the user.
virtual std::string inherited_get_string(const std::string &message, bool echo) override
method used to ask a question that needs an arbitrary answer.
virtual void dar_manager_show_version(U_I number, const std::string &data_date, const std::string &data_presence, const std::string &ea_date, const std::string &ea_presence)
bool get_use_dar_manager_statistics() const
this is not a virtual method, it has not to be overwritten in inherited classes.
virtual void dar_manager_contents(U_I number, const std::string &chemin, const std::string &archive_name)
virtual user_interaction * clone() const =0
make a newly allocated object which has the same properties as "this".
void set_use_listing(bool val)
method to be called with true as argument if you have defined a listing() method.
bool get_use_dar_manager_show_files() const
this is not a virtual method, it has not to be overwritten in inherited classes.
virtual std::string get_string(const std::string &message, bool echo)=0
method used to ask a question that needs an arbitrary answer.
bool get_use_dar_manager_show_version() const
this is not a virtual method, it has not to be overwritten in inherited classes.
void warning(const std::string &msg)
method added for backward compatibility with API v5
virtual void printf(const char *format,...) override
libdar uses this call to format output before send to message() method.
void set_use_dar_manager_show_files(bool val)
method to be called with true as argument if you have defined a dar_manager_show_files() method.
void set_use_dar_manager_statistics(bool val)
method to be called with true as argument if you have defined a dar_manager_statistics() method.
exception used to signal a bug. A bug is triggered when reaching some code that should never be reach...
this is the parent class of all exception classes.
exception used to signal an error in the argument given to libdar call of the API
exception used when memory has been exhausted
exception used to signal that the user has aborted the operation
the arbitrary large positive integer class
This is a pure virtual class that is used by libdar when interaction with the user is required.
std::shared_ptr< user_interaction > user_interaction5_clone_to_shared_ptr(user_interaction &dialog)
convert a user_interaction to a shared_pointer on a clone of that user_interaction
libdar5 namespace encapsulate all libdar symbols
this file contains the definition of secu_string class, a std::string like class but allocated in sec...
defines the interaction interface between libdar and users.