#include <Archive.hpp>

Inheritance diagram for etk::Archive:
etk::archive::Zip

Public Member Functions

 Archive (const std::string &_fileName)
 
virtual ~Archive ()=default
 
const std::string & getFileName ()
 
int32_t size () const
 
const std::string & getName (size_t _id) const
 
const ArchiveContentgetContent (size_t _id) const
 
const ArchiveContentgetContent (const std::string &_key) const
 
bool exist (const std::string &_key) const
 
void open (const std::string &_key)
 
void close (const std::string &_key)
 
void display ()
 

Static Public Member Functions

static Archiveload (const std::string &_fileName)
 
static ArchiveloadPackage (const std::string &_fileName)
 

Protected Member Functions

virtual void loadFile (const std::map< std::string, ArchiveContent >::iterator &_it)
 

Protected Attributes

std::string m_fileName
 
std::map< std::string, ArchiveContentm_content
 

Detailed Description

Access on a zip data file.

Constructor & Destructor Documentation

§ Archive()

etk::Archive::Archive ( const std::string &  _fileName)
inline

Contructor of the archive element.

Parameters
[in]_fileNameZip file name (or .apk for android)

§ ~Archive()

virtual etk::Archive::~Archive ( )
virtualdefault

Generic Destructor of the archive element.

Member Function Documentation

§ close()

void etk::Archive::close ( const std::string &  _key)

Un-Load the specific file from the memory.

Parameters
[in]_keyName of the file

§ display()

void etk::Archive::display ( )

Display all Element in the archive.

§ exist()

bool etk::Archive::exist ( const std::string &  _key) const

Check if a file exist.

Parameters
[in]_keyName of the file
Returns
true if the file is present

§ getContent() [1/2]

const ArchiveContent& etk::Archive::getContent ( size_t  _id) const

Get the File name of the ID.

Parameters
[in]_idid of the element (must be < Size())
Returns
the archive content

§ getContent() [2/2]

const ArchiveContent& etk::Archive::getContent ( const std::string &  _key) const

Get the File name of the ID.

Parameters
[in]_keyname of the file
Returns
FileName of the requested id

§ getFileName()

const std::string& etk::Archive::getFileName ( )
inline

Get the current file name.

Returns
the requested file name.

§ getName()

const std::string& etk::Archive::getName ( size_t  _id) const

Get the File name of the ID.

Parameters
[in]_idid of the element (must be < Size())
Returns
FileName of the requested id

§ load()

static Archive* etk::Archive::load ( const std::string &  _fileName)
static

Load an Achive with a specific name.

Parameters
[in]_fileNameFile name of the specific archive.
Returns
A pointer an the specified archive, the user might delete it.

§ loadFile()

virtual void etk::Archive::loadFile ( const std::map< std::string, ArchiveContent >::iterator &  _it)
inlineprotectedvirtual

Request the load in memory of the concerned file.

Parameters
[in]_itIterator on the element.

Reimplemented in etk::archive::Zip.

§ loadPackage()

static Archive* etk::Archive::loadPackage ( const std::string &  _fileName)
static

Load an Achive with a specific name in package mode ==> this mean the data is associated with the basic binary.

Parameters
[in]_fileNameFile name of the specific archive.
Returns
A pointer an the specified archive, the user might delete it.

§ open()

void etk::Archive::open ( const std::string &  _key)

Load the specific file in the memory.

Parameters
[in]_keyName of the file

§ size()

int32_t etk::Archive::size ( ) const
inline

Get the number of elements.

Returns
nb files in the archive

Member Data Documentation

§ m_content

std::map<std::string, ArchiveContent> etk::Archive::m_content
protected

list of element of the zip file

§ m_fileName

std::string etk::Archive::m_fileName
protected

File name when it came from an file.


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