26 #ifndef USER_INTERACTION_CALLBACK5_HPP
27 #define USER_INTERACTION_CALLBACK5_HPP
29 #include "../my_config.h"
63 bool (*x_answer_callback)(
const std::string &x,
void *context),
64 std::string (*x_string_callback)(
const std::string &x,
bool echo,
void *context),
65 secu_string (*x_secu_string_callback)(
const std::string &x,
bool echo,
void *context),
74 virtual void pause(
const std::string & message)
override;
76 virtual std::string
get_string(
const std::string & message,
bool echo)
override;
80 virtual void listing(
const std::string & flag,
81 const std::string & perm,
82 const std::string & uid,
83 const std::string & gid,
84 const std::string & size,
85 const std::string & date,
86 const std::string & filename,
88 bool has_children)
override;
93 bool available_ea)
override;
97 const std::string & chemin,
98 const std::string & archive_name)
override;
105 const infinint & total_ea)
override;
109 const std::string & data_date,
110 const std::string & data_presence,
111 const std::string & ea_date,
112 const std::string & ea_presence)
override;
120 const std::string & perm,
121 const std::string & uid,
122 const std::string & gid,
123 const std::string & size,
124 const std::string & date,
125 const std::string & filename,
130 tar_listing_callback = callback;
140 dar_manager_show_files_callback = callback;
144 void set_dar_manager_contents_callback(
void (*callback)(U_I number,
145 const std::string & chemin,
146 const std::string & archive_name,
149 dar_manager_contents_callback = callback;
153 void set_dar_manager_statistics_callback(
void (*callback)(U_I number,
154 const infinint & data_count,
155 const infinint & total_data,
156 const infinint & ea_count,
157 const infinint & total_ea,
160 dar_manager_statistics_callback = callback;
164 void set_dar_manager_show_version_callback(
void (*callback)(U_I number,
165 const std::string & data_date,
166 const std::string & data_presence,
167 const std::string & ea_date,
168 const std::string & ea_presence,
171 dar_manager_show_version_callback = callback;
187 void (*warning_callback)(
const std::string & x,
void *context);
188 bool (*answer_callback)(
const std::string & x,
void *context);
189 std::string (*string_callback)(
const std::string & x,
bool echo,
void *context);
190 secu_string (*secu_string_callback)(
const std::string & x,
bool echo,
void *context);
191 void (*tar_listing_callback)(
const std::string & flags,
192 const std::string & perm,
193 const std::string & uid,
194 const std::string & gid,
195 const std::string & size,
196 const std::string & date,
197 const std::string & filename,
201 void (*dar_manager_show_files_callback)(
const std::string & filename,
205 void (*dar_manager_contents_callback)(U_I number,
206 const std::string & chemin,
207 const std::string & archive_name,
209 void (*dar_manager_statistics_callback)(U_I number,
215 void (*dar_manager_show_version_callback)(U_I number,
216 const std::string & data_date,
217 const std::string & data_presence,
218 const std::string & ea_date,
219 const std::string & ea_presence,
full implemented class for user_interaction based on callback functions.
void set_listing_callback(void(*callback)(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, void *context))
You can set a listing callback thanks to this method.
void change_context_value(void *new_value)
change the context value of the object that will be given to callback functions
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) override
overwritting method from parent class.
virtual void inherited_warning(const std::string &message) override
overwritting method from parent class.
virtual void dar_manager_statistics(U_I number, const infinint &data_count, const infinint &total_data, const infinint &ea_count, const infinint &total_ea) override
overwritting method from parent class
virtual void dar_manager_show_files(const std::string &filename, bool available_data, bool available_ea) override
overwritting method from parent class
virtual user_interaction * clone() const override
overwritting method from parent class.
virtual void dar_manager_contents(U_I number, const std::string &chemin, const std::string &archive_name) override
overwritting method from parent class
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) override
overwritting method from parent class
void set_dar_manager_show_files_callback(void(*callback)(const std::string &filename, bool available_data, bool available_ea, void *context))
You can set a dar_manager_show_files callback thanks to this method.
virtual void pause(const std::string &message) override
overwritting method from parent class.
virtual secu_string get_secu_string(const std::string &message, bool echo) override
overwritting method from parent class.
user_interaction_callback(void(*x_warning_callback)(const std::string &x, void *context), bool(*x_answer_callback)(const std::string &x, void *context), std::string(*x_string_callback)(const std::string &x, bool echo, void *context), secu_string(*x_secu_string_callback)(const std::string &x, bool echo, void *context), void *context_value)
constructor which receive the callback functions.
virtual std::string get_string(const std::string &message, bool echo) override
overwritting method from parent class.
This is a pure virtual class that is used by libdar when interaction with the user is required.
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 set_use_listing(bool val)
method to be called with true as argument if you have defined a listing() 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.
the arbitrary large positive integer class
libdar5 namespace encapsulate all libdar symbols
API v5 backward compatible class user_interaction.