Implementation of ModelSerializer using miniz for ZIP archives.
More...
|
| ZipSerializer () |
|
| ~ZipSerializer () |
|
bool | addData (const std::string &path, const void *data, size_t size) override |
| Adds a memory buffer to the archive.
|
|
bool | close () override |
| Closes the current archive.
|
|
size_t | extractData (const std::string &path, void *data, size_t size) override |
| Extracts data from the archive.
|
|
bool | hasFile (const std::string &path) const override |
| Checks if a file exists in the archive.
|
|
bool | openForRead (const std::string &filename) override |
| Opens an archive for reading.
|
|
bool | openForWrite (const std::string &filename) override |
| Opens an archive for writing.
|
|
virtual | ~ModelSerializer ()=default |
|
Implementation of ModelSerializer using miniz for ZIP archives.
◆ ZipSerializer()
Mila::Dnn::Serialization::ZipSerializer::ZipSerializer |
( |
| ) |
|
|
inline |
◆ ~ZipSerializer()
Mila::Dnn::Serialization::ZipSerializer::~ZipSerializer |
( |
| ) |
|
|
inline |
◆ addData()
bool Mila::Dnn::Serialization::ZipSerializer::addData |
( |
const std::string & |
path, |
|
|
const void * |
data, |
|
|
size_t |
size |
|
) |
| |
|
inlineoverridevirtual |
Adds a memory buffer to the archive.
- Parameters
-
path | Path within the archive |
data | Pointer to the data |
size | Size of the data in bytes |
- Returns
- True if successful
Implements Mila::Dnn::Serialization::ModelSerializer.
◆ close()
bool Mila::Dnn::Serialization::ZipSerializer::close |
( |
| ) |
|
|
inlineoverridevirtual |
◆ extractData()
size_t Mila::Dnn::Serialization::ZipSerializer::extractData |
( |
const std::string & |
path, |
|
|
void * |
data, |
|
|
size_t |
size |
|
) |
| |
|
inlineoverridevirtual |
Extracts data from the archive.
- Parameters
-
path | Path within the archive |
data | Pointer to the buffer where data should be stored |
size | Size of the buffer in bytes |
- Returns
- Actual size of extracted data, 0 if failed
Implements Mila::Dnn::Serialization::ModelSerializer.
◆ hasFile()
bool Mila::Dnn::Serialization::ZipSerializer::hasFile |
( |
const std::string & |
path | ) |
const |
|
inlineoverridevirtual |
◆ openForRead()
bool Mila::Dnn::Serialization::ZipSerializer::openForRead |
( |
const std::string & |
filename | ) |
|
|
inlineoverridevirtual |
◆ openForWrite()
bool Mila::Dnn::Serialization::ZipSerializer::openForWrite |
( |
const std::string & |
filename | ) |
|
|
inlineoverridevirtual |
◆ filename_
std::string Mila::Dnn::Serialization::ZipSerializer::filename_ |
|
private |
◆ is_writing_
bool Mila::Dnn::Serialization::ZipSerializer::is_writing_ = false |
|
private |
◆ zip_
mz_zip_archive Mila::Dnn::Serialization::ZipSerializer::zip_ |
|
private |
The documentation for this class was generated from the following file: