#include <Package.h>
|
| 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, int append, bool useZip64=false) |
|
bool | isOpenedForWriting () const |
|
std::vector< std::string > | openForReading (const std::string &pkgPathName) |
|
bool | isOpenedForReading () const |
|
void | close () |
|
const FileCoreProperties & | getFileCoreProperties () const |
|
const FileContentType & | getFileContentType () const |
|
const FileRelationship & | getPrincipalRelationship () const |
|
const PartMap & | getAllFilePart () const |
|
const std::string & | getPathname () const |
|
void | setFileFileCoreProperties (const FileCoreProperties &pkgFileCP) |
|
std::unordered_map< std::string, std::string > & | getExtendedCoreProperty () |
|
void | addProperty (const CoreProperty::TypeProperty &pkgTypeProperty, const std::string &pkgPropertyValue) |
|
void | setFileContentType (const FileContentType &pkgFileCT) |
|
void | addContentType (const ContentType &contentType) |
|
void | setPrincipalRelationship (const FileRelationship &pkgFileRS) |
|
void | addRelationship (const Relationship &relationship) |
|
FilePart * | createPart (const std::string &inputContent, const std::string &outputPartPath) |
|
const FilePart * | findPart (const std::string &outputPartPath) const |
|
bool | fileExists (const std::string &filename) const |
|
std::string | extractFile (const std::string &filename, const std::string &password="") |
|
void | writePackage () |
|
◆ Package() [1/2]
epc::Package::Package |
( |
| ) |
|
◆ Package() [2/2]
Create a Package with CoreProperties file, ContentType file, Relationship file, vector of Part file and pathname.
- Parameters
-
pkgFileCP | The package file cp. |
pkgFileCT | The package file ct. |
pkgFileRS | The package file RS. |
pkgFileP | The package file p. |
pkgPathName | Full pathname of the package file. |
◆ ~Package()
epc::Package::~Package |
( |
| ) |
|
Destructor : free memory allocated for the parts
◆ addContentType()
void epc::Package::addContentType |
( |
const ContentType & |
contentType | ) |
|
add a ContentType in the ContentTypes file of package.
- Parameters
-
◆ addProperty()
add a Property in the CoreProperties file of package.
- Parameters
-
pkgTypeProperty | The type of the property to add. |
pkgPropertyValue | The value of the property to add. |
◆ addRelationship()
void epc::Package::addRelationship |
( |
const Relationship & |
relationship | ) |
|
add a Relationship in the Relationships file of package.
- Parameters
-
◆ close()
void epc::Package::close |
( |
| ) |
|
◆ createPart()
FilePart* epc::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.
- Parameters
-
inputContent | The input content. |
outputPartPath | Full pathname of the output part file. |
- Returns
- a new part.
◆ extractFile()
std::string epc::Package::extractFile |
( |
const std::string & |
filename, |
|
|
const std::string & |
password = "" |
|
) |
| |
Extract the content of a given file from the zip file
- Parameters
-
filename | Filename of the file. |
password | (Optional) The password. |
- Returns
- The extracted file.
◆ fileExists()
bool epc::Package::fileExists |
( |
const std::string & |
filename | ) |
const |
Check that a given file exists in the zip file
- Parameters
-
filename | Filename of the file. |
- Returns
- True if it succeeds, false if it fails.
◆ findPart()
const FilePart* epc::Package::findPart |
( |
const std::string & |
outputPartPath | ) |
const |
Find a part corresponding to the given path
- Parameters
-
outputPartPath | Full pathname of the output part file. |
- Returns
- Null if it fails, else the found part.
◆ getAllFilePart()
const PartMap& epc::Package::getAllFilePart |
( |
| ) |
const |
vector of part file.
- Returns
- all file part.
◆ getExtendedCoreProperty()
std::unordered_map< std::string, std::string >& epc::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.
- Returns
- A map associating keys and values of the extended core properties.
◆ getFileContentType()
◆ getFileCoreProperties()
Gets file core properties
- Returns
- CoreProperties file.
◆ getPathname()
const std::string& epc::Package::getPathname |
( |
| ) |
const |
Get a const string reference on the name of the package.
- Returns
- The pathname.
◆ getPrincipalRelationship()
◆ isOpenedForReading()
bool epc::Package::isOpenedForReading |
( |
| ) |
const |
Check if the package is already opened for reading.
◆ isOpenedForWriting()
bool epc::Package::isOpenedForWriting |
( |
| ) |
const |
Check if the package is already opened for writing.
◆ openForReading()
std::vector<std::string> epc::Package::openForReading |
( |
const std::string & |
pkgPathName | ) |
|
Open the package for reading purpose
- Parameters
-
pkgPathName | Full pathname of the package file. |
- Returns
- empty vector if nothing went wrong. Otherwise, return warnings.
◆ openForWriting()
void epc::Package::openForWriting |
( |
const std::string & |
pkgPathName, |
|
|
int |
append, |
|
|
bool |
useZip64 = false |
|
) |
| |
Open the package for writing purpose
- Parameters
-
pkgPathName | contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on an Unix computer "zlib/zlib113.zip". |
append | if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will add files in existing zip (be sure you don't add file that doesn't exist). Else an ovewrite or a creation of the file will be done. If the zipfile cannot be opened, an invalid_argument exception is thrown. |
useZip64 | (Optional) True to use zip 64. |
◆ setFileContentType()
set the ContentTypes file.
- Parameters
-
◆ setFileFileCoreProperties()
set the CoreProperties file.
- Parameters
-
pkgFileCP | CoreProperties file. |
◆ setPrincipalRelationship()
void epc::Package::setPrincipalRelationship |
( |
const FileRelationship & |
pkgFileRS | ) |
|
set the Relationships file.
- Parameters
-
◆ writePackage()
void epc::Package::writePackage |
( |
| ) |
|
The documentation for this class was generated from the following file:
- C:/Users/philippe/dev/fesapiEnv/fesapi-2.0.0.0/src/epc/Package.h