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
|
@ -2301,10 +2301,13 @@ namespace Slic3r {
|
||||||
}
|
}
|
||||||
|
|
||||||
stream << "</" << MODEL_TAG << ">\n";
|
stream << "</" << MODEL_TAG << ">\n";
|
||||||
|
|
||||||
|
mz_zip_writer_staged_context context;
|
||||||
|
std::string buf = stream.str();
|
||||||
|
|
||||||
std::string out = stream.str();
|
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()) ||
|
||||||
if (!mz_zip_writer_add_mem(&archive, MODEL_FILE.c_str(), (const void*)out.data(), out.length(), MZ_DEFAULT_COMPRESSION))
|
!mz_zip_writer_add_staged_finish(&archive, &context))
|
||||||
{
|
{
|
||||||
add_error("Unable to add model file to archive");
|
add_error("Unable to add model file to archive");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue