File IDlContainer.hpp

Parent directory (DlContainer)

Definition (DlContainer/IDlContainer.hpp)

Includes

Full File Listing

namespace DlContainer
struct DlcRecord
#include <IDlContainer.hpp>

Public Functions

DlcRecord()
DlcRecord(DlcRecord &&other) noexcept
DlcRecord(const std::string &new_name)
DlcRecord(const DlcRecord&) = delete

Public Members

std::string name
std::vector<uint8_t> data
class IDlContainer
#include <IDlContainer.hpp>

Public Functions

void getCatalog(std::set<std::string> &catalog) const

Get the record catalog for a container.

Parameters

catalog[in] : Reference to the record catalog if found

void getCatalog(std::set<DlSystem::String> &catalog) const

Get the record catalog for a container.

Parameters

catalog[in] : Reference to the record catalog if found

bool getRecord(const std::string &name, DlcRecord &record) const

Get a record from a container by name.

Parameters
  • name[in] : Name of the record to fetch

  • record[in] : Reference to the record if found

Returns

A Snpe_DlcRecordHandle_t that owns the record read from the DlContainer

bool getRecord(const DlSystem::String &name, DlcRecord &record) const

Get a record from a container by name.

Parameters
  • name[in] : Name of the record to fetch

  • record[in] : Reference to the record if found

Returns

A Snpe_DlcRecordHandle_t that owns the record read from the DlContainer

bool save(const std::string &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

filename[in] : Container archive file path.

Returns

indication of success/failure

bool save(const DlSystem::String &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

filename[in] : Container archive file path.

Returns

indication of success/failure

Public Static Functions

static std::unique_ptr<IDlContainer> open(const std::string &filename) noexcept

Initializes a container from a container archive file.

Parameters

filename[in] Container archive file path.

Returns

Status of container open call

static std::unique_ptr<IDlContainer> open(const uint8_t *buffer, const size_t size) noexcept

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

static std::unique_ptr<IDlContainer> open(const std::vector<uint8_t> &buffer) noexcept

Initializes a container from a byte buffer.

Parameters

buffer[in] Byte buffer holding the contents of an archive file.

Returns

A Snpe_DlContainer_Handle_t to access the dlContainer

static std::unique_ptr<IDlContainer> open(const DlSystem::String &filename) noexcept

Initializes a container from a container archive file.

Parameters

filename[in] Container archive file path.

Returns

Status of container open call

static std::unique_ptr<IDlContainer> open(const std::string &filename, const std::string &destinationDirectoryHint) noexcept

Initializes a container from a container archive file.

Parameters
  • filename[in] Container archive file path.

  • destinationDirectoryHint[in] Path to a directory where the dlc will be saved after changes.

Returns

Status of container open call

Note

When destinationDirectoryHint is 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.

static std::unique_ptr<IDlContainer> open(const uint8_t *buffer, const size_t size, const std::string &destinationDirectoryHint) noexcept

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.

  • destinationDirectoryHint[in] Path to a directory where the dlc will be saved after changes.

Returns

Status of container open call

Note

When destinationDirectoryHint is 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.

static std::unique_ptr<IDlContainer> open(const std::vector<uint8_t> &buffer, const std::string &destinationDirectoryHint) noexcept

Initializes a container from a byte buffer.

Parameters
  • buffer[in] Byte buffer holding the contents of an archive file.

  • destinationDirectoryHint[in] Path to a directory where the dlc will be saved after changes.

Returns

Status of container open call

Note

When destinationDirectoryHint is 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.

static std::unique_ptr<IDlContainer> open(const DlSystem::String &filename, const DlSystem::String &destinationDirectoryHint) noexcept

Initializes a container from a container archive file.

Parameters
  • filename[in] Container archive file path.

  • destinationDirectoryHint[in] Path to a directory where the dlc will be saved after changes.

Returns

Status of container open call

Note

When destinationDirectoryHint is 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.

class DlcRecordInternal

Public Functions

DlcRecordInternal()
explicit DlcRecordInternal(const std::string &name)
uint8_t *getData()
size_t size() const
const char *getName()