OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::anonymous_namespace{ZipperArchiveImport.cpp} Namespace Reference

Functions

boost::property_tree::ptree read_ini (const mz_zip_archive_file_stat &entry, MZ_Archive &zip)
EntryBuffer read_entry (const mz_zip_archive_file_stat &entry, MZ_Archive &zip, const std::string &name)

Function Documentation

◆ read_entry()

EntryBuffer Slic3r::anonymous_namespace{ZipperArchiveImport.cpp}::read_entry ( const mz_zip_archive_file_stat & entry,
MZ_Archive & zip,
const std::string & name )
48{
49 std::vector<uint8_t> buf(entry.m_uncomp_size);
50
51 if (!mz_zip_reader_extract_to_mem(&zip.arch, entry.m_file_index,
52 buf.data(), buf.size(), 0))
53 throw Slic3r::FileIOError(zip.get_errorstr());
54
55 return {std::move(buf), (name.empty() ? entry.m_filename : name)};
56}
static std::string get_errorstr(mz_zip_error mz_err)
Definition miniz_extension.cpp:239
mz_zip_archive arch
Definition miniz_extension.hpp:24

References Slic3r::MZ_Archive::arch, Slic3r::MZ_Archive::get_errorstr(), and read_entry().

Referenced by read_entry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_ini()

boost::property_tree::ptree Slic3r::anonymous_namespace{ZipperArchiveImport.cpp}::read_ini ( const mz_zip_archive_file_stat & entry,
MZ_Archive & zip )
31{
32 std::string buf(size_t(entry.m_uncomp_size), '\0');
33
34 if (!mz_zip_reader_extract_to_mem(&zip.arch, entry.m_file_index,
35 buf.data(), buf.size(), 0))
36 throw Slic3r::FileIOError(zip.get_errorstr());
37
38 boost::property_tree::ptree tree;
39 std::stringstream ss(buf);
40 boost::property_tree::read_ini(ss, tree);
41 return tree;
42}

References Slic3r::MZ_Archive::arch, Slic3r::MZ_Archive::get_errorstr(), and read_ini().

Referenced by read_ini().

Here is the call graph for this function:
Here is the caller graph for this function: