15 #include "windowsGuid.h"
31 unsigned int data2, data3;
32 unsigned int b1, b2, b3, b4, b5, b6, b7, b8;
33 int result = sscanf(str.c_str(),
34 "%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
35 &data1, &data2, &data3,
36 &b1, &b2, &b3, &b4, &b5, &b6, &b7, &b8);
63 static const int buf_length = 128;
64 char buffer[buf_length];
66 "%08lx-%04hx-%04hx-%02x%02x-%02x%02x%02x%02x%02x%02x",
67 _data1, _data2, _data3,
68 _b1, _b2, _b3, _b4, _b5, _b6, _b7, _b8);
69 nassertr((
int)strlen(buffer) < buf_length,
string());
71 return string(buffer);
void output(ostream &out) const
Outputs a hex representation of the GUID.
bool parse_string(const string &str)
Parses the hex representation in the indicated string and stores it in the WindowsGuid object...
string format_string() const
Returns a hex representation of the GUID.