The Pedigree Project  0.1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Archive Class Reference

#include <Archive.h>

+ Collaboration diagram for Archive:

Classes

struct  ArchiveFile
 

Public Member Functions

 Archive (uint8_t *pPhys, size_t sSize)
 
 ~Archive ()
 
size_t getNumFiles ()
 
size_t getFileSize (size_t n)
 
char * getFileName (size_t n)
 
uintptr_t * getFile (size_t n)
 

Private Member Functions

ArchiveFilegetFirst ()
 
ArchiveFilegetNext (ArchiveFile *pFile)
 
ArchiveFileget (size_t n)
 

Private Attributes

MemoryRegion m_Region
 

Detailed Description

This class provides functions for extracting an archive file as made by UNIX Tar.

Definition at line 30 of file Archive.h.

Constructor & Destructor Documentation

Archive::Archive ( uint8_t *  pPhys,
size_t  sSize 
)

Constructor; takes the physical address of a Tar archive.

Definition at line 28 of file Archive.cc.

References PhysicalMemoryManager::continuous, ERROR, PhysicalMemoryManager::getPageSize(), PhysicalMemoryManager::instance(), VirtualAddressSpace::KernelMode, and panic().

Archive::~Archive ( )

Destructor; returns the physical memory used during construction to the physical memory pool.

Definition at line 53 of file Archive.cc.

Member Function Documentation

uintptr_t * Archive::getFile ( size_t  n)

Returns a pointer to the first byte of the n'th file.

Parameters
nThe file to retrieve.

Definition at line 84 of file Archive.cc.

References MemoryRegion::virtualAddress().

char * Archive::getFileName ( size_t  n)

Returns the name of the n'th file in the archive, in bytes.

Parameters
nThe file to retrieve.

Definition at line 79 of file Archive.cc.

size_t Archive::getFileSize ( size_t  n)

Returns the size of the n'th file in the archive, in bytes.

Parameters
nThe file to retrieve.

Definition at line 72 of file Archive.cc.

size_t Archive::getNumFiles ( )

Returns the number of files in the archive.

Definition at line 60 of file Archive.cc.


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