PrusaSlicer-NonPlainar/src/libslic3r/Format/ZipperArchiveImport.hpp

44 lines
1.2 KiB
C++
Raw Normal View History

2022-04-20 15:28:14 +00:00
#ifndef ZIPPERARCHIVEIMPORT_HPP
#define ZIPPERARCHIVEIMPORT_HPP
#include <vector>
#include <string>
#include <cstdint>
#include <boost/property_tree/ptree.hpp>
#include "libslic3r/PrintConfig.hpp"
2022-04-20 15:28:14 +00:00
namespace Slic3r {
struct EntryBuffer
{
std::vector<uint8_t> buf;
std::string fname;
};
struct ZipperArchive
{
boost::property_tree::ptree profile, config;
std::vector<EntryBuffer> entries;
};
const constexpr char *CONFIG_FNAME = "config.ini";
const constexpr char *PROFILE_FNAME = "prusaslicer.ini";
2022-04-20 15:28:14 +00:00
ZipperArchive read_zipper_archive(const std::string &zipfname,
const std::vector<std::string> &includes,
const std::vector<std::string> &excludes);
// Extract the print profile form the archive onto 'out'.
// Returns a profile that has correct parameters to use for model reconstruction
// even if the needed parameters were not fully found in the archive's metadata.
// The inout argument shall be a usable fallback profile if the archive
// has totally corrupted metadata.
std::pair<DynamicPrintConfig, ConfigSubstitutions> extract_profile(
const ZipperArchive &arch, DynamicPrintConfig &inout);
2022-04-20 15:28:14 +00:00
} // namespace Slic3r
#endif // ZIPPERARCHIVEIMPORT_HPP