16 #define POOL_GUID_CPP 1
22 #include "uuid/uuid.h"
24 static const char*
const fmt_Guid =
25 "%08lX-%04hX-%04hX-%02hhX%02hhX-%02hhX%02hhX%02hhX%02hhX%02hhX%02hhX";
29 clid_null(std::string(
"00000000-0000-0000-0000-000000000000"));
38 ::uuid_generate_time(me_);
39 unsigned int *
d1=(
unsigned int*)me_;
40 unsigned short *
d2=(
unsigned short*)(me_+4);
41 unsigned short *d3=(
unsigned short*)(me_+6);
45 for (
int i=0;
i<8;
i++){
52 ::snprintf(
text, 128, fmt_Guid,
53 static_cast<long unsigned int>(Data1),
55 Data4[0], Data4[1], Data4[2], Data4[3],
56 Data4[4], Data4[5], Data4[6], Data4[7]);
66 long unsigned int xData1;
67 ::sscanf(
source.c_str(), fmt_Guid, &xData1, &Data2, &Data3,
68 &Data4[0], &Data4[1], &Data4[2], &Data4[3], &
d[0], &
d[1], &
d[2], &
d[3]);
71 ::memcpy(Data4+4,
d, 4);
76 return ::memcmp(&
g.Data1, &Data1, 16) < 0;