#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Zipper.hpp>
|
| | 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 |
◆ e_compression
| Enumerator |
|---|
| NO_COMPRESSION | |
| FAST_COMPRESSION | |
| TIGHT_COMPRESSION | |
16 {
20 };
@ FAST_COMPRESSION
Definition Zipper.hpp:18
@ NO_COMPRESSION
Definition Zipper.hpp:17
@ TIGHT_COMPRESSION
Definition Zipper.hpp:19
◆ Zipper() [1/3]
◆ ~Zipper()
| Slic3r::Zipper::~Zipper |
( |
| ) |
|
62{
64
66 BOOST_LOG_TRIVIAL(error) <<
m_impl->formatted_errorstr();
67 }
68
69 if(!mz_zip_writer_finalize_archive(&
m_impl->arch))
70 BOOST_LOG_TRIVIAL(error) <<
m_impl->formatted_errorstr();
71 }
72
73
75 BOOST_LOG_TRIVIAL(error) <<
m_impl->formatted_errorstr();
76}
void finish_entry()
Finishing an entry means that subsequent writes will no longer be appended to the previous entry....
Definition Zipper.cpp:119
bool close_zip_writer(mz_zip_archive *zip)
Definition miniz_extension.cpp:130
References Slic3r::close_zip_writer(), finish_entry(), and m_impl.
◆ Zipper() [2/3]
| Slic3r::Zipper::Zipper |
( |
const Zipper & | | ) |
|
|
delete |
◆ Zipper() [3/3]
| Slic3r::Zipper::Zipper |
( |
Zipper && | m | ) |
|
◆ add_entry() [1/2]
| void Slic3r::Zipper::add_entry |
( |
const std::string & | name | ) |
|
◆ add_entry() [2/2]
| void Slic3r::Zipper::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.
101{
102 if(!
m_impl->is_alive())
return;
103
105 mz_uint cmpr = MZ_NO_COMPRESSION;
110 }
111
112 if(!mz_zip_writer_add_mem(&
m_impl->arch, name.c_str(), data, l, cmpr))
114
117}
References FAST_COMPRESSION, finish_entry(), m_compression, m_data, m_entry, m_impl, NO_COMPRESSION, and TIGHT_COMPRESSION.
◆ finalize()
| void Slic3r::Zipper::finalize |
( |
| ) |
|
◆ finish_entry()
| 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.
120{
121 if(!
m_impl->is_alive())
return;
122
124 mz_uint compression = MZ_NO_COMPRESSION;
125
130 }
131
135 compression))
m_impl->blow_up();
136 }
137
140}
References FAST_COMPRESSION, m_compression, m_data, m_entry, m_impl, NO_COMPRESSION, and TIGHT_COMPRESSION.
Referenced by ~Zipper(), add_entry(), add_entry(), and finalize().
◆ get_filename()
| const std::string & Slic3r::Zipper::get_filename |
( |
| ) |
const |
◆ operator<<() [1/2]
template<class T>
| std::enable_if<!std::is_arithmetic< T >::value, Zipper & >::type Slic3r::Zipper::operator<< |
( |
T && | val | ) |
|
|
inline |
◆ operator<<() [2/2]
template<class T>
| std::enable_if< std::is_arithmetic< T >::value, Zipper & >::type Slic3r::Zipper::operator<< |
( |
T && | val | ) |
|
|
inline |
62 {
63 return this->operator<<(std::to_string(std::forward<T>(val)));
64 }
References Zipper().
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ m_compression
◆ m_data
| std::string Slic3r::Zipper::m_data |
|
private |
◆ m_entry
| std::string Slic3r::Zipper::m_entry |
|
private |
◆ m_impl
| std::unique_ptr<Impl> Slic3r::Zipper::m_impl |
|
private |
The documentation for this class was generated from the following files:
- /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Zipper.hpp
- /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Zipper.cpp