Class YMKStorageManager

Storage manager.

This is a manager that controls temporary cache storages (e.g. map tiles).

Instance Methods

- addStorageErrorListenerWithErrorListener:

Subscribes to storage events.

- clearWithClearCallback:

Removes all data.

- computeSizeWithSizeCallback:

Computes storage size in bytes.

- maxTileStorageSizeWithSizeCallback:

Obtains the current storage size limit in bytes.

- moveDataWithNewPath:storageMoveListener:

Moves storage to the specified folder.

- removeStorageErrorListenerWithErrorListener:

Unsubscribes from storage events.

- requestPathWithPathGetterListener:

Provides the data path for storage files.

- resetMaxTileStorageSize

Resets the tile cache size limit.

- setMaxTileStorageSizeWithLimit:

Sets the maximum tile cache size to limit bytes.

Properties

valid

Tells if this object is valid or no.

Method Detail

-addStorageErrorListenerWithErrorListener:

- (void)addStorageErrorListenerWithErrorListener:(nonnull id< YMKStorageStorageErrorListener >)errorListener 

Subscribes to storage events.

-clearWithClearCallback:

- (void)clearWithClearCallback:(nonnull YMKStorageManagerClearCallback)clearCallback 

Removes all data.

-computeSizeWithSizeCallback:

- (void)computeSizeWithSizeCallback:(nonnull YMKStorageManagerSizeCallback)sizeCallback 

Computes storage size in bytes.

-maxTileStorageSizeWithSizeCallback:

- (void)maxTileStorageSizeWithSizeCallback:(nonnull YMKStorageManagerSizeCallback)sizeCallback 

Obtains the current storage size limit in bytes.

-moveDataWithNewPath:storageMoveListener:

- (void)moveDataWithNewPath:(nonnull NSString *)newPath
        storageMoveListener:(nonnull id< YMKStorageManagerStorageMoveListener >)storageMoveListener 

Moves storage to the specified folder.

This operation is non-cancellable. If there is already a pending operation to set the storage path, it throws an error (Android). If the application exits before the operation is completed, it does not take effect, but garbage will not be cleared.
Parameters:
newPath

New path to store data.

storageMoveListener

It will be unsubscribed automatically when the operation is completed or fails with an error.

-removeStorageErrorListenerWithErrorListener:

- (void)removeStorageErrorListenerWithErrorListener:(nonnull id< YMKStorageStorageErrorListener >)errorListener 

Unsubscribes from storage events.

-requestPathWithPathGetterListener:

- (void)requestPathWithPathGetterListener:(nonnull YMKStorageManagerPathGetterListener)pathGetterListener 

Provides the data path for storage files.

-resetMaxTileStorageSize

- (void)resetMaxTileStorageSize

Resets the tile cache size limit.

-setMaxTileStorageSizeWithLimit:

- (void)setMaxTileStorageSizeWithLimit:(long long)limit 

Sets the maximum tile cache size to limit bytes.

When the limit is reached, old tiles are removed.

Property Detail

valid

(assign, readonly, getter=isValid) BOOL valid

Tells if this object is valid or no.

Any method called on an invalid object will throw an exception. The object becomes invalid only on UI thread, and only when its implementation depends on objects already destroyed by now. Please refer to general docs about the interface for details on its invalidation.