Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::anonymous_namespace{OctoPrint.cpp} Namespace Reference

Functions

std::string escape_string (const std::string &unescaped)
 
std::string escape_path_by_element (const boost::filesystem::path &path)
 

Function Documentation

◆ escape_path_by_element()

std::string Slic3r::anonymous_namespace{OctoPrint.cpp}::escape_path_by_element ( const boost::filesystem::path &  path)
147{
148 std::string ret_val = escape_string(path.filename().string());
149 boost::filesystem::path parent(path.parent_path());
150 while (!parent.empty() && parent.string() != "/") // "/" check is for case "/file.gcode" was inserted. Then boost takes "/" as parent_path.
151 {
152 ret_val = escape_string(parent.filename().string()) + "/" + ret_val;
153 parent = parent.parent_path();
154 }
155 return ret_val;
156}
std::string escape_string(const std::string &unescaped)
Definition OctoPrint.cpp:132

References escape_path_by_element(), and escape_string().

Referenced by escape_path_by_element().

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

◆ escape_string()

std::string Slic3r::anonymous_namespace{OctoPrint.cpp}::escape_string ( const std::string &  unescaped)
133{
134 std::string ret_val;
135 CURL* curl = curl_easy_init();
136 if (curl) {
137 char* decoded = curl_easy_escape(curl, unescaped.c_str(), unescaped.size());
138 if (decoded) {
139 ret_val = std::string(decoded);
140 curl_free(decoded);
141 }
142 curl_easy_cleanup(curl);
143 }
144 return ret_val;
145}

References escape_string().

Referenced by escape_path_by_element(), and escape_string().

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