OrcaSlicer latest
OrcaSlicer
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)
126{
127 std::string ret_val = escape_string(path.filename().string());
128 boost::filesystem::path parent(path.parent_path());
129 while (!parent.empty() && parent.string() != "/") // "/" check is for case "/file.gcode" was inserted. Then boost takes "/" as parent_path.
130 {
131 ret_val = escape_string(parent.filename().string()) + "/" + ret_val;
132 parent = parent.parent_path();
133 }
134 return ret_val;
135}
std::string escape_string(const std::string &unescaped)
Definition OctoPrint.cpp:111

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)
112{
113 std::string ret_val;
114 CURL* curl = curl_easy_init();
115 if (curl) {
116 char* decoded = curl_easy_escape(curl, unescaped.c_str(), unescaped.size());
117 if (decoded) {
118 ret_val = std::string(decoded);
119 curl_free(decoded);
120 }
121 curl_easy_cleanup(curl);
122 }
123 return ret_val;
124}

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: