pombreda / libarchive

Automatically exported from code.google.com/p/libarchive
Other
0 stars 0 forks source link

C++ wrapper #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It seems feasible to include very basic C++ wrapper classes directly in
archive_entry.h and archive.h, using something like the following:

   #ifdef __cplusplus
   class CArchiveEntry {
     struct archive_entry *ae;
     ...
   };
   #endif

Original issue reported on code.google.com by kientzle@gmail.com on 26 Jun 2009 at 5:21

GoogleCodeExporter commented 9 years ago

Original comment by kientzle@gmail.com on 26 Jun 2009 at 5:21

GoogleCodeExporter commented 9 years ago
I'm not going to have time to work on this anytime soon.
If anyone else is interested, please feel free...

Original comment by kientzle@gmail.com on 3 Sep 2009 at 3:08

GoogleCodeExporter commented 9 years ago

Original comment by kientzle@gmail.com on 3 Jan 2010 at 9:52

GoogleCodeExporter commented 9 years ago
Does this really give any new functionality? I can't even imagine a useful case 
for
inheritance here.

Original comment by joerg.sonnenberger@googlemail.com on 20 Feb 2010 at 12:56

GoogleCodeExporter commented 9 years ago
Inheritance isn't the point, really.  I've talked to a few folks doing 
extensive C++
work who would find this convenient primarily because of the memory management. 
 In
particular, the ability to do things like:

 {
    CArchiveRead a();

    ... do stuff ...

 } // No explicit close or cleanup needed at end of block.

Original comment by kientzle@gmail.com on 20 Feb 2010 at 4:41

GoogleCodeExporter commented 9 years ago
Inheritance is useful for filtering the files returned when the archive is 
scanned, so it does have a purpose.  I've 
used it in my Obj-C wrapper (http://bazaar.launchpad.net/%7Epelle-
morth/modazipin/trunk/annotate/head%3A/ArchiveWrapper.m and .h if anyone is 
interested). The filtering is in 
the DazipArchive subclass though.

Original comment by pelle%mo...@gtempaccount.com on 2 Jun 2010 at 3:33

GoogleCodeExporter commented 9 years ago
What would be great is if we could wrap this for use as an istream and ostream. 
 The istream can then function as a universal decompressor.  We would want to 
select the compression scheme to use for the ostream.

I think the best way to implement boost's Filter interface (see 
http://www.boost.org/doc/libs/1_43_0/libs/iostreams/doc/concepts/filter.html) 
it would give C++ developers a lot of power and could help to raise more 
awareness of this project.  Currently there is only support for gzip and bzip2 
so we could really use all the schemes supported by libarchive.

Original comment by nina.bu...@gmail.com on 14 Jul 2010 at 12:29

GoogleCodeExporter commented 9 years ago
I wrote a C++ wrapper that simplifies the interface with streams, iterators and 
RAII.

https://github.com/do-m-en/libarchive_cpp_wrapper/tree/develop

It was written for C++11 and above.

Original comment by Domen.Vr...@gmail.com on 23 Sep 2014 at 4:44