65 result.
part1 =
static_cast<uint32_t
>(std::strtoul(aHyphenatedHexString.substr(0, 8).c_str(), 0, 16));
66 result.
part2 =
static_cast<uint16_t
>(std::strtoul(aHyphenatedHexString.substr(9, 4).c_str(), 0, 16));
67 result.
part3 =
static_cast<uint16_t
>(std::strtoul(aHyphenatedHexString.substr(14, 4).c_str(), 0, 16));
68 result.
part4 =
static_cast<uint16_t
>(std::strtoul(aHyphenatedHexString.substr(19, 4).c_str(), 0, 16));
69 uint64_t bytes =
static_cast<uint64_t
>(std::strtoull(aHyphenatedHexString.substr(24, 12).c_str(), 0, 16));
70 for (
size_t i = 0; i <= 5; ++i)
71 result.
part5[i] =
static_cast<uint8_t
>((bytes >> (5 - i) * 8) & 0xFF);
87 inline std::ostream& operator<<(std::ostream& aStream,
const uuid& aId)
89 char oldFill = aStream.fill(
'0');
90 aStream << std::hex << std::uppercase << std::setw(8) << aId.
part1 <<
"-";
91 aStream << std::hex << std::uppercase << std::setw(4) << aId.
part2 <<
"-";
92 aStream << std::hex << std::uppercase << std::setw(4) << aId.
part3 <<
"-";
93 aStream << std::hex << std::uppercase << std::setw(4) << aId.
part4 <<
"-";
94 for (
size_t i = 0; i <= 5; ++i)
95 aStream << std::hex << std::uppercase << std::setw(2) <<
static_cast<uint32_t
>(aId.
part5[i]);
97 aStream.fill(oldFill);