mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 18:27:58 -06:00
WIP: Exporting 3MFs through a streaming interface.
This commit is contained in:
parent
729298c408
commit
55c698feef
1 changed files with 6 additions and 3 deletions
|
@ -2302,9 +2302,12 @@ namespace Slic3r {
|
|||
|
||||
stream << "</" << MODEL_TAG << ">\n";
|
||||
|
||||
std::string out = stream.str();
|
||||
mz_zip_writer_staged_context context;
|
||||
std::string buf = stream.str();
|
||||
|
||||
if (!mz_zip_writer_add_mem(&archive, MODEL_FILE.c_str(), (const void*)out.data(), out.length(), MZ_DEFAULT_COMPRESSION))
|
||||
if (!mz_zip_writer_add_staged_open(&archive, &context, MODEL_FILE.c_str(), buf.size(), nullptr, nullptr, 0, MZ_DEFAULT_COMPRESSION, nullptr, 0, nullptr, 0) ||
|
||||
!mz_zip_writer_add_staged_data(&archive, &context, buf.data(), buf.size()) ||
|
||||
!mz_zip_writer_add_staged_finish(&archive, &context))
|
||||
{
|
||||
add_error("Unable to add model file to archive");
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue