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

Classes

class  CheshireCat
 

Public Member Functions

 Package ()
 
 Package (const FileCoreProperties &pkgFileCP, const FileContentType &pkgFileCT, const FileRelationship &pkgFileRS, const PartMap &pkgFileP, const std::string &pkgPathName)
 
 ~Package ()
 
void openForWriting (const std::string &pkgPathName, bool useZip64=false)
 
std::vector< std::string > openForReading (const std::string &pkgPathName)
 
void close ()
 
const FileCorePropertiesgetFileCoreProperties () const
 
const FileContentTypegetFileContentType () const
 
const FileRelationshipgetPrincipalRelationship () const
 
const PartMap & getAllFilePart () const
 
const std::string & getPathname () const
 
void setFileFileCoreProperties (const FileCoreProperties &pkgFileCP)
 set the CoreProperties file. More...
 
std::tr1::unordered_map< std::string, std::string > & getExtendedCoreProperty ()
 
void addProperty (const CoreProperty::TypeProperty &pkgTypeProperty, const std::string &pkgPropertyValue)
 add a Property in the CoreProperties file of package. More...
 
void setFileContentType (const FileContentType &pkgFileCT)
 set the ContentTypes file. More...
 
void addContentType (const ContentType &contentType)
 add a ContentType in the ContentTypes file of package. More...
 
void setPrincipalRelationship (const FileRelationship &pkgFileRS)
 set the Relationships file. More...
 
void addRelationship (const Relationship &relationship)
 add a Relationship in the Relationships file of package. More...
 
FilePartcreatePart (const std::string &inputContent, const std::string &outputPartPath)
 Creates a part in the package and returns it. This part will be automatically destroy with the package. More...
 
const FilePartfindPart (const std::string &outputPartPath) const
 Find a part corresponding to the given path.
 
bool fileExists (const std::string &filename) const
 
std::string extractFile (const std::string &filename, const std::string &password="")
 
void writePackage ()
 

Constructor & Destructor Documentation

Package::Package ( )

Create a Package with pathname.

epc::Package::Package ( const FileCoreProperties pkgFileCP,
const FileContentType pkgFileCT,
const FileRelationship pkgFileRS,
const PartMap &  pkgFileP,
const std::string &  pkgPathName 
)

Create a Package with CoreProperties file, ContentType file, Relationship file, vector of Part file and pathname.

Package::~Package ( )

Destructor : free memory allocated for the parts

Member Function Documentation

void Package::addContentType ( const ContentType contentType)

add a ContentType in the ContentTypes file of package.

Parameters
contentTypeThe ContentType to add.
void Package::addProperty ( const CoreProperty::TypeProperty pkgTypeProperty,
const std::string &  pkgPropertyValue 
)

add a Property in the CoreProperties file of package.

Parameters
pkgTypePropertyThe type of the property to add.
pkgPropertyValueThe value of the property to add.
void Package::addRelationship ( const Relationship relationship)

add a Relationship in the Relationships file of package.

Parameters
relationshipRelationship file.
void Package::close ( )

Close the package

FilePart * Package::createPart ( const std::string &  inputContent,
const std::string &  outputPartPath 
)

Creates a part in the package and returns it. This part will be automatically destroy with the package.

Returns
a new part.
string Package::extractFile ( const std::string &  filename,
const std::string &  password = "" 
)

Extract the content of a given file from the zip file

bool Package::fileExists ( const std::string &  filename) const

Check that a given file exists in the zip file

const Package::PartMap & Package::getAllFilePart ( ) const

vector of part file.

tr1::unordered_map< string, string > & Package::getExtendedCoreProperty ( )

Get in read/write access all the non standard core properties of this package All added non standard core properties will be stored in a single part which will be linked to the standard core properties part.

const FileContentType & Package::getFileContentType ( ) const
Returns
ContentType file.
const FileCoreProperties & Package::getFileCoreProperties ( ) const
Returns
CoreProperties file.
const string & Package::getPathname ( ) const

Get a const string reference on the name of the package.

const FileRelationship & Package::getPrincipalRelationship ( ) const
Returns
Relationship file.
std::vector< std::string > Package::openForReading ( const std::string &  pkgPathName)

Open the package for reading purpose

Returns
empty vector if nothing went wrong. Otherwise, return warnings.
void Package::openForWriting ( const std::string &  pkgPathName,
bool  useZip64 = false 
)

Open the package for writing purpose

void Package::setFileContentType ( const FileContentType pkgFileCT)

set the ContentTypes file.

Parameters
pkgFileCTThe ContentType file.
void Package::setFileFileCoreProperties ( const FileCoreProperties pkgFileCP)

set the CoreProperties file.

Parameters
pkgFileCPCoreProperties file.
void Package::setPrincipalRelationship ( const FileRelationship pkgFileRS)

set the Relationships file.

Parameters
pkgFileRSRelationship file.

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