OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp} Namespace Reference

Classes

class  ElegooPrinterWebViewHandler

Functions

DynamicPrintConfig * get_active_printer_config ()
std::string json_string (const json &node, const char *key)
std::string dump_json (const json &node)
boost::filesystem::path path_from_utf8 (const std::string &utf8_path)
std::string filename_to_utf8 (const boost::filesystem::path &path)

Function Documentation

◆ dump_json()

std::string Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::dump_json ( const json & node)
74{
75 return node.dump(-1, ' ', false, json::error_handler_t::replace);
76}

References dump_json().

Referenced by dump_json(), Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::ElegooPrinterWebViewHandler::handle_get_sn_request(), Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::ElegooPrinterWebViewHandler::handle_open_file_dialog_request(), Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::ElegooPrinterWebViewHandler::handle_upload_request(), Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::ElegooPrinterWebViewHandler::on_script_message(), and Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::ElegooPrinterWebViewHandler::send_ipc_message().

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

◆ filename_to_utf8()

std::string Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::filename_to_utf8 ( const boost::filesystem::path & path)
89{
90#ifdef _WIN32
91 const wxString wx_filename(path.filename().c_str());
92 const wxScopedCharBuffer utf8 = wx_filename.ToUTF8();
93 return utf8.data() != nullptr ? std::string(utf8.data()) : std::string();
94#else
95 return path.filename().string();
96#endif
97}
STL namespace.

References filename_to_utf8().

Referenced by filename_to_utf8(), and Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::ElegooPrinterWebViewHandler::handle_upload_request().

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

◆ get_active_printer_config()

DynamicPrintConfig * Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::get_active_printer_config ( )
60{
61 if (wxGetApp().preset_bundle == nullptr)
62 return nullptr;
63
64 return &wxGetApp().preset_bundle->printers.get_edited_preset().config;
65}

References get_active_printer_config().

Referenced by get_active_printer_config(), Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::ElegooPrinterWebViewHandler::handle_get_sn_request(), and Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::ElegooPrinterWebViewHandler::handle_upload_request().

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

◆ json_string()

std::string Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::json_string ( const json & node,
const char * key )
68{
69 auto it = node.find(key);
70 return (it != node.end() && it->is_string()) ? it->get<std::string>() : std::string();
71}

References json_string().

Referenced by Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::ElegooPrinterWebViewHandler::handle_open_file_dialog_request(), Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::ElegooPrinterWebViewHandler::handle_upload_request(), json_string(), and Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::ElegooPrinterWebViewHandler::on_script_message().

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

◆ path_from_utf8()

boost::filesystem::path Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::path_from_utf8 ( const std::string & utf8_path)
79{
80#ifdef _WIN32
81 const wxString wide_path = wxString::FromUTF8(utf8_path.c_str());
82 return boost::filesystem::path(wide_path.ToStdWstring());
83#else
84 return boost::filesystem::path(utf8_path);
85#endif
86}

References path_from_utf8().

Referenced by Slic3r::GUI::anonymous_namespace{PrinterWebViewHandler.cpp}::ElegooPrinterWebViewHandler::handle_upload_request(), and path_from_utf8().

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