MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / _parse_quadhex

Function _parse_quadhex

libraries/AP_JSON/AP_JSON.cpp:468–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466};
467
468template <typename Iter> int _parse_quadhex(input<Iter> &in)
469{
470 int uni_ch = 0, hex;
471 for (int i = 0; i < 4; i++) {
472 if ((hex = in.getc()) == -1) {
473 return -1;
474 }
475 if ('0' <= hex && hex <= '9') {
476 hex -= '0';
477 } else if ('A' <= hex && hex <= 'F') {
478 hex -= 'A' - 0xa;
479 } else if ('a' <= hex && hex <= 'f') {
480 hex -= 'a' - 0xa;
481 } else {
482 in.ungetc();
483 return -1;
484 }
485 uni_ch = uni_ch * 16 + hex;
486 }
487 return uni_ch;
488}
489
490template <typename String, typename Iter> bool _parse_string(String &out, input<Iter> &in)
491{

Callers

nothing calls this directly

Calls 2

getcMethod · 0.80
ungetcMethod · 0.80

Tested by

no test coverage detected