1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 11:19:10 +00:00

Remove all uses of GuidToString.

This commit is contained in:
Darryl Pogue
2012-12-15 21:33:14 -08:00
parent 517d4f6788
commit 274812c057
18 changed files with 34 additions and 84 deletions

View File

@ -57,7 +57,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <uuid/uuid.h>
COMPILER_ASSERT(sizeof(Uuid) >= sizeof(uuid_t));
static_assert(sizeof(Uuid) >= sizeof(uuid_t), "UUID size does not match uuid_t");
#else

View File

@ -147,30 +147,4 @@ bool GuidIsNil (const Uuid & uuid) {
return 1 == UuidIsNil((GUID *)&uuid, &s );
}
//============================================================================
const wchar_t * GuidToString (const Uuid & uuid, wchar_t * dst, unsigned chars) {
wchar_t * src;
RPC_STATUS s;
s = UuidToStringW( (GUID *) &uuid, (unsigned short**)&src );
if (RPC_S_OK == s)
StrCopy(dst, src, chars);
else
StrCopy(dst, L"", chars);
RpcStringFreeW( (unsigned short**)&src );
return dst;
}
//============================================================================
const char * GuidToString (const Uuid & uuid, char * dst, unsigned chars) {
uint8_t * src;
RPC_STATUS s;
s = UuidToStringA( (GUID *) &uuid, &src );
if (RPC_S_OK == s)
StrCopy(dst, (char *)src, chars);
else
StrCopy(dst, "", chars);
RpcStringFreeA(&src);
return dst;
}
#endif // HS_BUILD_FOR_WIN32

View File

@ -64,17 +64,3 @@ Uuid::Uuid (const wchar_t str[]) {
GuidFromString(str, this);
}
//============================================================================
Uuid::Uuid (const uint8_t buf[], unsigned length) {
GuidFromHex(buf, length, this);
}
//============================================================================
bool GuidFromHex (const uint8_t buf[], unsigned length, Uuid * uuid) {
ASSERT(length == sizeof(uuid->data));
memcpy(uuid->data, buf, sizeof(uuid->data));
return true;
}

View File

@ -80,9 +80,6 @@ bool GuidFromString (const char str[], Uuid * uuid);
int GuidCompare (const Uuid & a, const Uuid & b);
inline bool GuidsAreEqual (const Uuid & a, const Uuid & b) { return 0 == GuidCompare(a, b); }
bool GuidIsNil (const Uuid & uuid);
const wchar_t * GuidToString (const Uuid & uuid, wchar_t * dst, unsigned chars); // returns dst
const char * GuidToString (const Uuid & uuid, char * dst, unsigned chars); // returns dst
bool GuidFromHex (const uint8_t buf[], unsigned length, Uuid * uuid);
/*****************************************************************************
@ -100,7 +97,6 @@ struct Uuid {
Uuid () {}
Uuid (const wchar_t str[]);
Uuid (const uint8_t buf[], unsigned length);
operator bool () const { return !GuidIsNil(*this); }
inline bool operator ! () const { return GuidIsNil(*this); }
inline bool operator < (const Uuid & rhs) const { return GuidCompare(*this, rhs) < 0; }