fw4spl
fwZip::WriteDirArchive Class Reference

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

#include <WriteDirArchive.hpp>

+ Inheritance diagram for fwZip::WriteDirArchive:
+ Collaboration diagram for fwZip::WriteDirArchive:

Public Member Functions

virtual bool isA (const std::string &type) const override
 
FWZIP_API WriteDirArchive (const ::boost::filesystem::path &archive)
 Constructors. Initializes archive path and creates archive directories if doesn't exist.
 
FWZIP_API ~WriteDirArchive ()
 Destructor. Flush and close last output file stream.
 
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 &destinationFile) override
 Writes source file in archive. If possible, creates hard link otherwise copy 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
 

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 file system archive.

Definition at line 25 of file WriteDirArchive.hpp.

Member Function Documentation

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

Creates a folder in archive.

Parameters
pathfolder to create in archive.

Implements fwZip::IWriteArchive.

Definition at line 92 of file WriteDirArchive.cpp.

std::shared_ptr< std::ostream > fwZip::WriteDirArchive::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.
Note
Creates all parent directories of the path in archive.

Implements fwZip::IWriteArchive.

Definition at line 45 of file WriteDirArchive.cpp.

References SPTR.

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

Writes source file in archive. If possible, creates hard link otherwise copy source file in archive.

Parameters
sourceFilesource file.
destinationFilefile in archive.
Note
Do nothing if destinationFile already exists in archive.

Implements fwZip::IWriteArchive.

Definition at line 61 of file WriteDirArchive.cpp.


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