SKGPSFilesService Class Reference

Inherits from NSObject
Declared in SKGPSFilesService.h

Overview

SKGPSFilesService provides support for loading, parsing and editing GPS files. Currently supports only the GPX file format.

+ sharedInstance

Returns the singleton SKGPSFilesService instance.

+ (SKGPSFilesService *)sharedInstance

Discussion

Returns the singleton SKGPSFilesService instance.

Declared In

SKGPSFilesService.h

– loadFileAtPath:error:

Loads a GPS file at a certain path and return the root element.

- (SKGPSFileElement *)loadFileAtPath:(NSString *)path error:(NSError **)error

Parameters

path

The path where the GPS file is located.

error

A pointer to an NSError object (not mandatory). If an error occurs, this will contain the failure reason.

Return Value

The root SKGPSFileElement. This can be used to navigate through the GPS file structure.

Discussion

Loads a GPS file at a certain path and return the root element.

Declared In

SKGPSFilesService.h

– saveFileAtPath:error:

Saves the current loaded GPS file to a certain path.

- (BOOL)saveFileAtPath:(NSString *)path error:(NSError **)error

Parameters

path

The path where the GPS file will be saved.

error

A pointer to an NSError object (not mandatory). If an error occurs, this will contain the failure reason.

Return Value

Success/Failure of saving the GPS data file.

Discussion

Saves the current loaded GPS file to a certain path.

Declared In

SKGPSFilesService.h

– resetCurrentFile:

Resets the current loaded GPS file to the initial state.

- (BOOL)resetCurrentFile:(NSError **)error

Parameters

error

A pointer to an NSError object (not mandatory). If an error occurs, this will contain the failure reason.

Return Value

Success/Failure of resetting the GPS data file.

Discussion

Resets the current loaded GPS file to the initial state.

Declared In

SKGPSFilesService.h

– childElementsForElement:error:

Returns all the children elements of a parent element

- (NSArray *)childElementsForElement:(SKGPSFileElement *)parent error:(NSError **)error

Parameters

parent

The parent element.

error

A pointer to an NSError object (not mandatory). If an error occurs, this will contain the failure reason.

Return Value

An array of SKGPSFileElement objects, children of the parent element.

Discussion

Returns all the children elements of a parent element

Declared In

SKGPSFilesService.h

– childElementsForElement:withType:error:

Returns all the children elements with a certain type of a parent element.

- (NSArray *)childElementsForElement:(SKGPSFileElement *)parent withType:(SKGPSFileElementType)type error:(NSError **)error

Parameters

parent

The parent element.

type

The type of the child elements.

error

A pointer to an NSError object (not mandatory). If an error occurs, this will contain the failure reason.

Return Value

An array of SKGPSFileElement objects with the specified type, children of the parent element.

Discussion

Returns all the children elements with a certain type of a parent element.

Declared In

SKGPSFilesService.h

– locationsForElement:

Returns the GPS locations of a SKGPSFileElement.

- (NSArray *)locationsForElement:(SKGPSFileElement *)element

Parameters

element

The element of the GPS file.

Return Value

An array of CLLocation objects, representing the locations of a SKGPSFileElement. For some element types ( SKGPSFileElementGPXRoutePoint, SKGPSFileElementGPXTrackPoint, SKGPSFileElementGPXWaypoint ), it will contain only one object .

Discussion

Returns the GPS locations of a SKGPSFileElement.

Declared In

SKGPSFilesService.h