mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 10:15:55 +08:00
WIP: Exporting 3MFs through a streaming interface.
This commit is contained in:
parent
729298c408
commit
55c698feef
@ -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…
x
Reference in New Issue
Block a user