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

Functions

std::string convert_studio_language_to_api (std::string lang_code)
std::string normalize_homepage_auth_command (std::string payload)

Function Documentation

◆ convert_studio_language_to_api()

std::string Slic3r::anonymous_namespace{BBLCloudServiceAgent.cpp}::convert_studio_language_to_api ( std::string lang_code)
27{
28 boost::replace_all(lang_code, "_", "-");
29 return lang_code;
30}

References convert_studio_language_to_api().

Referenced by convert_studio_language_to_api().

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

◆ normalize_homepage_auth_command()

std::string Slic3r::anonymous_namespace{BBLCloudServiceAgent.cpp}::normalize_homepage_auth_command ( std::string payload)
33{
34 if (payload.empty()) {
35 return payload;
36 }
37
38 try {
39 auto json = nlohmann::json::parse(payload);
40 if (json.contains("command") && json["command"].is_string()) {
41 std::string command = json["command"].get<std::string>();
42 if (command == "studio_userlogin") {
43 json["command"] = "studio_bambu_userlogin";
44 } else if (command == "studio_useroffline") {
45 json["command"] = "studio_bambu_useroffline";
46 }
47 return json.dump();
48 }
49 } catch (...) {
50 boost::replace_first(payload, "\"command\":\"studio_userlogin\"", "\"command\":\"studio_bambu_userlogin\"");
51 boost::replace_first(payload, "\"command\":\"studio_useroffline\"", "\"command\":\"studio_bambu_useroffline\"");
52 }
53
54 return payload;
55}
nlohmann::json json
Definition AssembleList.cpp:42

References normalize_homepage_auth_command().

Referenced by normalize_homepage_auth_command().

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