OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
PluginFsUtils.cpp File Reference
#include "PluginFsUtils.hpp"
#include "libslic3r/Utils.hpp"
#include "libslic3r/miniz_extension.hpp"
#include <boost/filesystem.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/directory.hpp>
#include <boost/filesystem/file_status.hpp>
#include <boost/log/trivial.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/nowide/fstream.hpp>
#include "PluginAuditManager.hpp"
#include "PythonInterpreter.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/format.hpp"
#include <exception>
#include <miniz.h>
#include <nlohmann/json.hpp>
#include <chrono>
#include <filesystem>
#include <string>
#include "slic3r/plugin/PluginDescriptor.hpp"
#include <utility>
#include <algorithm>
#include <cctype>
#include <cstdint>
#include <cstdlib>
#include <sstream>
#include <unordered_set>
#include <vector>
Include dependency graph for PluginFsUtils.cpp:

Go to the source code of this file.

Classes

struct  Slic3r::anonymous_namespace{PluginFsUtils.cpp}::ZipReaderGuard
struct  Slic3r::anonymous_namespace{PluginFsUtils.cpp}::MzHeapFree

Namespaces

namespace  Slic3r
 |/ Copyright (c) Prusa Research 2020 - 2023 Enrico Turri @enricoturri1966 |/ |/ PrusaSlicer is released under the terms of the AGPLv3 or higher |/
namespace  Slic3r::anonymous_namespace{PluginFsUtils.cpp}

Enumerations

enum class  Slic3r::anonymous_namespace{PluginFsUtils.cpp}::TomlSection { Slic3r::anonymous_namespace{PluginFsUtils.cpp}::Root , Slic3r::anonymous_namespace{PluginFsUtils.cpp}::OrcaPlugin , Slic3r::anonymous_namespace{PluginFsUtils.cpp}::OrcaPluginSettings , Slic3r::anonymous_namespace{PluginFsUtils.cpp}::InDepsArray }

Functions

std::string Slic3r::get_orca_plugins_dir ()
std::string Slic3r::get_cloud_plugin_dir (const std::string &user_id)
boost::filesystem::path Slic3r::resolve_plugin_root_from_descriptor (const PluginDescriptor &descriptor)
bool Slic3r::is_plugin_root_allowed (const boost::filesystem::path &candidate_root, const std::vector< std::string > &allowed_dirs)
bool Slic3r::resolve_allowed_plugin_root (const PluginDescriptor &descriptor, const std::vector< std::string > &allowed_dirs, const std::string &out_of_scope_error, boost::filesystem::path &resolved_root, std::string &error)
bool Slic3r::delete_plugin_root (const boost::filesystem::path &resolved_root, const std::string &plugin_id, std::string &error)
void Slic3r::anonymous_namespace{PluginFsUtils.cpp}::assign_discovered_plugin_key (PluginDescriptor &descriptor, const boost::filesystem::path &name_source)
void Slic3r::anonymous_namespace{PluginFsUtils.cpp}::scan_plugin_directory (const std::string &dir_path, std::vector< PluginDescriptor > &out)
std::vector< std::string > Slic3r::get_plugin_directories (const std::string &cloud_user_id)
std::vector< PluginDescriptor > Slic3r::discover_plugin_packages (const std::vector< std::string > &dirs, std::string &error)
bool Slic3r::anonymous_namespace{PluginFsUtils.cpp}::is_safe_archive_entry_path (const boost::filesystem::path &path)
std::string Slic3r::anonymous_namespace{PluginFsUtils.cpp}::decode_zip_entry_extra_path (const std::string &extra, const std::string &fallback)
std::string Slic3r::anonymous_namespace{PluginFsUtils.cpp}::zip_entry_name (mz_zip_archive &archive, const mz_zip_archive_file_stat &stat)
std::string Slic3r::anonymous_namespace{PluginFsUtils.cpp}::normalize_zip_entry_name (std::string entry_name)
bool Slic3r::is_valid_plugin_id (const std::string &id)
bool Slic3r::anonymous_namespace{PluginFsUtils.cpp}::read_zip_text_file (mz_zip_archive &archive, const char *filename, std::string &out, std::string &error)
std::string Slic3r::anonymous_namespace{PluginFsUtils.cpp}::unquote_toml_string (const std::string &val)
std::vector< std::string > Slic3r::anonymous_namespace{PluginFsUtils.cpp}::parse_toml_inline_array (const std::string &val)
bool Slic3r::anonymous_namespace{PluginFsUtils.cpp}::parse_pep723_toml (const std::string &toml_content, std::vector< std::string > &out_deps, std::string &out_requires_python, std::string &out_name, std::string &out_description, std::string &out_author, std::string &out_version, std::string &error)
std::string Slic3r::anonymous_namespace{PluginFsUtils.cpp}::normalize_package_name (const std::string &name)
void Slic3r::anonymous_namespace{PluginFsUtils.cpp}::parse_metadata_rfc822 (const std::string &content, std::string &out_name, std::string &out_version, std::string &out_summary, std::string &out_author, std::string &out_requires_python, std::string &out_import_name, std::vector< std::string > &out_requires_dist, std::string &error)
bool Slic3r::is_ignored_plugin_directory (const boost::filesystem::path &path)
bool Slic3r::is_safe_relative_path (const boost::filesystem::path &path)
bool Slic3r::extract_zip_to_directory (const boost::filesystem::path &zip_path, const boost::filesystem::path &destination, std::string &error)
bool Slic3r::read_install_state (const boost::filesystem::path &plugin_dir, PluginDescriptor &entry)
bool Slic3r::read_install_state (const boost::filesystem::path &plugin_dir, PluginInstallState &out)
void Slic3r::anonymous_namespace{PluginFsUtils.cpp}::apply_install_metadata (PluginInstallState &state, const PluginDescriptor &entry)
void Slic3r::seed_install_metadata (PluginInstallState &state, const PluginDescriptor &entry)
bool Slic3r::write_install_state (const boost::filesystem::path &plugin_dir, const PluginInstallState &state)
bool Slic3r::write_install_state (const boost::filesystem::path &plugin_dir, const PluginDescriptor &entry, bool enabled, const std::vector< std::pair< std::string, bool > > &capabilities)
bool Slic3r::write_install_state (const boost::filesystem::path &plugin_dir, const PluginDescriptor &entry)
bool Slic3r::read_python_plugin_metadata (const boost::filesystem::path &py_path, PluginDescriptor &descriptor, std::string &error)
bool Slic3r::read_wheel_plugin_metadata (const boost::filesystem::path &whl_path, PluginDescriptor &descriptor, std::string &error)
boost::filesystem::path Slic3r::find_installed_plugin_entry (const boost::filesystem::path &plugin_dir, std::string &error)
std::vector< std::string > Slic3r::collect_resource_texture_files (const std::string &dir, const std::string &plugin_root, std::string &error)

Variables

const char *const Slic3r::INSTALL_STATE_FILE = ".install_state.json"