#include <ContentPackage.h>
A package stores the user content as a sorted collection of parts.
- See also
ContentPart.
◆ ~ContentPackage()
| virtual myscript::iink::ContentPackage::~ContentPackage |
( |
| ) |
|
|
virtualdefault |
◆ save()
| virtual void myscript::iink::ContentPackage::save |
( |
| ) |
|
|
pure virtual |
Saves all ongoing modifications made to this package.
- Exceptions
-
| std::runtime_error | when an I/O operation fails. |
◆ saveToTemp()
| virtual void myscript::iink::ContentPackage::saveToTemp |
( |
| ) |
|
|
pure virtual |
Saves all ongoing modifications made to this package, to a temporary folder. This operation is faster than save().
- Note
- by default temporary folder is located in the same directory as this package, and named by appending
-files to this package's name.
-
temporary folder location can be set via the
content-package.temp-folder configuration property.
- Exceptions
-
| std::runtime_error | when an I/O operation fails. |
◆ saveAs()
| virtual void myscript::iink::ContentPackage::saveAs |
( |
const String & |
fileName | ) |
|
|
pure virtual |
Saves of all ongoing modifications made to this package, to a new file.
- Parameters
-
| fileName | the new file name. |
- Exceptions
-
| std::runtime_error | when an I/O operation fails. |
◆ getPartCount()
| virtual int myscript::iink::ContentPackage::getPartCount |
( |
| ) |
const |
|
pure virtualnoexcept |
Returns the number of parts in this package.
- Returns
- the part count.
◆ getPart() [1/2]
| virtual std::shared_ptr< ContentPart > myscript::iink::ContentPackage::getPart |
( |
int |
index | ) |
|
|
pure virtual |
Returns the part at the specified index.
- Parameters
-
| index | the index of the requested part. |
- Returns
- the requested part.
- Exceptions
-
| std::out_of_range | when index is out of range. |
◆ getPart() [2/2]
| virtual std::shared_ptr< ContentPart > myscript::iink::ContentPackage::getPart |
( |
const String & |
id | ) |
|
|
pure virtual |
Returns the specified part.
- Parameters
-
| id | the identifier of the requested part. |
- Returns
- the part.
- Exceptions
-
| std::invalid_argument | when no part is associated with identifier id. |
◆ indexOfPart()
| virtual int myscript::iink::ContentPackage::indexOfPart |
( |
std::shared_ptr< ContentPart > |
part | ) |
|
|
pure virtual |
Returns the index of a given part.
- Parameters
-
- Returns
- the index of the part, or -1 when the part does not belong to this package.
◆ createPart() [1/2]
| virtual std::shared_ptr< ContentPart > myscript::iink::ContentPackage::createPart |
( |
const String & |
type | ) |
|
|
pure virtual |
Appends a new part to this package.
- Parameters
-
- Returns
- the newly created part.
- Exceptions
-
| std::invalid_argument | when type is not a valid ContentPart type. |
◆ createPart() [2/2]
| virtual std::shared_ptr< ContentPart > myscript::iink::ContentPackage::createPart |
( |
const String & |
type, |
|
|
float |
width, |
|
|
float |
height |
|
) |
| |
|
pure virtual |
Appends a new fixed-size part to this package.
- Parameters
-
| type | the type of part. |
| width | the width of the part (document coordinates in mm). |
| height | the height of part (document coordinates in mm). |
- Returns
- the newly created part.
- Exceptions
-
| std::invalid_argument | when type is not a Raw Content ContentPart type. |
| std::invalid_argument | when width or height are not a number or < 1.0. |
- Since
- 4.1
◆ removePart()
| virtual void myscript::iink::ContentPackage::removePart |
( |
std::shared_ptr< ContentPart > |
part | ) |
|
|
pure virtual |
Removes the given part from this package.
- Parameters
-
- Exceptions
-
| std::invalid_argument | when part does not belong to this package. |
- Since
- 1.2
◆ movePart()
| virtual void myscript::iink::ContentPackage::movePart |
( |
int |
fromIndex, |
|
|
int |
toIndex |
|
) |
| |
|
pure virtual |
Moves the given part to another index.
- Parameters
-
| fromIndex | the current index of the requested part. |
| toIndex | the new index of the part. |
- Exceptions
-
| std::out_of_range | when fromIndex is out of range. |
| std::out_of_range | when toIndex is out of range. |
- Since
- 2.1.1
◆ clonePart()
| virtual std::shared_ptr< ContentPart > myscript::iink::ContentPackage::clonePart |
( |
std::shared_ptr< ContentPart > |
part | ) |
|
|
pure virtual |
Adds an existing part to this package.
- Note
- Part modifications that have not been saved (to temporary directory or to an actual package file) will not be imported.
-
The part can be an existing part from this package or from another open package.
- Parameters
-
| part | the part to clone into this package. |
- Returns
- the newly created part.
- Exceptions
-
| std::invalid_argument | when part is not valid. |
- Since
- 1.2
◆ extractObject()
| virtual void myscript::iink::ContentPackage::extractObject |
( |
const String & |
url, |
|
|
const String & |
fileName |
|
) |
| |
|
pure virtual |
Extracts an object from this package to a given path.
- Parameters
-
| url | URL of the object. |
| fileName | destination file. |
- Exceptions
-
| std::invalid_argument | when no object named url exists. |
| std::runtime_error | when an I/O operation fails. |
◆ getMetadata()
| virtual std::shared_ptr< ParameterSet > myscript::iink::ContentPackage::getMetadata |
( |
| ) |
|
|
pure virtual |
Returns this package's metadata as a parameter set.
- Returns
- the parameter set.
◆ setMetadata()
| virtual void myscript::iink::ContentPackage::setMetadata |
( |
std::shared_ptr< ParameterSet > |
parameters | ) |
|
|
pure virtual |
Set this package's metadata with the given parameter set.
- Parameters
-
| parameters | the parameters to set. |
◆ getPath()
| virtual String myscript::iink::ContentPackage::getPath |
( |
| ) |
|
|
pure virtual |
Returns the path of this package.
- Returns
- the path.
- Since
- 2.0
The documentation for this class was generated from the following file: