![]() |
Disk ARchive
2.6.12
Full featured and portable backup and archiving tool
|
full implemented class for user_interaction based on callback functions. More...
#include <user_interaction_callback.hpp>
Inherits libdar::user_interaction.
Public Types | |
| using | message_callback = void(*)(const std::string &x, void *context) |
| using | pause_callback = bool(*)(const std::string &x, void *context) |
| using | get_string_callback = std::string(*)(const std::string &x, bool echo, void *context) |
| using | get_secu_string_callback = secu_string(*)(const std::string &x, bool echo, void *context) |
Public Member Functions | |
| user_interaction_callback (message_callback x_message_callback, pause_callback x_answer_callback, get_string_callback x_string_callback, get_secu_string_callback x_secu_string_callback, void *context_value) | |
| constructor which receive the callback functions. More... | |
| user_interaction_callback (const user_interaction_callback &ref)=default | |
| user_interaction_callback (user_interaction_callback &&ref) noexcept=default | |
| user_interaction_callback & | operator= (const user_interaction_callback &ref)=default |
| user_interaction_callback & | operator= (user_interaction_callback &&ref) noexcept=default |
Public Member Functions inherited from libdar::user_interaction | |
| user_interaction (const user_interaction &ref)=default | |
| user_interaction (user_interaction &&ref) noexcept=default | |
| user_interaction & | operator= (const user_interaction &ref)=default |
| user_interaction & | operator= (user_interaction &&ref) noexcept=default |
| void | message (const std::string &message) |
| void | pause (const std::string &message) |
| std::string | get_string (const std::string &message, bool echo) |
| secu_string | get_secu_string (const std::string &message, bool echo) |
| virtual void | printf (const char *format,...) |
| libdar uses this call to format output before send to message() method. More... | |
Protected Member Functions | |
| virtual void | inherited_message (const std::string &message) override |
| listing callback can be now passed directly to archive::get_children_of() More... | |
| virtual bool | inherited_pause (const std::string &message) override |
| overwritting method from parent class. | |
| virtual std::string | inherited_get_string (const std::string &message, bool echo) override |
| overwritting method from parent class. | |
| virtual secu_string | inherited_get_secu_string (const std::string &message, bool echo) override |
| overwritting method from parent class. | |
| void | change_context_value (void *new_value) |
| change the context value of the object that will be given to callback functions | |
Private Attributes | |
| message_callback | message_cb |
| pause_callback | pause_cb |
| get_string_callback | get_string_cb |
| get_secu_string_callback | get_secu_string_cb |
| void * | context_val |
full implemented class for user_interaction based on callback functions.
this class is an inherited class of user_interaction it is used by dar command line programs, but you can use it if you wish.
Definition at line 57 of file user_interaction_callback.hpp.
| libdar::user_interaction_callback::user_interaction_callback | ( | message_callback | x_message_callback, |
| pause_callback | x_answer_callback, | ||
| get_string_callback | x_string_callback, | ||
| get_secu_string_callback | x_secu_string_callback, | ||
| void * | context_value | ||
| ) |
constructor which receive the callback functions.
| [in] | x_message_callback | is used by message() method |
| [in] | x_answer_callback | is used by the pause() method |
| [in] | x_string_callback | is used by get_string() method |
| [in] | x_secu_string_callback | is used by get_secu_string() method |
| [in] | context_value | will be passed as last argument of callbacks when called from this object. |
|
overrideprotectedvirtual |
listing callback can be now passed directly to archive::get_children_of()
dar_manager_show_files callback can now be passed directly to database::get_files() dar_manager_contents callback is not necessary, use database::get_contents() method dar_manager_statistics callback can now be passed directly to database::show_most_recent_stats() dar_manager_get_show_version callback can now be passed directly to database::get_version() overwritting method from parent class.
Implements libdar::user_interaction.
1.8.18