mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 02:07:54 -06:00
support makerworld.com
This commit is contained in:
parent
9f73c01821
commit
6519e850ef
6 changed files with 53 additions and 85 deletions
|
@ -12,6 +12,7 @@
|
|||
#include <functional>
|
||||
#include <type_traits>
|
||||
#include <system_error>
|
||||
#include <regex>
|
||||
|
||||
#include <boost/system/error_code.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
@ -220,6 +221,24 @@ extern bool is_shapes_dir(const std::string& dir);
|
|||
//BBS: add json support
|
||||
extern bool is_json_file(const std::string& path);
|
||||
|
||||
// Orca: custom protocal support utils
|
||||
inline bool is_orca_open(const std::string& url) { return boost::starts_with(url, "orcaslicer://open"); }
|
||||
inline bool is_prusaslicer_open(const std::string& url) { return boost::starts_with(url, "prusaslicer://open"); }
|
||||
inline bool is_bambustudio_open(const std::string& url) { return boost::starts_with(url, "bambustudio://open"); }
|
||||
inline bool is_cura_open(const std::string& url) { return boost::starts_with(url, "cura://open"); }
|
||||
inline bool is_supported_open_protocol(const std::string& url) { return is_orca_open(url) || is_prusaslicer_open(url) || is_bambustudio_open(url) || is_cura_open(url); }
|
||||
inline bool is_printables_link(const std::string& url) {
|
||||
const std::regex url_regex("(http|https)://printables.com", std::regex_constants::icase);
|
||||
return std::regex_match(url, url_regex);
|
||||
}
|
||||
inline bool is_makerworld_link(const std::string& url) {
|
||||
const std::regex url_regex("(http|https)://makerworld.com", std::regex_constants::icase);
|
||||
return std::regex_match(url, url_regex);
|
||||
}
|
||||
inline bool is_thingiverse_link(const std::string& url) {
|
||||
const std::regex url_regex("(http|https)://www.thingiverse.com", std::regex_constants::icase);
|
||||
return std::regex_match(url, url_regex);
|
||||
}
|
||||
// File path / name / extension splitting utilities, working with UTF-8,
|
||||
// to be published to Perl.
|
||||
namespace PerlUtils {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue