Re: [Dar-libdar_api] Re: API / thread safe libdar
For full, incremental, compressed and encrypted backups or archives
Brought to you by:
edrusb
|
From: Christian N. <chr...@al...> - 2004-06-17 10:32:57
|
On Wed, 16 Jun 2004 21:50:31 +0200
Denis Corbin <dar...@fr...> wrote:
> I could keep the use of the op_create and other API functions as
> normal function (not class members). They received several new
> arguments, among which, the most important is the "dialog" class (as
> first argument). This object contains all the callback functions, as
> defined by the libdar user. Given this object libdar is able to use
> the appropriate callback function.
It would be nice to have the possibility to derive from this Dialog
class, so that one could overwrite the Dialog's write() members.
Example: (I don't know yet how you implemented it..)
class Dialog { // @ libdar
private:
void set_warning_callback(...);
protected:
virtual void write_warning(...);
}
The dialog's implementation of write_warning should call the callback
function defined by set_write_callback(...) or sth else. So the user
could create a Dialog, set the callback functions, and pass the Dialog
to op_create etc.
But he should also be able to do something like this:
class LogWindow : public Dialog { // @ backup gui
private:
void add_line_to_log(...);
void write_warning(...) { add_line_to_log(...) };
}
The overwritten write_warning(...) would write the warning directly to
the LogWindow, without calling any callback function. I think that
this would result in cleaner code (but as said, one could have both
possibilities).
> The native language support is also a feature for next major release
> (version 2.2.0) ;-)
That's good :) If you need a german translator, tell me ;)
Regards,
Christian
|