fw4spl
fwZip::WriteZipArchive Class Reference

This class defines functions to write a file in a zip archive. More...

#include <WriteZipArchive.hpp>

+ Inheritance diagram for fwZip::WriteZipArchive:
+ Collaboration diagram for fwZip::WriteZipArchive:

Public Member Functions

virtual bool isA (const std::string &type) const override
 
FWZIP_API WriteZipArchive (const ::boost::filesystem::path &archive)
 Constructors. Initializes archive path.
 
FWZIP_API WriteZipArchive (const ::boost::filesystem::path &archive, const std::string &comment)
 Constructors. Initializes archive path and comment.
 
FWZIP_API std::shared_ptr< std::ostream > createFile (const ::boost::filesystem::path &path) override
 Creates a new file entry in archive and returns output stream for this file. More...
 
FWZIP_API void putFile (const ::boost::filesystem::path &sourceFile, const ::boost::filesystem::path &path) override
 Writes source file in archive. More...
 
FWZIP_API bool createDir (const ::boost::filesystem::path &path) override
 Creates a folder in archive. More...
 
FWZIP_APIconst::boost::filesystem::path getArchivePath () const override
 Returns archive path.
 
- Public Member Functions inherited from fwZip::IWriteArchive

Static Public Member Functions

static bool isTypeOf (const std::string &type)
 
- Static Public Member Functions inherited from fwZip::IWriteArchive
static bool isTypeOf (const std::string &type)
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Protected Attributes

::boost::filesystem::path m_archive
 
std::string m_comment
 

Friends

template<class , class , class >
class ::fwTools::ClassFactory
 
class ::fwTools::Factory
 

Demangling methods

virtual const std::string & getLeafClassname () const override
 return object's classname without its namespace, i.e. BaseObject
 
virtual const std::string & getClassname () const override
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Detailed Description

This class defines functions to write a file in a zip archive.

Definition at line 25 of file WriteZipArchive.hpp.

Member Function Documentation

bool fwZip::WriteZipArchive::createDir ( const ::boost::filesystem::path &  path)
overridevirtual

Creates a folder in archive.

Parameters
pathfolder to create in archive.

Implements fwZip::IWriteArchive.

Definition at line 183 of file WriteZipArchive.cpp.

std::shared_ptr< std::ostream > fwZip::WriteZipArchive::createFile ( const ::boost::filesystem::path &  path)
overridevirtual

Creates a new file entry in archive and returns output stream for this file.

Parameters
pathfile in archive.
Returns
output stream of file entry in archive.
Exceptions
fwZip::exception::Writeif archive cannot be opened.
Note
Last output stream is automatically flushed before creation of new file entry in zip archive.

Implements fwZip::IWriteArchive.

Definition at line 159 of file WriteZipArchive.cpp.

References SPTR.

Referenced by putFile().

+ Here is the caller graph for this function:

void fwZip::WriteZipArchive::putFile ( const ::boost::filesystem::path &  sourceFile,
const ::boost::filesystem::path &  path 
)
overridevirtual

Writes source file in archive.

Parameters
sourceFilesource file.
pathfile in archive.
Exceptions
fwZip::exception::Readif source file cannot be opened.

Implements fwZip::IWriteArchive.

Definition at line 168 of file WriteZipArchive.cpp.

References createFile(), and SPTR.

+ Here is the call graph for this function:


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