QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
QGClibarchive::ArchiveReader Class Reference

RAII wrapper for libarchive reader with automatic cleanup. More...

#include <QGClibarchive.h>

Public Member Functions

 ArchiveReader ()=default
 
 ~ArchiveReader ()
 
 ArchiveReader (const ArchiveReader &)=delete
 
ArchiveReaderoperator= (const ArchiveReader &)=delete
 
bool open (const QString &path, ReaderMode mode=ReaderMode::AllFormats)
 
bool open (QIODevice *device, ReaderMode mode=ReaderMode::AllFormats)
 
struct archive * handle () const
 Get the underlying archive handle.
 
struct archive * release ()
 Release ownership of archive handle (caller must free)
 
bool isOpen () const
 Check if archive is open.
 
qint64 dataSize () const
 
QString formatName () const
 
QString filterName () const
 

Detailed Description

RAII wrapper for libarchive reader with automatic cleanup.

Definition at line 48 of file QGClibarchive.h.

Constructor & Destructor Documentation

◆ ArchiveReader() [1/2]

QGClibarchive::ArchiveReader::ArchiveReader ( )
default

◆ ~ArchiveReader()

QGClibarchive::ArchiveReader::~ArchiveReader ( )

Definition at line 569 of file QGClibarchive.cc.

◆ ArchiveReader() [2/2]

QGClibarchive::ArchiveReader::ArchiveReader ( const ArchiveReader )
delete

Member Function Documentation

◆ dataSize()

qint64 QGClibarchive::ArchiveReader::dataSize ( ) const

Get the total data size (for progress reporting)

Returns
Size in bytes: resource data size, file size, or device size (0 if unknown)

Definition at line 576 of file QGClibarchive.cc.

Referenced by QGClibarchive::decompressSingleFile(), QGClibarchive::extractAnyArchive(), QGClibarchive::extractArchiveAtomic(), and QGClibarchive::extractWithFilter().

◆ filterName()

QString QGClibarchive::ArchiveReader::filterName ( ) const

Get the detected compression filter name

Returns
Filter name like "gzip", "xz", "zstd", "none", or empty if not detected

Definition at line 599 of file QGClibarchive.cc.

◆ formatName()

QString QGClibarchive::ArchiveReader::formatName ( ) const

Get the detected archive format name (after reading first header)

Returns
Format name like "ZIP 2.0 (deflation)", "POSIX ustar", "RAW", or empty if not detected

Definition at line 590 of file QGClibarchive.cc.

◆ handle()

◆ isOpen()

bool QGClibarchive::ArchiveReader::isOpen ( ) const
inline

Check if archive is open.

Definition at line 76 of file QGClibarchive.h.

◆ open() [1/2]

◆ open() [2/2]

bool QGClibarchive::ArchiveReader::open ( QIODevice *  device,
ReaderMode  mode = ReaderMode::AllFormats 
)

Open archive for reading from a QIODevice (streaming)

Parameters
deviceQIODevice to read from (must be open and readable)
modeFormat support mode (AllFormats or RawFormat)
Returns
true on success
Note
The device must remain valid and open until the reader is closed

Definition at line 651 of file QGClibarchive.cc.

References QGClibarchive::AllFormats, QGClibarchive::deviceCloseCallback(), QGClibarchive::deviceReadCallback(), QGClibarchive::deviceSeekCallback(), QGClibarchive::deviceSkipCallback(), and QGClibarchive::RawFormat.

◆ operator=()

ArchiveReader & QGClibarchive::ArchiveReader::operator= ( const ArchiveReader )
delete

◆ release()

struct archive * QGClibarchive::ArchiveReader::release ( )
inline

Release ownership of archive handle (caller must free)

Definition at line 73 of file QGClibarchive.h.

Referenced by QGClibarchive::extractAnyArchive(), QGClibarchive::extractArchiveAtomic(), and QGClibarchive::extractFromDevice().


The documentation for this class was generated from the following files: