MCPcopy Create free account
hub / github.com/audacity/audacity / readByte

Function readByte

libraries/lib-uuid/Uuid.cpp:44–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42namespace
43{
44bool readByte(Uuid::Bytes::iterator& outputIt,
45 std::string::const_iterator& inputIt,
46 const std::string::const_iterator& inputEnd)
47{
48 if (inputIt == inputEnd)
49 return false;
50
51 const char c1 = *inputIt++;
52
53 if (!std::isxdigit(c1))
54 return false;
55
56 if (inputIt == inputEnd)
57 return false;
58
59 const char c2 = *inputIt++;
60
61 if (!std::isxdigit(c2))
62 return false;
63
64 *outputIt = static_cast<uint8_t>((HexCharToNum(c1) << 4) | HexCharToNum(c2));
65
66 ++outputIt;
67
68 return true;
69}
70} // namespace
71
72Uuid::Uuid()

Callers 1

FromStringMethod · 0.85

Calls 1

HexCharToNumFunction · 0.85

Tested by

no test coverage detected