1 #include <algorithm>
2 #include <cstring>
3 #include "xr_clsid.h"
4 
5 using namespace xray_re;
6 
get(char * s) const7 void xr_clsid::get(char* s) const
8 {
9 	for (const char *p = bytes, *end = p + 8; p != end; ++p) {
10 		int c = *p;
11 		if (c == ' ')
12 			break;
13 		*s++ = c;
14 	}
15 	*s = '\0';
16 }
17 
to_quad(const char * s)18 uint64_t xr_clsid::to_quad(const char* s)
19 {
20 	union {
21 		char		temp[8];
22 		uint64_t	temp64;
23 	};
24 	char* p = temp;
25 	for (char* end = p + std::min(std::strlen(s), sizeof(temp)); p != end; ++p)
26 		*p = *s++;
27 	for (char* end = temp + sizeof(temp); p != end;)
28 		*p++ = ' ';
29 	return temp64;
30 }
31