Class NNArchiveVersionedConfig

Class Documentation

class NNArchiveVersionedConfig

Public Functions

explicit NNArchiveVersionedConfig(const std::vector<uint8_t> &data, NNArchiveEntry::Compression compression = NNArchiveEntry::Compression::AUTO)

@data Should point to a whole compressed NNArchive read to memory if compression is not set to RAW_FS. If compression is set to RAW_FS, then this should point to just the config.json file read to memory.

explicit NNArchiveVersionedConfig(const std::filesystem::path &path, NNArchiveEntry::Compression compression = NNArchiveEntry::Compression::AUTO)

@path Should point to: 1) if compression is set to RAW_FS: to just the config.json file. 2) if compression is set to AUTO: to whole compressed NNArchive or just the config.json file which must end in .json . 3) else: to whole compressed NNArchive. see NNArchive class for parameter explanation

NNArchiveVersionedConfig(const std::function<int()> &openCallback, const std::function<std::shared_ptr<std::vector<uint8_t>>()> &readCallback, const std::function<int64_t(int64_t offset, NNArchiveEntry::Seek whence)> &seekCallback, const std::function<int64_t(int64_t request)> &skipCallback, const std::function<int()> &closeCallback, NNArchiveEntry::Compression compression = NNArchiveEntry::Compression::AUTO)

Returned data should be just the config.json if compression == RAW_FS or the whole NNArchive otherwise see NNArchive class for parameter explanation

inline NNArchiveVersionedConfig(const NNArchiveConfig &config)

Construct NNArchiveVersionedConfig from a specific version of a config.

Parameters:

versionVersion of the config.

inline NNArchiveConfigVersion getVersion() const

Get version of the underlying config.

template<typename T>
inline const T &getConfig() const

Get stored config cast to a specific version.

Template Parameters:

T – Config type to cast to.

template<>
inline const NNArchiveConfig &getConfig() const