Thread: [Dar-libdar_api] archive methods?
For full, incremental, compressed and encrypted backups or archives
Brought to you by:
edrusb
|
From: Johnathan B. <jk...@us...> - 2004-07-17 09:15:11
|
Hi Denis, Now that libdar uses the "archive" class, what is the possibility of having= =20 the various libdar operations implemented as methods of the archive class? Instead of libdar::archive *theArchive; libdar::open( theArchive, ...) libdar::test( theArchive, ...) etc. what about having libdar::archive *theArchive( path, basename, etc.) theArchive->open(); theArchive->test(); Have you considered this? I'm not sure what this would accomplish, besides= =20 quite a bit of possibly unnecessary code rewriting. It just ocurred to me=20 that an archive is the main object for libdar, and the usual way in c++ is= =20 to implement functions as methods. Please enlighten me if I am off base here. I'm not sure that I've thought=20 this through very much. Sorry in advance if this has been documented=20 elsewhere. Cheers, JB =2D-=20 Johnathan K. Burchill, Ph.D. jk...@us... |
|
From: Denis C. <dar...@fr...> - 2004-07-17 14:20:37
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Johnathan Burchill wrote: | Hi Denis, Hello Johnathan, | | Now that libdar uses the "archive" class, what is the possibility of having | the various libdar operations implemented as methods of the archive class? | | Instead of | | libdar::archive *theArchive; | | libdar::open( theArchive, ...) | libdar::test( theArchive, ...) | etc. | | what about having | | libdar::archive *theArchive( path, basename, etc.) | | theArchive->open(); | theArchive->test(); | | Have you considered this? yes, I did. I even intially wanted to implement things this way. | I'm not sure what this would accomplish, besides | quite a bit of possibly unnecessary code rewriting. I don't think there is too much code rewriting for that be possible. | It just ocurred to me | that an archive is the main object for libdar, and the usual way in c++ is | to implement functions as methods. yes, I agree. | | Please enlighten me if I am off base here. I'm not sure that I've thought | this through very much. Sorry in advance if this has been documented | elsewhere. In fact, if I did not do this way, is to keep API a set of normal functions, for those who could call libdar from a program written in C, Pascal, or any other language. Of course some of the arguments are objects. But, for a non C++ programmer it is maybe more intuitive to use a pure C function than a method on an object. This is the reason why I did not moved op_create and other methods as members of archive class. Another problem is the _noexcept variants of API calls. In particular the open_archive_noexcept() call which would correspond to a constructor for the archive class. constructor do not return error, so if it is not possible to throw exception to report an error, how would it be possible to report an error during the archive object construction ? OK, one could make a fake constructor, that do nothing real, and a open_archive_noexcept() method that (as it is now a normal method), can return an error code status, but, I don't see much more interest compared to normal functions. any objections ? comments ? ;-) | | Cheers, | JB | Cheers, Denis. P.S.: Johnathan, I cannot figure out how to find your public key. It is not on your web site (there is old obsolete one only), nor it is on any key servers I tried. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFA+TY6pC5CI8gYGlIRAiwaAJ9y6KrSZRM1YOEtjzE+WKz8hqXQkQCeI4GW lZj52GTaJKQ3gXrF7xT9uBI= =I0Tl -----END PGP SIGNATURE----- |
|
From: Christian N. <chr...@al...> - 2004-07-17 15:07:58
|
On Sat, 17 Jul 2004 16:22:50 +0200 Denis Corbin <dar...@fr...> wrote: > any objections ? comments ? ;-) My two cents: I would prefer a more object oriented API, because OO programming is more convenient.. Of course it would be difficult for a C programmer to understand the API, but at last it's a C++ library and not a C library. And you can't use libdar in C programs, can you (correct me if I'm wrong)? Non-OO C++ is just worse than plain C (IMHO). Regards, Christian |
|
From: Denis C. <dar...@fr...> - 2004-07-17 15:43:43
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Christian Neumann wrote: | On Sat, 17 Jul 2004 16:22:50 +0200 | Denis Corbin <dar...@fr...> wrote: | | |>any objections ? comments ? ;-) | | My two cents: I would prefer a more object oriented API, because OO | programming is more convenient.. Of course it would be difficult for a C | programmer to understand the API, but at last it's a C++ library and not | a C library. And you can't use libdar in C programs, can you (correct me | if I'm wrong)? Non-OO C++ is just worse than plain C (IMHO). that makes sens. So it we will go this way. | | Regards, | Christian Cheers, Denis. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFA+Um8pC5CI8gYGlIRAvwBAJ44il9f3jYMv9U4RW08B9CaM8PTdQCgrf1h D9fvinB5BUK0IjOEUT8iSHY= =F0Dc -----END PGP SIGNATURE----- |
|
From: Johnathan B. <jk...@sh...> - 2004-07-17 16:58:19
|
On July 17, 2004 09:46 am, Denis Corbin wrote: > Christian Neumann wrote: > | On Sat, 17 Jul 2004 16:22:50 +0200 > | > | Denis Corbin <dar...@fr...> wrote: > |>any objections ? comments ? ;-) > | > | My two cents: I would prefer a more object oriented API, because OO > | programming is more convenient.. Of course it would be difficult for a > | C programmer to understand the API, but at last it's a C++ library and > | not a C library. And you can't use libdar in C programs, can you > | (correct me if I'm wrong)? Non-OO C++ is just worse than plain C > | (IMHO). > > that makes sens. So it we will go this way. > Sounds good. :! JB > | Regards, > | Christian > > Cheers, > Denis. > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=3D4721&alloc_id=3D10040&op=3Dclick > _______________________________________________ > Dar-libdar_api mailing list > Dar...@li... > https://lists.sourceforge.net/lists/listinfo/dar-libdar_api =2D-=20 Johnathan K. Burchill, Ph.D. Department of Physics and Astronomy University of Calgary 2500 University Drive N.W. Calgary, AB T2N 1N4 Canada (403) 217-4286 jk...@sh... |