Spm::Util::Compressed Class Reference

Base class for archive manipluation. More...

#include <compressed.h>

List of all members.

Public Types

typedef std::vector< miniXml::ustring
>::iterator 
iterator
typedef std::vector< miniXml::ustring
>::const_iterator 
const_iterator
typedef std::vector< miniXml::ustring
>::reverse_iterator 
reverse_iterator
typedef std::vector< miniXml::ustring
>::const_reverse_iterator 
const_reverse_iterator

Public Member Functions

virtual ~Compressed ()
virtual bool uncompress (const boost::filesystem::path &dest)=0
 Uncompress the whole archive.
const boost::filesystem::path & getName ()
bool have (const miniXml::ustring &file)
 Check if a file is in the archive.
virtual bool extract (const miniXml::ustring &file, const boost::filesystem::path &to)=0
miniXml::ustring getSubDir ()
const miniXml::ustring & getExactName (const miniXml::ustring &file)
std::vector< miniXml::ustring > all (const miniXml::ustring &file)
 Get all files matching a file name.
iterator begin ()
iterator end ()
reverse_iterator rbegin ()
reverse_iterator rend ()
const_iterator begin () const
const_iterator end () const
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const
iterator find (const miniXml::ustring &file)
 Find a file in the Compressed object.
const_iterator find (const miniXml::ustring &file) const
 Find a file in the Compressed object.

Static Public Member Functions

static Compressedcreate (const boost::filesystem::path &file)
 create anew Compressed object

Protected Member Functions

 Compressed ()
 Compressed (const boost::filesystem::path &fileName)
virtual void listFiles ()=0

Protected Attributes

boost::filesystem::path file_
std::vector< miniXml::ustring > files_


Detailed Description

Base class for archive manipluation.


Member Typedef Documentation

typedef std::vector<miniXml::ustring>::iterator Spm::Util::Compressed::iterator

typedef std::vector<miniXml::ustring>::const_iterator Spm::Util::Compressed::const_iterator

typedef std::vector<miniXml::ustring>::reverse_iterator Spm::Util::Compressed::reverse_iterator

typedef std::vector<miniXml::ustring>::const_reverse_iterator Spm::Util::Compressed::const_reverse_iterator


Constructor & Destructor Documentation

Spm::Util::Compressed::Compressed (  )  [inline, protected]

Spm::Util::Compressed::Compressed ( const boost::filesystem::path &  fileName  )  [protected]

virtual Spm::Util::Compressed::~Compressed (  )  [inline, virtual]


Member Function Documentation

virtual void Spm::Util::Compressed::listFiles (  )  [protected, pure virtual]

static Compressed* Spm::Util::Compressed::create ( const boost::filesystem::path &  file  )  [static]

create anew Compressed object

Parameters:
file The Compressed file
Returns:
a new Compressed object. NULL if a Compressed object can't be created.

virtual bool Spm::Util::Compressed::uncompress ( const boost::filesystem::path &  dest  )  [pure virtual]

Uncompress the whole archive.

Parameters:
dest The directory where The archive will be uncompressed
Returns:
true if the archive is successfully uncompressed, false otherwise

const boost::filesystem::path& Spm::Util::Compressed::getName (  ) 

Returns:
the name of the compressed file

bool Spm::Util::Compressed::have ( const miniXml::ustring &  file  ) 

Check if a file is in the archive.

Parameters:
file The file to search
Returns:
true if the file is in the archive, false otherwise

virtual bool Spm::Util::Compressed::extract ( const miniXml::ustring &  file,
const boost::filesystem::path &  to 
) [pure virtual]

Parameters:
file The file to extract
to Where the file will be extracted

miniXml::ustring Spm::Util::Compressed::getSubDir (  ) 

Returns:
the subdir which contains all files of the archive

const miniXml::ustring& Spm::Util::Compressed::getExactName ( const miniXml::ustring &  file  ) 

Parameters:
file The searched file
Returns:
The exact name of an element of the compressed archive

std::vector<miniXml::ustring> Spm::Util::Compressed::all ( const miniXml::ustring &  file  ) 

Get all files matching a file name.

Parameters:
file the file name to compare
Returns:
All files matching the filename

iterator Spm::Util::Compressed::begin (  )  [inline]

iterator Spm::Util::Compressed::end (  )  [inline]

reverse_iterator Spm::Util::Compressed::rbegin (  )  [inline]

reverse_iterator Spm::Util::Compressed::rend (  )  [inline]

const_iterator Spm::Util::Compressed::begin (  )  const [inline]

const_iterator Spm::Util::Compressed::end (  )  const [inline]

const_reverse_iterator Spm::Util::Compressed::rbegin (  )  const [inline]

const_reverse_iterator Spm::Util::Compressed::rend (  )  const [inline]

iterator Spm::Util::Compressed::find ( const miniXml::ustring &  file  ) 

Find a file in the Compressed object.

Parameters:
file the filename to find
Returns:
An iterator to a file

const_iterator Spm::Util::Compressed::find ( const miniXml::ustring &  file  )  const

Find a file in the Compressed object.

Parameters:
file the filename to find
Returns:
An iterator to a file


Member Data Documentation

boost::filesystem::path Spm::Util::Compressed::file_ [protected]

std::vector<miniXml::ustring> Spm::Util::Compressed::files_ [protected]


The documentation for this class was generated from the following file:
Generated on Sat Mar 21 17:00:14 2009 for libSpm by  doxygen 1.5.2