|
@@ -35,6 +35,7 @@ ModuleInfo "Copyright: Wrapper - 2013-2022 Bruce A Henderson"
|
|
|
|
|
|
ModuleInfo "History: 1.07"
|
|
ModuleInfo "History: 1.07"
|
|
ModuleInfo "History: Update to libarchive 3.6.2.2d32907."
|
|
ModuleInfo "History: Update to libarchive 3.6.2.2d32907."
|
|
|
|
+ModuleInfo "History: Added DataStream() to TWriteArchive, returning a writeable TStream."
|
|
ModuleInfo "History: 1.06"
|
|
ModuleInfo "History: 1.06"
|
|
ModuleInfo "History: Update to libarchive 3.5.2.b967588."
|
|
ModuleInfo "History: Update to libarchive 3.5.2.b967588."
|
|
ModuleInfo "History: 1.05"
|
|
ModuleInfo "History: 1.05"
|
|
@@ -307,7 +308,7 @@ Public
|
|
about: This can be used by any #TStream supported functionality.
|
|
about: This can be used by any #TStream supported functionality.
|
|
End Rem
|
|
End Rem
|
|
Method DataStream:TStream()
|
|
Method DataStream:TStream()
|
|
- Return New TArchiveStream(Self)
|
|
|
|
|
|
+ Return New TArchiveInputStream(Self)
|
|
End Method
|
|
End Method
|
|
|
|
|
|
Rem
|
|
Rem
|
|
@@ -350,7 +351,7 @@ End Type
|
|
Rem
|
|
Rem
|
|
bbdoc: Data from a TReadArchive entry as a stream.
|
|
bbdoc: Data from a TReadArchive entry as a stream.
|
|
End Rem
|
|
End Rem
|
|
-Type TArchiveStream Extends TStream
|
|
|
|
|
|
+Type TArchiveInputStream Extends TStream
|
|
|
|
|
|
Field archive:TArchive
|
|
Field archive:TArchive
|
|
|
|
|
|
@@ -389,6 +390,33 @@ Type TArchiveStream Extends TStream
|
|
|
|
|
|
End Type
|
|
End Type
|
|
|
|
|
|
|
|
+Type TArchiveOutputStream Extends TStream
|
|
|
|
+
|
|
|
|
+ Field archive:TWriteArchive
|
|
|
|
+
|
|
|
|
+ Field _eof:Int
|
|
|
|
+
|
|
|
|
+ Method New(archive:TWriteArchive)
|
|
|
|
+ Self.archive = archive
|
|
|
|
+ End Method
|
|
|
|
+
|
|
|
|
+ Method Write:Long( buf:Byte Ptr,count:Long )
|
|
|
|
+ Return archive.Data(buf, Size_T(count))
|
|
|
|
+ End Method
|
|
|
|
+
|
|
|
|
+ Method WriteBytes:Long( buf:Byte Ptr,count:Long )
|
|
|
|
+ Local t:Long=count
|
|
|
|
+ While count>0
|
|
|
|
+ Local n:Long=Write( buf,count )
|
|
|
|
+ If Not n Exit
|
|
|
|
+ count:-n
|
|
|
|
+ buf:+n
|
|
|
|
+ Wend
|
|
|
|
+ Return t
|
|
|
|
+ End Method
|
|
|
|
+
|
|
|
|
+End Type
|
|
|
|
+
|
|
Type TArchiveCallbackData
|
|
Type TArchiveCallbackData
|
|
|
|
|
|
Field data:Byte[]
|
|
Field data:Byte[]
|
|
@@ -478,6 +506,17 @@ Type TWriteArchive Extends TArchive
|
|
archivePtr = bmx_libarchive_write_archive_new()
|
|
archivePtr = bmx_libarchive_write_archive_new()
|
|
End Method
|
|
End Method
|
|
|
|
|
|
|
|
+ Rem
|
|
|
|
+ bbdoc: Creates a new instance of #TWriteArchive with the specified format and filters.
|
|
|
|
+ End Rem
|
|
|
|
+ Method New(format:EArchiveFormat, filters:EArchiveFilter[])
|
|
|
|
+ New()
|
|
|
|
+ SetFormat(format)
|
|
|
|
+ For Local filter:EArchiveFilter = Eachin filters
|
|
|
|
+ AddFilter(filter)
|
|
|
|
+ Next
|
|
|
|
+ End Method
|
|
|
|
+
|
|
Rem
|
|
Rem
|
|
bbdoc: Opens archive for writing to a file of the given @filename.
|
|
bbdoc: Opens archive for writing to a file of the given @filename.
|
|
about: The file should be writeable.
|
|
about: The file should be writeable.
|
|
@@ -631,6 +670,14 @@ Type TWriteArchive Extends TArchive
|
|
Return bmx_libarchive_archive_write_data(archivePtr, data, size)
|
|
Return bmx_libarchive_archive_write_data(archivePtr, data, size)
|
|
End Method
|
|
End Method
|
|
|
|
|
|
|
|
+ Rem
|
|
|
|
+ bbdoc: Returns a writeable #TStream.
|
|
|
|
+ about: This can be used by any #TStream supported functionality.
|
|
|
|
+ End Rem
|
|
|
|
+ Method DataStream:TStream()
|
|
|
|
+ Return New TArchiveOutputStream(Self)
|
|
|
|
+ End Method
|
|
|
|
+
|
|
Rem
|
|
Rem
|
|
bbdoc: Sets a passphrase for the archive.
|
|
bbdoc: Sets a passphrase for the archive.
|
|
End Rem
|
|
End Rem
|
|
@@ -758,6 +805,7 @@ Type TArchiveEntry
|
|
End Rem
|
|
End Rem
|
|
Method New()
|
|
Method New()
|
|
entryPtr = bmx_libarchive_archive_entry_new()
|
|
entryPtr = bmx_libarchive_archive_entry_new()
|
|
|
|
+ SetFileType(EArchiveFileType.File)
|
|
End Method
|
|
End Method
|
|
|
|
|
|
Rem
|
|
Rem
|