MCPcopy Create free account
hub / github.com/OpenBoardView/OpenBoardView / ParseHex

Method ParseHex

src/openboardview/confparse.cpp:382–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380}
381
382uint32_t Confparse::ParseHex(const char *key, uint32_t defaultv) {
383 char *p = Parse(key);
384 if (p) {
385 uint32_t v;
386 if ((*p == '0') && (*(p + 1) == 'x')) {
387 p += 2;
388 }
389 v = strtoul(p, NULL, 16);
390 if (errno == ERANGE)
391 return defaultv;
392 else
393 return v;
394 } else
395 return defaultv;
396}
397
398double Confparse::ParseDouble(const char *key, double defaultv) {
399 char *p = Parse(key);

Callers 1

readFromConfigMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected