HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_ArchiveReader Class Reference

#include <UT_Archive.h>

Classes

struct  Deleter
 Deleter for smart pointers. More...
 
class  iterator
 

Public Types

enum  format {
  format::_ALL, format::_ZIP, format::_RAR, format::_TAR,
  format::_RAW, format::_7ZIP, format::_AR, format::_CAB,
  format::_CPIO, format::_ISO9660, format::_LHA, format::_MTREE,
  format::_XAR
}
 
enum  filter {
  filter::_NONE, filter::_ALL, filter::_BZIP2, filter::_COMPRESS,
  filter::_GZIP, filter::_LZIP, filter::_LZMA, filter::_XZ,
  filter::_UU, filter::_RPM, filter::_LRZIP, filter::_LZOP,
  filter::_GRZIP
}
 

Public Member Functions

 ~UT_ArchiveReader ()=default
 
 UT_ArchiveReader (UT_ArchiveReader &&a)
 
UT_ArchiveReaderoperator= (UT_ArchiveReader &&a)
 
SYS_NO_DISCARD_RESULT
UT_ArchiveEntry 
nextEntry ()
 Get the next entry in the archive. More...
 
SYS_NO_DISCARD_RESULT bool isValid () const
 True if the archive can continue to be used. More...
 
 operator bool () const
 
SYS_NO_DISCARD_RESULT
UT_StringHolder 
errorString () const
 Get the current error string for the archive. More...
 
int readSkip ()
 Skip the current entry. More...
 
int read (UT_ArchiveEntry &entry, UT_WorkBuffer &data)
 Read the contents of the entry into the workbuffer. More...
 
int extract (UT_ArchiveEntry &entry, int flags)
 Extract the entry from the archive. More...
 
iterator begin ()
 
iterator end ()
 
template<format FORMAT>
void initFormat ()
 
template<filter FILTER>
void initFilter ()
 
int openFileW (const wchar_t *filename, size_t block_size)
 
int openFile (const char *filename, size_t block_size)
 

Static Public Member Functions

static bool readFile (const char *filename, const UT_StringHolder &pathname, UT_WorkBuffer &data)
 Helper to read a specific file from an archive file. More...
 
template<format FORMAT = format::_ALL, filter FILTER = filter::_ALL>
static SYS_NO_DISCARD_RESULT
UT_ArchiveReader 
create (const char *filename, size_t block_size)
 
template<format FORMAT = format::_ALL, filter FILTER = filter::_ALL>
static SYS_NO_DISCARD_RESULT
UT_ArchiveReader 
createW (const wchar_t *filename, size_t block_size)
 

Detailed Description

Definition at line 93 of file UT_Archive.h.

Member Enumeration Documentation

Enumerator
_NONE 
_ALL 
_BZIP2 
_COMPRESS 
_GZIP 
_LZIP 
_LZMA 
_XZ 
_UU 
_RPM 
_LRZIP 
_LZOP 
_GRZIP 

Definition at line 127 of file UT_Archive.h.

Enumerator
_ALL 
_ZIP 
_RAR 
_TAR 
_RAW 
_7ZIP 
_AR 
_CAB 
_CPIO 
_ISO9660 
_LHA 
_MTREE 
_XAR 

Definition at line 111 of file UT_Archive.h.

Constructor & Destructor Documentation

UT_ArchiveReader::~UT_ArchiveReader ( )
default
UT_ArchiveReader::UT_ArchiveReader ( UT_ArchiveReader &&  a)
inline

Definition at line 102 of file UT_Archive.h.

Member Function Documentation

iterator UT_ArchiveReader::begin ( void  )
inline

Begin and end iterator suitable for iterating over the entries in the archive.

Definition at line 183 of file UT_Archive.h.

template<format FORMAT = format::_ALL, filter FILTER = filter::_ALL>
static SYS_NO_DISCARD_RESULT UT_ArchiveReader UT_ArchiveReader::create ( const char *  filename,
size_t  block_size 
)
inlinestatic

Create an archive ready for reading.

Definition at line 190 of file UT_Archive.h.

template<format FORMAT = format::_ALL, filter FILTER = filter::_ALL>
static SYS_NO_DISCARD_RESULT UT_ArchiveReader UT_ArchiveReader::createW ( const wchar_t *  filename,
size_t  block_size 
)
inlinestatic

Create an archive ready for reading.

Definition at line 201 of file UT_Archive.h.

iterator UT_ArchiveReader::end ( void  )
inline

Begin and end iterator suitable for iterating over the entries in the archive.

Definition at line 184 of file UT_Archive.h.

SYS_NO_DISCARD_RESULT UT_StringHolder UT_ArchiveReader::errorString ( ) const

Get the current error string for the archive.

int UT_ArchiveReader::extract ( UT_ArchiveEntry entry,
int  flags 
)

Extract the entry from the archive.

template<filter FILTER>
void UT_ArchiveReader::initFilter ( )

Init the format and filter for the archive. In most cases create() should be used in favour of these functions.

template<format FORMAT>
void UT_ArchiveReader::initFormat ( )

Init the format and filter for the archive. In most cases create() should be used in favour of these functions.

SYS_NO_DISCARD_RESULT bool UT_ArchiveReader::isValid ( ) const

True if the archive can continue to be used.

SYS_NO_DISCARD_RESULT UT_ArchiveEntry UT_ArchiveReader::nextEntry ( )

Get the next entry in the archive.

int UT_ArchiveReader::openFile ( const char *  filename,
size_t  block_size 
)

Open an archive file. These functions are only used if extra functionality is required. create() should be used in most cases.

int UT_ArchiveReader::openFileW ( const wchar_t *  filename,
size_t  block_size 
)

Open an archive file. These functions are only used if extra functionality is required. create() should be used in most cases.

UT_ArchiveReader::operator bool ( ) const
inlineexplicit

Definition at line 218 of file UT_Archive.h.

UT_ArchiveReader& UT_ArchiveReader::operator= ( UT_ArchiveReader &&  a)
inline

Definition at line 105 of file UT_Archive.h.

int UT_ArchiveReader::read ( UT_ArchiveEntry entry,
UT_WorkBuffer data 
)

Read the contents of the entry into the workbuffer.

static bool UT_ArchiveReader::readFile ( const char *  filename,
const UT_StringHolder pathname,
UT_WorkBuffer data 
)
inlinestatic

Helper to read a specific file from an archive file.

Definition at line 231 of file UT_Archive.h.

int UT_ArchiveReader::readSkip ( )

Skip the current entry.


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