Fesapi 2.10.1.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Loading...
Searching...
No Matches
common::EpcDocument Class Reference

EPC is an implementation of the Open Packaging Conventions (OPC), a widely used container-file technology that allows multiple types of files to be bundled together into a single package. Built on the widely used ZIP file structure and originally created by Microsoft, OPC is now an open standard supported by these standards organizations: More...

#include <EpcDocument.h>

Inheritance diagram for common::EpcDocument:

Public Member Functions

 EpcDocument (const std::string &fileName)
 
 ~EpcDocument ()
 
void open (const std::string &fileName)
 
void close ()
 
void setFilePath (const std::string &fp)
 
void serializeFrom (DataObjectRepository &repo, bool useZip64=false)
 
virtual std::string deserializeInto (DataObjectRepository &repo, DataObjectRepository::openingMode hdfPermissionAccess=DataObjectRepository::openingMode::READ_ONLY)
 
std::string deserializePartiallyInto (DataObjectRepository &repo, DataObjectRepository::openingMode hdfPermissionAccess=DataObjectRepository::openingMode::READ_ONLY)
 
std::string getStorageDirectory () const
 
std::string getName () const
 
std::unordered_map< std::string, std::string > & getExtendedCoreProperty ()
 
void setExtendedCoreProperty (const std::string &key, const std::string &value)
 
uint64_t getExtendedCorePropertyCount () const
 
std::string getExtendedCoreProperty (const std::string &key)
 
std::string resolvePartial (AbstractObject const *partialObj) const
 

Detailed Description

EPC is an implementation of the Open Packaging Conventions (OPC), a widely used container-file technology that allows multiple types of files to be bundled together into a single package. Built on the widely used ZIP file structure and originally created by Microsoft, OPC is now an open standard supported by these standards organizations:

Constructor & Destructor Documentation

◆ EpcDocument()

common::EpcDocument::EpcDocument ( const std::string & fileName)
inline

Constructor

Parameters
fileNameFull pathname of the EPC document.

◆ ~EpcDocument()

common::EpcDocument::~EpcDocument ( )
inline

The destructor frees all allocated ressources.

Member Function Documentation

◆ close()

void common::EpcDocument::close ( )
inline

Free all ressources contained in this package.

◆ deserializeInto()

virtual std::string common::EpcDocument::deserializeInto ( DataObjectRepository & repo,
DataObjectRepository::openingMode hdfPermissionAccess = DataObjectRepository::openingMode::READ_ONLY )
virtual

Deserializes this package (data objects and relationships) into a data object repository

Parameters
[in,out]repoA data object repository.
hdfPermissionAccess(Optional) The HDF5 file permission access. It is read only by default.
Returns
An empty string if success otherwise the warning string.

◆ deserializePartiallyInto()

std::string common::EpcDocument::deserializePartiallyInto ( DataObjectRepository & repo,
DataObjectRepository::openingMode hdfPermissionAccess = DataObjectRepository::openingMode::READ_ONLY )

Unzip the package (dataobjects + relationships) into a data repository by only creating partial objects.

Returns
An empty string if success otherwise the warning string.

◆ getExtendedCoreProperty() [1/2]

std::unordered_map< std::string, std::string > & common::EpcDocument::getExtendedCoreProperty ( )

Gets the extended core properties of this package

Returns
A map which associates keys and values of the extended core properties.

◆ getExtendedCoreProperty() [2/2]

std::string common::EpcDocument::getExtendedCoreProperty ( const std::string & key)

Gets an extended core property value according to its key.

Parameters
keyThe key of the property.
Returns
An empty string if the extended core property does not exist. Or the extended core property value if it exists.

◆ getExtendedCorePropertyCount()

uint64_t common::EpcDocument::getExtendedCorePropertyCount ( ) const

Gets extended core property count.

Returns
The count of extended core properties in this EPC document

◆ getName()

std::string common::EpcDocument::getName ( ) const

Gets the name of the EPC document

Returns
The name of the EPC document without the .epc extension.

◆ getStorageDirectory()

std::string common::EpcDocument::getStorageDirectory ( ) const

Gets the absolute path of the directory where the EPC document is stored.

Returns
The EPC document storage directory.

◆ open()

void common::EpcDocument::open ( const std::string & fileName)

Opens an EPC document. If one is already opened, it must be closed before to open a new one. Don't forget to call close() before to destroy this object.

Exceptions
std::invalid_argumentif the name of the EPC document is empty or if there is already an opened EPC document.
Parameters
fileNameFull pathname of the EPC document.

◆ serializeFrom()

void common::EpcDocument::serializeFrom ( DataObjectRepository & repo,
bool useZip64 = false )

Serializes the content of a data object repository into this EPC document.

Parameters
repoA data object repository (not const because we may create a Fake Property for solivng a RESQML2.0.1 empty PropertySet issue)
useZip64(Optional) True to zip the EPC document using Zip64 format, else (default) simply use Zip format.

◆ setExtendedCoreProperty()

void common::EpcDocument::setExtendedCoreProperty ( const std::string & key,
const std::string & value )

Sets or adds an extended core property

Parameters
keyThe key of the property.
valueThe value of the property.

◆ setFilePath()

void common::EpcDocument::setFilePath ( const std::string & fp)

Sets the EPC document file path which will be used for future serialization and deserialization. This method will add the standard .epc extension if it is not already present.

Exceptions
std::invalid_argumentif the HDF5 file error handling cannot be disabled.
Parameters
fpFull pathname of the EPC document.

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