MCPcopy Create free account
hub / github.com/Tencent/tgfx / UUIDToString

Function UUIDToString

src/pdf/PDFMetadataUtils.cpp:233–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233std::string UUIDToString(const UUID& uuid) {
234 // 8-4-4-4-12
235 char buffer[36]; // [32 + 4]
236 char* ptr = buffer;
237 const uint8_t* data = uuid.data.data();
238 Hexify(&data, &ptr, 4);
239 *ptr++ = '-';
240 Hexify(&data, &ptr, 2);
241 *ptr++ = '-';
242 Hexify(&data, &ptr, 2);
243 *ptr++ = '-';
244 Hexify(&data, &ptr, 2);
245 *ptr++ = '-';
246 Hexify(&data, &ptr, 6);
247 DEBUG_ASSERT(ptr == buffer + 36);
248 DEBUG_ASSERT(data == uuid.data.data() + 16);
249 return std::string(buffer, 36);
250}
251
252} // namespace
253

Callers 1

MakeXMPObjectMethod · 0.85

Calls 2

HexifyFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected