Friedrich-Alexander-Universität Erlangen-Nürnberg  /   Technische Fakultät  /   Department Informatik

Parser for the basic Tape ARchive Format (TAR). More...

#include <utils/tar.h>

Classes

struct  File
 File Entry. More...
 

Public Types

enum  Type : char {
  TYPE_REG_OLD = '\0',
  TYPE_REG = '0',
  TYPE_HARD_LINK = '1',
  TYPE_SYM_LINK = '2',
  TYPE_CHR = '3',
  TYPE_BLK = '4',
  TYPE_DIR = '5',
  TYPE_FIFO = '6',
  TYPE_CONTIG = '7'
}
 

Public Member Functions

 assert_size (File, BLOCK_SIZE)
 
 Tar (void *data)
 Constructor. More...
 
Fileget (unsigned entry)
 Get the entry for the n-th file. More...
 
unsigned count ()
 Number of entries in the archive. More...
 

Detailed Description

Parser for the basic Tape ARchive Format (TAR).

See also
Basic Tar Format
Short summary of the TAR format

Member Enumeration Documentation

◆ Type

enum Tar::Type : char
Enumerator
TYPE_REG_OLD 

Regular file, unix compatible.

TYPE_REG 

Regular file.

TYPE_HARD_LINK 

link to a previous file

TYPE_SYM_LINK 

symbolic link

TYPE_CHR 

Character special file.

TYPE_BLK 

Block special file.

TYPE_DIR 

Directory.

TYPE_FIFO 

FIFO special file (no content)

TYPE_CONTIG 

contiguous file (file has to be allocated contiguously on the disk)

Constructor & Destructor Documentation

◆ Tar()

Tar::Tar ( void *  data)
inlineexplicit

Constructor.

Parameters
dataBuffer with the (full) contents of the TAR file

Member Function Documentation

◆ get()

Tar::File * Tar::get ( unsigned  entry)

Get the entry for the n-th file.

Parameters
entryIndex of the file entry
Returns
Pointer to next file entry or 'nullptr' if it doesn't exist

◆ count()

unsigned Tar::count ( )

Number of entries in the archive.

Returns
Number of file entries

The documentation for this class was generated from the following files:
  • utils/tar.h
  • utils/tar.cc