Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::RecorderBookmarks Class Reference

Manages a directory with recorded logs. More...

Inheritance diagram for gem::RecorderBookmarks:
Collaboration diagram for gem::RecorderBookmarks:

Public Member Functions

 RecorderBookmarks (RecorderBookmarks &&recorderBookmarks)=default
 Default move constructor noexcept is deduced.
RecorderBookmarksoperator= (RecorderBookmarks &&recorderBookmarks)=default
 Default move assignment noexcept is deduced.
StrongPointer< LogMetadatagetMetadata (const String &logFile) const
 Retrieves the metadata for a specified log file.
StringList getProtectedLogsList ()
 Gets a list of all the protected logs.
StringList getLogsList (EFileSortOrder fileSortOrder=EFileSortOrder::orderAsc, EFileSortType fileSortType=EFileSortType::sortDate)
 Gets a list of all logs sorted based on the provided sort order and sort type.
int markLogProtected (const String &logFile)
 Marks a log as protected.
int markLogUploaded (const String &logFile)
 Marks a log as uploaded.
int deleteLog (const String &logFile)
 Deletes the specified log file.
virtual LargeUnsignedInteger getLogDurationInSeconds (const String &logFile) const
 Retrieves the duration of a log file.
int exportLog (const String &logFile, const String &albumName, CompletionCallback callback)
 Exports a log to public storage.
int exportLog (const String &logPath, EFileType type, const String &exportedFileName={}, double positionDistance=0.0)
 Exports a log file in a different format.
int importLog (const String &logPath, const String &importedFileName={})
 Import a log file in GM format.

Static Public Member Functions

static StrongPointer< RecorderBookmarksproduce (String path)
 Creates a RecorderBookmarks object for managing bookmarks within the specified directory.

Detailed Description

Manages a directory with recorded logs.

Constructor & Destructor Documentation

◆ RecorderBookmarks()

gem::RecorderBookmarks::RecorderBookmarks ( RecorderBookmarks && recorderBookmarks)
default

Default move constructor noexcept is deduced.

Parameters
recorderBookmarksThe object to move

Member Function Documentation

◆ deleteLog()

int gem::RecorderBookmarks::deleteLog ( const String & logFile)
inline

Deletes the specified log file.

Parameters
[in]logFileThe file to be deleted.
Returns
KNoError If operation succeeds.
KGeneral If operation fails.

◆ exportLog() [1/2]

int gem::RecorderBookmarks::exportLog ( const String & logFile,
const String & albumName,
CompletionCallback callback )
inline

Exports a log to public storage.

Parameters
[in]logFileThe file path to be exported.
[in]albumNameName of the album where the video files will be placed.
[in]callbackA callback function to notify the completion of the export operation. The callback takes 2 parameters:
  • The path as a String representing the location of the exported log.
  • An int representing the error code (KNoError if the export is successful, or an error code if it fails).
Returns
KNoError If the operation succeeds.
KGeneral If the operation fails.

This method exports the specified log file to public storage, placing it in the given album. The callback function is called when the operation completes, providing the path of the exported file and an error code indicating the result of the export process.

◆ exportLog() [2/2]

int gem::RecorderBookmarks::exportLog ( const String & logPath,
EFileType type,
const String & exportedFileName = {},
double positionDistance = 0.0 )
inline

Exports a log file in a different format.

If the name of the exported file is not specified, the log name will be used.

Parameters
[in]logPathThe file to be exported.
[in]typeThe type of the exported file.
[in]exportedFileNameThe name of the exported file.
[in]positionDistanceThe distance between two consecutive GPS positions. To retain the exact positions from the original log, set this distance to 0.
Returns
KNoError If the operation succeeds.
KExist If the exported file already exists in the folder.
KGeneral If the operation fails.

◆ getLogDurationInSeconds()

virtual LargeUnsignedInteger gem::RecorderBookmarks::getLogDurationInSeconds ( const String & logFile) const
inlinevirtual

Retrieves the duration of a log file.

Parameters
[in]logFileThe log file path.
Returns
The log duration in seconds.

◆ getLogsList()

StringList gem::RecorderBookmarks::getLogsList ( EFileSortOrder fileSortOrder = EFileSortOrder::orderAsc,
EFileSortType fileSortType = EFileSortType::sortDate )
inline

Gets a list of all logs sorted based on the provided sort order and sort type.

Parameters
[in]fileSortOrderSpecifies the sorting order of the logs (ascending or descending).
[in]fileSortTypeSpecifies the sorting type for the logs (e.g., by date, name, or size).
Returns
The list of all logs.

◆ getMetadata()

StrongPointer< LogMetadata > gem::RecorderBookmarks::getMetadata ( const String & logFile) const
inline

Retrieves the metadata for a specified log file.

Parameters
[in]logFileThe path to the log file for which metadata is to be retrieved.
Returns
A StrongPointer to the LogMetadata object containing the metadata of the specified log file, or an empty pointer if the operation fails.

◆ getProtectedLogsList()

StringList gem::RecorderBookmarks::getProtectedLogsList ( )
inline

Gets a list of all the protected logs.

This method retrieves all the logs that are marked as protected, meaning they cannot be deleted automatically by the system.

Returns
The protected log list.

◆ importLog()

int gem::RecorderBookmarks::importLog ( const String & logPath,
const String & importedFileName = {} )
inline

Import a log file in GM format.

Supported file formats include: GPX, NMEA, KML, fit, tcx. If the name of the exported file is not specified, the log name will be used.

Parameters
[in]logPathThe path to the log file to be imported.
[in]importedFileNameThe name to be used for the imported file. If not specified, the log file's name will be used.
Returns
KNoError if the operation succeeds.
KExist if the importedFileName file already exists in the folder.
KNotSupported if the file format is not supported.
KExist If the imported file already exists in the folder.
KGeneral if the operation fails.

◆ markLogProtected()

int gem::RecorderBookmarks::markLogProtected ( const String & logFile)
inline

Marks a log as protected.

Parameters
[in]logFileThe file to be marked as protected.
Returns
KNoError If the operation succeeds.
KGeneral If the operation fails.

This method prevents the specified log from being deleted automatically when the system reaches its maximum disk space or the configured retention time is met.

◆ markLogUploaded()

int gem::RecorderBookmarks::markLogUploaded ( const String & logFile)
inline

Marks a log as uploaded.

Parameters
[in]logFileThe file to be marked as uploaded.
Returns
KNoError If the operation succeeds.
KGeneral If the operation fails.

This method marks a log as uploaded, which signifies that the log has been successfully transferred to the server.

◆ operator=()

RecorderBookmarks & gem::RecorderBookmarks::operator= ( RecorderBookmarks && recorderBookmarks)
default

Default move assignment noexcept is deduced.

Parameters
recorderBookmarksThe object to move
Returns
The object that was moved

◆ produce()

StrongPointer< RecorderBookmarks > gem::RecorderBookmarks::produce ( String path)
inlinestatic

Creates a RecorderBookmarks object for managing bookmarks within the specified directory.

Parameters
[in]pathThe directory path where the logs are stored.
Returns
A StrongPointer to the RecorderBookmarks object, or an empty pointer on failure.