Inherits from NSObject
Declared in IINKContentPackage.h

Overview

A package stores the user content as a sorted collection of parts.

Tasks

Properties

metadata

@property (nonatomic, nullable) IINKParameterSet *metadata
Discussion

This package’s metadata as a parameter set.

Declared In

IINKContentPackage.h

Instance Methods

createPart:error:

- (nullable IINKContentPart *)createPart:(nonnull NSString *)type error:(NSError *_Nullable *_Nullable)error
Discussion

Appends a new part to this package.

Parameters

type

the type of part.

error

the recipient for the error description object * IINKErrorInvalidArgument when type is not a valid ContentPart type.

Return Value

the newly created part on success, otherwise nil.

Declared In

IINKContentPackage.h

extractObject:toFile:error:

- (BOOL)extractObject:(nonnull NSString *)url toFile:(nonnull NSString *)fileName error:(NSError *_Nullable *_Nullable)error
Discussion

Extracts an object from this package to a given path.

Parameters

url

URL of the object.

fileName

destination file.

error

the recipient for the error description object * IINKErrorInvalidArgument when no object named url exists. * IINKErrorRuntime when an I/O operation fails.

Return Value

YES on success, otherwise NO.

Declared In

IINKContentPackage.h

getPart:error:

- (nullable IINKContentPart *)getPart:(nonnull NSString *)identifier error:(NSError *_Nullable *_Nullable)error
Discussion

Returns the specified part.

Parameters

identifier

the identifier of the requested part.

error

the recipient for the error description object * IINKErrorInvalidArgument when no part is associated with identifier id.

Return Value

the part on success, otherwise nil..

Declared In

IINKContentPackage.h

getPartAt:error:

- (nullable IINKContentPart *)getPartAt:(NSInteger)index error:(NSError *_Nullable *_Nullable)error
Discussion

Returns the part at the specified index.

Parameters

index

the index of the requested part.

error

the recipient for the error description object * IINKErrorOutOfRange when index is out of range.

Return Value

the requested part on success, otherwise nil.

Declared In

IINKContentPackage.h

indexOfPart:error:

- (NSInteger)indexOfPart:(nonnull IINKContentPart *)part error:(NSError *_Nullable *_Nullable)error
Discussion

Returns the index of a given part.

Parameters

part

the part.

error

the recipient for the error description object * IINKErrorInvalidArgument when part does not belong to this package.

Return Value

the index of the part on success, otherwise -1.

Declared In

IINKContentPackage.h

partCount

- (NSInteger)partCount
Discussion

Returns the number of parts in this package.

Declared In

IINKContentPackage.h

saveAs:error:

- (BOOL)saveAs:(nonnull NSString *)fileName error:(NSError *_Nullable *_Nullable)error
Discussion

Saves of all ongoing modifications made to this package, to a new file.

Parameters

fileName

the new file name.

error

the recipient for the error description object * IINKErrorRuntime when an I/O operation fails.

Return Value

YES on success, otherwise NO.

Declared In

IINKContentPackage.h

saveToTempWithError:

- (BOOL)saveToTempWithError:(NSError *_Nullable *_Nullable)error
Discussion

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.

Note: temporary folder location can be set via the content-package.temp-folder configuration property.

Parameters

error

the recipient for the error description object * IINKErrorRuntime when an I/O operation fails.

Return Value

YES on success, otherwise NO.

Declared In

IINKContentPackage.h

saveWithError:

- (BOOL)saveWithError:(NSError *_Nullable *_Nullable)error
Discussion

Saves all ongoing modifications made to this package.

Parameters

error

the recipient for the error description object * IINKErrorRuntime when an I/O operation fails.

Return Value

YES on success, otherwise NO.

Declared In

IINKContentPackage.h