MCPcopy Create free account
hub / github.com/couchbase/fleece / hex_digit_value

Method hex_digit_value

Fleece/Support/diff_match_patch.hh:2459–2480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2457 }
2458
2459 static unsigned hex_digit_value(char_t c) {
2460 switch (traits::to_wchar(c))
2461 {
2462 case L'0': return 0;
2463 case L'1': return 1;
2464 case L'2': return 2;
2465 case L'3': return 3;
2466 case L'4': return 4;
2467 case L'5': return 5;
2468 case L'6': return 6;
2469 case L'7': return 7;
2470 case L'8': return 8;
2471 case L'9': return 9;
2472 case L'A': case L'a': return 0xA;
2473 case L'B': case L'b': return 0xB;
2474 case L'C': case L'c': return 0xC;
2475 case L'D': case L'd': return 0xD;
2476 case L'E': case L'e': return 0xE;
2477 case L'F': case L'f': return 0xF;
2478 }
2479 throw string_t(string_t(traits::cs(L"Invalid character: ")) + c);
2480 }
2481
2482 static void percent_decode(string_t& str) {
2483 typename string_t::iterator s2 = str.begin(), s3 = s2, s4 = s2;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected