language-extensions/R/src/Utilities.cpp
//--------------------------------------------------------------------------------------------------
// Name: Utilities::ConvertGuidToString
//
// Description:
//  Converts a SQLGUID to a string
//
// Returns:
//  string of the guid
//
:ConvertGuidToString
Description:
Converts a SQLGUID to a string

string of the guid
: ConvertGuidToString Description : Converts a SQLGUID to a string string of the guid
string Utilities::ConvertGuidToString(const SQLGUID *guid)
{
	char guidString[37];
	snprintf(guidString, sizeof(guidString) / sizeof(guidString[0]),
		GuidFormat,
		static_cast<unsigned long>(guid->Data1), guid->Data2, guid->Data3,
		guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
		guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]);
	std::string s(guidString);
	return s;
}
string Utilities :: ConvertGuidToString ( const SQLGUID * guid ) { char guidString [ 37 ] ; snprintf ( guidString , sizeof ( guidString ) / sizeof ( guidString [ 0 ] ) , GuidFormat , static_cast < unsigned long > ( guid -> Data1 ) , guid -> Data2 , guid -> Data3 , guid -> Data4 [ 0 ] , guid -> Data4 [ 1 ] , guid -> Data4 [ 2 ] , guid -> Data4 [ 3 ] , guid -> Data4 [ 4 ] , guid -> Data4 [ 5 ] , guid -> Data4 [ 6 ] , guid -> Data4 [ 7 ] ) ; std :: string s ( guidString ) ; return s ; }
Name: Utilities::ConvertGuidToString
Description:
Converts a SQLGUID to a string
Name : Utilities :: ConvertGuidToString Description : Converts a SQLGUID to a string
// 32 hex chars + 4 hyphens + null terminator, so 37 characters. //