sptk2 logo
SPTK Home Page

sptk::CTar Class Reference

A wrapper for libtar functions. More...

#include <CTar.h>

List of all members.

Public Member Functions

 CTar ()
 Constructor.
 ~CTar ()
 Destructor.
void read (const std::string &fileName) throw (CException)
 Reads tar archive from file.
void read (const char *fileName) throw (CException)
 Reads tar archive from file.
void read (const CBuffer &tarData) throw (CException)
 Reads tar archive from buffer.
const CStringsfileList () const
 returns a list of files in tar archive
const CBufferfile (std::string fileName) const throw (CException)
 Returns file data by file name.
void clear ()
 Clears the allocated memory.

Static Public Member Functions

static CMemoryTarHandletarMemoryHandle (int handle)
 Returns memory handle.
static int mem_open (const char *name, int x,...)
 Overwrites standard tar open.
static int mem_close (int handle)
 Overwrites standard tar close.
static int mem_read (int handle, void *buf, size_t len)
 Overwrites standard tar read.
static int mem_write (int handle, const void *buf, size_t len)
 Overwrites standard tar write.

Static Public Attributes

static int lastTarHandle
 The last generated tar handle.
static CTarHandleMap * tarHandleMap
 The map of tar handles.


Detailed Description

A wrapper for libtar functions.

Allows reading tar archive files into memory buffers. The main usage currently is to read an SPTK theme from tar-archive.


Member Function Documentation

const CBuffer& sptk::CTar::file ( std::string  fileName  )  const throw (CException)

Returns file data by file name.

Parameters:
fileName std::string, file name

static int sptk::CTar::mem_close ( int  handle  )  [static]

Overwrites standard tar close.

Parameters:
handle int, tar handle

static int sptk::CTar::mem_read ( int  handle,
void *  buf,
size_t  len 
) [static]

Overwrites standard tar read.

Parameters:
handle int, tar handle
buf void*, data buffer
len size_t, read size

static int sptk::CTar::mem_write ( int  handle,
const void *  buf,
size_t  len 
) [static]

Overwrites standard tar write.

Parameters:
handle int, tar handle
buf void*, data buffer
len size_t, write size

void sptk::CTar::read ( const CBuffer tarData  )  throw (CException)

Reads tar archive from buffer.

The archive content is red into the internal set of buffers

Parameters:
tarData const CBuffer&, tar file buffer

void sptk::CTar::read ( const char *  fileName  )  throw (CException)

Reads tar archive from file.

The archive content is red into the internal set of buffers

Parameters:
fileName std::string, file name to open

void sptk::CTar::read ( const std::string &  fileName  )  throw (CException) [inline]

Reads tar archive from file.

The archive content is red into the internal set of buffers

Parameters:
fileName std::string, file name to open

static CMemoryTarHandle* sptk::CTar::tarMemoryHandle ( int  handle  )  [static]

Returns memory handle.

Parameters:
handle int, tar handle


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

Mon Mar 5 11:56:07 2012: SPTK 3.5.7