Fesapi  2.0.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Public Member Functions | List of all members
common::EpcDocument Class Reference

This class allows an access to a memory package representing an EPC document. More...

#include <EpcDocument.h>

Inheritance diagram for common::EpcDocument:

Public Member Functions

 EpcDocument (const std::string &fileName)
 
virtual ~EpcDocument ()
 
void open (const std::string &fileName)
 
void close ()
 
void setFilePath (const std::string &fp)
 
void serializeFrom (const 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)
 
unsigned int getExtendedCorePropertyCount () const
 
std::string getExtendedCoreProperty (const std::string &key)
 
std::string resolvePartial (AbstractObject *partialObj) const
 

Detailed Description

This class allows an access to a memory package representing an EPC document.

Constructor & Destructor Documentation

◆ EpcDocument()

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

Constructor

Parameters
fileNameFull pathname of the EPC document.

◆ ~EpcDocument()

virtual common::EpcDocument::~EpcDocument ( )
virtual

The destructor frees all allocated ressources.

Member Function Documentation

◆ close()

void common::EpcDocument::close ( )

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

unsigned int 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 ( const DataObjectRepository repo,
bool  useZip64 = false 
)

Serializes the content of a data object repository into this EPC document. It also allows to optionally zip this EPC document.

Parameters
repoA data object repository.
useZip64(Optional) True to zip the EPC document, else false (default).

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