![]() |
Prusa Slicer 2.6.0
|
#include <src/libslic3r/Zipper.hpp>
Collaboration diagram for Slic3r::Zipper:Classes | |
| class | Impl |
Public Types | |
| enum | e_compression { NO_COMPRESSION , FAST_COMPRESSION , TIGHT_COMPRESSION } |
Public Member Functions | |
| Zipper (const std::string &zipfname, e_compression level=FAST_COMPRESSION) | |
| ~Zipper () | |
| Zipper (const Zipper &)=delete | |
| Zipper & | operator= (const Zipper &)=delete |
| Zipper (Zipper &&m) | |
| Zipper & | operator= (Zipper &&m) |
| void | add_entry (const std::string &name) |
| Adding an entry means a file inside the new archive. Name param is the name of the new file. To create directories, append a forward slash. The previous entry is finished (see finish_entry) | |
| void | add_entry (const std::string &name, const void *data, size_t bytes) |
| Add a new binary file entry with an instantly given byte buffer. This method throws exactly like finish_entry() does. | |
| template<class T > | |
| std::enable_if< std::is_arithmetic< T >::value, Zipper & >::type | operator<< (T &&val) |
| template<class T > | |
| std::enable_if<!std::is_arithmetic< T >::value, Zipper & >::type | operator<< (T &&val) |
| void | finish_entry () |
| Finishing an entry means that subsequent writes will no longer be appended to the previous entry. They will be written into the internal buffer and ones an entry is added, the buffer will bind to the new entry If the buffer was written, but no entry was added, the buffer will be cleared after this call. | |
| void | finalize () |
| const std::string & | get_filename () const |
Private Attributes | |
| std::unique_ptr< Impl > | m_impl |
| std::string | m_data |
| std::string | m_entry |
| e_compression | m_compression |
| Enumerator | |
|---|---|
| NO_COMPRESSION | |
| FAST_COMPRESSION | |
| TIGHT_COMPRESSION | |
|
explicit |
References m_compression, m_impl, and Slic3r::open_zip_writer().
Here is the call graph for this function:| Slic3r::Zipper::~Zipper | ( | ) |
References Slic3r::close_zip_writer(), error, finish_entry(), m_impl, and mz_zip_writer_finalize_archive().
Here is the call graph for this function:| Slic3r::Zipper::Zipper | ( | Zipper && | m | ) |
Adding an entry means a file inside the new archive. Name param is the name of the new file. To create directories, append a forward slash. The previous entry is finished (see finish_entry)
References finish_entry(), m_entry, and m_impl.
Referenced by Slic3r::SL1Archive::export_print(), and Slic3r::write_thumbnail().
Here is the call graph for this function:
Here is the caller graph for this function:Add a new binary file entry with an instantly given byte buffer. This method throws exactly like finish_entry() does.
References FAST_COMPRESSION, finish_entry(), m_compression, m_data, m_entry, m_impl, MZ_BEST_COMPRESSION, MZ_BEST_SPEED, MZ_NO_COMPRESSION, mz_zip_writer_add_mem(), NO_COMPRESSION, and TIGHT_COMPRESSION.
Here is the call graph for this function:| void Slic3r::Zipper::finalize | ( | ) |
References finish_entry(), m_impl, and mz_zip_writer_finalize_archive().
Referenced by Slic3r::SL1Archive::export_print().
Here is the call graph for this function:
Here is the caller graph for this function:| void Slic3r::Zipper::finish_entry | ( | ) |
Finishing an entry means that subsequent writes will no longer be appended to the previous entry. They will be written into the internal buffer and ones an entry is added, the buffer will bind to the new entry If the buffer was written, but no entry was added, the buffer will be cleared after this call.
This method will throw a runtime exception if an error occures. The entry will still be open (with the data intact) but the state of the file is up to minz after the erroneous write.
References FAST_COMPRESSION, m_compression, m_data, m_entry, m_impl, MZ_BEST_COMPRESSION, MZ_BEST_SPEED, MZ_NO_COMPRESSION, mz_zip_writer_add_mem(), NO_COMPRESSION, and TIGHT_COMPRESSION.
Referenced by ~Zipper(), add_entry(), add_entry(), and finalize().
Here is the call graph for this function:
Here is the caller graph for this function:| const std::string & Slic3r::Zipper::get_filename | ( | ) | const |
References m_impl.
Referenced by Slic3r::SL1Archive::export_print().
Here is the caller graph for this function:
|
inline |
|
inline |
References m_compression, m_data, m_entry, and m_impl.
|
private |
Referenced by Zipper(), add_entry(), finish_entry(), and operator=().
|
private |
Referenced by add_entry(), finish_entry(), operator<<(), and operator=().
|
private |
Referenced by add_entry(), add_entry(), finish_entry(), and operator=().
|
private |
Referenced by Zipper(), ~Zipper(), add_entry(), add_entry(), finalize(), finish_entry(), get_filename(), and operator=().