MCPcopy Create free account
hub / github.com/AgoraIO/API-Examples / UrlANSI

Function UrlANSI

windows/APIExample/APIExample/stdafx.cpp:373–403  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371
372
373std::string UrlANSI(const char *str)
374{
375 std::string dd;
376 std::string tt = str;
377 size_t len = tt.length();
378 for (size_t i = 0; i < len; i++)
379 {
380 BYTE b = (BYTE)tt.at(i);
381 /*if (isalnum(b)
382 || b == '/'
383 || b == '.'
384 || b == ':')*/
385 if (b >= 0 && b < 127)
386 {
387 char tempbuff[2] = { 0 };
388 sprintf(tempbuff, "%c", (BYTE)tt.at(i));
389 dd.append(tempbuff);
390 }
391 else if (isspace(b))
392 {
393 dd.append("+");
394 }
395 else
396 {
397 char tempbuff[4];
398 sprintf(tempbuff, "%%%X%X", ((BYTE)tt.at(i)) >> 4, ((BYTE)tt.at(i)) % 16);
399 dd.append(tempbuff);
400 }
401 }
402 return dd;
403}
404
405CString getCurrentTime()
406{

Callers

nothing calls this directly

Calls 1

atMethod · 0.45

Tested by

no test coverage detected