MCPcopy Create free account
hub / github.com/bdring/FluidNC / uriEncodeGrblCharacters

Function uriEncodeGrblCharacters

FluidNC/src/ProcessSettings.cpp:71–94  ·  view source on GitHub ↗

Replace GRBL realtime characters with the corresponding URI-style escape sequence.

Source from the content-addressed store, hash-verified

69// Replace GRBL realtime characters with the corresponding URI-style
70// escape sequence.
71static std::string uriEncodeGrblCharacters(const char* clear) {
72 std::string escaped;
73 char c;
74 while ((c = *clear++) != '\0') {
75 switch (c) {
76 case '%': // The escape character itself
77 escaped += "%25";
78 break;
79 case '!': // Cmd::FeedHold
80 escaped += "%21";
81 break;
82 case '?': // Cmd::StatusReport
83 escaped += "%3F";
84 break;
85 case '~': // Cmd::CycleStart
86 escaped += "%7E";
87 break;
88 default:
89 escaped += c;
90 break;
91 }
92 }
93 return escaped;
94}
95
96// Replace URI-style escape sequences like %HH with the character
97// corresponding to the hex number HH. This works with any escaped

Callers 1

show_settingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected