mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-02-07 04:11:50 +03:00
update libslic3r
This commit is contained in:
@@ -943,6 +943,34 @@ __finished:
|
||||
#endif
|
||||
}
|
||||
|
||||
bool copy_framework(const std::string &from, const std::string &to)
|
||||
{
|
||||
boost::filesystem::path src(from), dst(to);
|
||||
try {
|
||||
if (!boost::filesystem::is_directory(src)) {
|
||||
std::cerr << "Error: Source is not a directory: " << src << std::endl;
|
||||
return false;
|
||||
}
|
||||
boost::filesystem::create_directories(dst);
|
||||
for (boost::filesystem::directory_iterator it(src); it != boost::filesystem::directory_iterator(); ++it) {
|
||||
const auto &entry = it->path();
|
||||
const auto dest_path = dst / entry.filename();
|
||||
|
||||
if (boost::filesystem::is_symlink(entry)) {
|
||||
boost::filesystem::copy_symlink(entry, dest_path);
|
||||
} else if (boost::filesystem::is_directory(entry)) {
|
||||
copy_framework(it->path().string(), dest_path.string());
|
||||
} else {
|
||||
boost::filesystem::copy(entry, dest_path, boost::filesystem::copy_options::overwrite_existing);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} catch (const boost::filesystem::filesystem_error &e) {
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "Filesystem error: " << e.what();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
CopyFileResult check_copy(const std::string &origin, const std::string ©)
|
||||
{
|
||||
boost::nowide::ifstream f1(origin, std::ifstream::in | std::ifstream::binary | std::ifstream::ate);
|
||||
@@ -1089,6 +1117,18 @@ std::string normalize_utf8_nfc(const char *src)
|
||||
return boost::locale::normalize(src, boost::locale::norm_nfc, locale_utf8);
|
||||
}
|
||||
|
||||
std::vector<std::string> split_string(const std::string &str, char delimiter)
|
||||
{
|
||||
std::vector<std::string> result;
|
||||
std::stringstream ss(str);
|
||||
std::string substr;
|
||||
|
||||
while (std::getline(ss, substr, delimiter)) {
|
||||
result.push_back(substr);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
namespace PerlUtils {
|
||||
// Get a file name including the extension.
|
||||
std::string path_to_filename(const char *src) { return boost::filesystem::path(src).filename().string(); }
|
||||
|
||||
Reference in New Issue
Block a user