Fesapi 2.13.0.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:
common::DataFeeder

Public Member Functions

 EpcDocument (const std::string &fileName)
 ~EpcDocument ()=default
void open (const std::string &fileName)
void serializeFrom (DataObjectRepository &repo)
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) const
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 in UTF-8 encoding.

◆ ~EpcDocument()

common::EpcDocument::~EpcDocument ( )
default

The destructor frees all allocated ressources.

Member Function Documentation

◆ 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 The EpcDocument must have been deserialized at least once to get the extended core proeprties information.

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) const

Gets an extended core property value according to its key. The EpcDocument must have been deserialized at least once to get the extended core proeprties information.

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. The EpcDocument must have been deserialized at least once to get the extended core proeprties information.

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)
inline

Opens an EPC document.

Parameters
fileNameFull pathname of the EPC document in UTF-8 encoding.

◆ resolvePartial()

std::string common::EpcDocument::resolvePartial ( AbstractObject const * partialObj) const
virtual

Ask this feeder to resolve a partial object to a non partial one.

Parameters
partialObjThe partial dataobject
Returns
The full XML content of the partial dataobject or empty string if the feeder could not resolve it.

Implements common::DataFeeder.

◆ serializeFrom()

void common::EpcDocument::serializeFrom ( DataObjectRepository & repo)

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)

◆ 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.

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