File DlContainer.h¶
↰ Parent directory (DlContainer)
Contents
Definition (DlContainer/DlContainer.h)¶
Includes¶
DlSystem/DlError.h(File DlError.h)DlSystem/StringList.h(File StringList.h)stddef.hstdint.h
Included By¶
Functions¶
Full File Listing¶
Typedefs
-
typedef void *Snpe_DlcRecord_Handle_t¶
A typedef to indicate a SNPE DlcRecord handle
-
typedef void *Snpe_DlContainer_Handle_t¶
A typedef to indicate a SNPE DlContainer handle
Functions
-
Snpe_DlcRecord_Handle_t Snpe_DlcRecord_Create()¶
Constructs a DlcRecord and returns a handle to it
- Returns
the handle to the created DlcRecord
-
Snpe_DlcRecord_Handle_t Snpe_DlcRecord_CreateName(const char *name)¶
Constructs a DlcRecord with a provided name and returns a handle to it
- Parameters
name – [in] : the name of the record
- Returns
the handle to the created DlcRecord
-
Snpe_ErrorCode_t Snpe_DlcRecord_Delete(Snpe_DlcRecord_Handle_t dlcRecordHandle)¶
Destroys/frees a DlcRecord
- Parameters
dlcRecordHandle – [in] : Handle to access DlcRecord
- Returns
indication of success/failures
-
size_t Snpe_DlcRecord_Size(Snpe_DlcRecord_Handle_t dlcRecordHandle)¶
Gets the size of a DlcRecord in bytes
- Parameters
dlcRecordHandle – [in] : Handle to access DlcRecord
- Returns
the size of the DlcRecord in bytes
-
uint8_t *Snpe_DlcRecord_Data(Snpe_DlcRecord_Handle_t dlcRecordHandle)¶
Gets a pointer to the start of the DlcRecord’s data
- Parameters
dlcRecordHandle – [in] : Handle to access DlcRecord
- Returns
uint8_t pointer to the DlcRecord’s data
-
const char *Snpe_DlcRecord_Name(Snpe_DlcRecord_Handle_t dlcRecordHandle)¶
Gets the name of the DlcRecord
- Parameters
dlcRecordHandle – [in] : Handle to access DlcRecord
- Returns
the record’s name
-
Snpe_ErrorCode_t Snpe_DlContainer_Delete(Snpe_DlContainer_Handle_t dlContainerHandle)¶
Destroys/frees a DlContainer
- Parameters
dlContainerHandle – [in] : Handle to access DlContainer
- Returns
indication of success/failures
-
Snpe_DlContainer_Handle_t Snpe_DlContainer_Open(const char *filename)¶
Initializes a container from a container archive file.
- Parameters
filename – [in] Container archive file path.
- Returns
Status of container open call
-
Snpe_DlContainer_Handle_t Snpe_DlContainer_OpenBuffer(const uint8_t *buffer, const size_t size)¶
Initializes a container from a byte buffer.
- Parameters
buffer – [in] Byte buffer holding the contents of an archive file.
size – [in] Size of the byte buffer.
- Returns
A Snpe_DlContainer_Handle_t to access the dlContainer
-
Snpe_DlContainer_Handle_t Snpe_DlContainer_Open_With_DestinationHint(const char *filename, const char *destinationDirectoryHint)¶
Initializes a container from a container archive file along with a hint where dlc will be saved.
- Parameters
filename – [in] Container archive file path.
destinationDirectoryHint – [in] Path to a directory where the dlc will be saved after changes.
- Returns
A Snpe_DlContainer_Handle_t to access the dlContainer
Note
When destinationDirectoryHint is null or invalid directory path, a null handle is returned.
Note
When empty string is passed as destinationDirectoryHint, the current working directory is used as the destination directory hint.
Note
This API is recommended only when the container is modified. The Save API determines the final path where the DLC will be saved.
-
Snpe_DlContainer_Handle_t Snpe_DlContainer_OpenBuffer_With_DestinationHint(const uint8_t *buffer, const size_t size, const char *destinationDirectoryHint)¶
Initializes a container from a byte buffer along with a hint where dlc will be saved.
- Parameters
buffer – [in] Byte buffer holding the contents of an archive file.
size – [in] Size of the byte buffer.
destinationDirectoryHint – [in] Path to a directory where the dlc will be saved after changes.
- Returns
A Snpe_DlContainer_Handle_t to access the dlContainer
Note
When destinationDirectoryHint is null or invalid directory path, a null handle is returned.
Note
When empty string is passed as destinationDirectoryHint, the current working directory is used as the destination directory hint.
Note
This API is recommended only when the container is modified. The Save API determines the final path where the DLC will be saved.
-
Snpe_StringList_Handle_t Snpe_DlContainer_GetCatalog(Snpe_DlContainer_Handle_t dlContainerHandle)¶
Get the record catalog for a container.
- Parameters
dlContainerHandle – [in] : Handle to access DlContainer
- Returns
A Snpe_StringListHandle_t that holds the record names of the DlContainer
-
Snpe_DlcRecord_Handle_t Snpe_DlContainer_GetRecord(Snpe_DlContainer_Handle_t dlContainerHandle, const char *recordName)¶
Get a record from a container by name.
- Parameters
dlContainerHandle – [in] : Handle to access DlContainer
recordName – [in] : Name of the record to fetch.
- Returns
A Snpe_DlcRecordHandle_t that owns the record read from the DlContainer
-
Snpe_ErrorCode_t Snpe_DlContainer_Save(Snpe_DlContainer_Handle_t dlContainerHandle, const char *filename)¶
Save the container to an archive on disk. This function will save the container if the filename is different from the file that it was opened from, or if at least one record was modified since the container was opened.
It will truncate any existing file at the target path.
- Parameters
dlContainerHandle – [in] : Handle to access DlContainer
filename – [in] : Container archive file path.
- Returns
indication of success/failure