OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::Update Struct Reference
Collaboration diagram for Slic3r::Update:

Public Member Functions

 Update ()
 Update (fs::path &&source, fs::path &&target, const Version &version, std::string vendor, std::string changelog, std::string description, bool forced=false, bool is_dir=false)
 Update (fs::path &&source, fs::path &&target, const Version &version, std::string vendor, std::string changelog, std::string description, std::function< bool(const std::string)> file_filter, bool forced=false, bool is_dir=false)
void install () const

Public Attributes

fs::path source
fs::path target
Version version
std::string vendor
std::string change_log
std::string descriptions
std::function< bool(const std::string)> file_filter
bool forced_update
bool is_directory {false}
bool is_opc {false}

Friends

std::ostream & operator<< (std::ostream &os, const Update &self)

Detailed Description

Constructor & Destructor Documentation

◆ Update() [1/3]

Slic3r::Update::Update ( )
inline
116{}

Referenced by operator<<.

Here is the caller graph for this function:

◆ Update() [2/3]

Slic3r::Update::Update ( fs::path && source,
fs::path && target,
const Version & version,
std::string vendor,
std::string changelog,
std::string description,
bool forced = false,
bool is_dir = false )
inline
120 : source(std::move(source))
121 , target(std::move(target))
123 , vendor(std::move(vendor))
124 , change_log(std::move(changelog))
125 , descriptions(std::move(description))
126 , forced_update(forced)
127 , is_directory(is_dir)
128 {}
bool forced_update
Definition PresetUpdater.cpp:110
fs::path source
Definition PresetUpdater.cpp:99
fs::path target
Definition PresetUpdater.cpp:100
std::string change_log
Definition PresetUpdater.cpp:105
std::string vendor
Definition PresetUpdater.cpp:103
bool is_directory
Definition PresetUpdater.cpp:112
Version version
Definition PresetUpdater.cpp:102
std::string descriptions
Definition PresetUpdater.cpp:106

References change_log, descriptions, forced_update, is_directory, source, target, vendor, and version.

◆ Update() [3/3]

Slic3r::Update::Update ( fs::path && source,
fs::path && target,
const Version & version,
std::string vendor,
std::string changelog,
std::string description,
std::function< bool(const std::string)> file_filter,
bool forced = false,
bool is_dir = false )
inline
131 : source(std::move(source))
132 , target(std::move(target))
134 , vendor(std::move(vendor))
135 , change_log(std::move(changelog))
136 , descriptions(std::move(description))
138 , forced_update(forced)
139 , is_directory(is_dir)
140 {}
std::function< bool(const std::string)> file_filter
Definition PresetUpdater.cpp:108

References change_log, descriptions, file_filter, forced_update, is_directory, source, target, vendor, and version.

Member Function Documentation

◆ install()

void Slic3r::Update::install ( ) const
inline
144 {
145 if (is_directory) {
147 } else {
149
150 // A vendor must be installed in exactly one form. Remove the
151 // representation that would otherwise be stale or shadow this one.
152 boost::system::error_code ec;
153 if (is_opc) {
154 fs::remove(target.parent_path() / (vendor + ".json"), ec);
155 ec.clear();
156 fs::remove_all(target.parent_path() / vendor, ec);
157 }
158 else {
159 fs::remove(target.parent_path() / (vendor + ".opc"), ec);
160 }
161 }
162 }
void copy_directory_recursively(const boost::filesystem::path &source, const boost::filesystem::path &target, std::function< bool(const std::string)> filter, bool merge_mode)
Definition utils.cpp:1924
void copy_file_fix(const fs::path &source, const fs::path &target)
Definition PresetUpdater.cpp:79
bool is_opc
Definition PresetUpdater.cpp:114

References Slic3r::copy_directory_recursively(), Slic3r::copy_file_fix(), file_filter, is_directory, is_opc, source, target, and vendor.

Here is the call graph for this function:

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const Update & self )
friend
165 {
166 os << "Update(" << self.source.string() << " -> " << self.target.string() << ')';
167 return os;
168 }

References Update(), source, and target.

Member Data Documentation

◆ change_log

std::string Slic3r::Update::change_log

Referenced by Update(), and Update().

◆ descriptions

std::string Slic3r::Update::descriptions

Referenced by Update(), and Update().

◆ file_filter

std::function<bool(const std::string)> Slic3r::Update::file_filter

Referenced by Update(), and install().

◆ forced_update

bool Slic3r::Update::forced_update

Referenced by Update(), and Update().

◆ is_directory

bool Slic3r::Update::is_directory {false}
112{false};

Referenced by Update(), Update(), and install().

◆ is_opc

bool Slic3r::Update::is_opc {false}
114{false};

Referenced by install().

◆ source

fs::path Slic3r::Update::source

Referenced by Update(), Update(), install(), and operator<<.

◆ target

fs::path Slic3r::Update::target

Referenced by Update(), Update(), install(), and operator<<.

◆ vendor

std::string Slic3r::Update::vendor

Referenced by Update(), Update(), and install().

◆ version

Version Slic3r::Update::version

Referenced by Update(), and Update().


The documentation for this struct was generated from the following file: