MCPcopy Create free account
hub / github.com/bmorcelli/Launcher / encodeQueryValue

Function encodeQueryValue

src/onlineLauncher.cpp:584–598  ·  view source on GitHub ↗

** Function name: GetJsonFromLauncherHub ** Description: Gets JSON from github server ***************************************************************************************/

Source from the content-addressed store, hash-verified

582** Description: Gets JSON from github server
583***************************************************************************************/
584String encodeQueryValue(const String &value) {
585 String encoded;
586 for (size_t i = 0; i < value.length(); ++i) {
587 char c = value[i];
588 if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') || c == '-' ||
589 c == '_' || c == '.' || c == '~') {
590 encoded += c;
591 } else {
592 char hex[4];
593 snprintf(hex, sizeof(hex), "%%%02X", static_cast<unsigned char>(c));
594 encoded += hex;
595 }
596 }
597 return encoded;
598}
599
600bool GetJsonFromLauncherHub(uint8_t page, String order, bool star, String query) {
601 String q = "&order_by=" + order;

Callers 2

GetJsonFromLauncherHubFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected