wchar_t* ON_UuidToString( const ON_UUID& uuid, wchar_t* s) { // s - [out] The s[] char array must have length >= 37. // The returned char array will have a 36 // character uuid in s[0..35] and a null in s[36]. // NOTE WELL: // This code has to work on non-Windows OSs and on both big and // little endian CPUs. The result must satisfy // uuid == ON_UuidFromString(ON_UuidToString(uuid,s)) char x[37]; if ( s && ON_UuidToString(uuid,x) ) { int i; for (i = 0; i < 37; i++ ) { s[i] = (wchar_t)x[i]; } } else { s = 0; } return s; }
CRhinoCommand::result CCommandTestGetData::RunCommand( const CRhinoCommandContext& context ) { CRhinoGetObject go; go.SetCommandPrompt( L"Select object" ); go.GetObjects( 1, 1 ); if( go.CommandResult() != CRhinoCommand::success ) return go.CommandResult(); const CRhinoObject* object = go.Object(0).Object(); if( 0 == object ) return CRhinoCommand::failure; ON_UUID object0_uuid, object1_uuid; if( AssociationData::GetData(object, object0_uuid, object1_uuid) ) { ON_wString object0_str, object1_str; ON_UuidToString( object0_uuid, object0_str ); ON_UuidToString( object1_uuid, object1_str ); RhinoApp().Print( L"Object0 = %s\n", object0_str ); RhinoApp().Print( L"Object1 = %s\n", object1_str ); } return CRhinoCommand::success; }
const wchar_t* ON_UuidToString( const ON_UUID& uuid, ON_wString& s ) { wchar_t x[37]; s = ON_UuidToString( uuid, x ); return s.Array(); }
const char* ON_UuidToString( const ON_UUID& uuid, ON_String& s ) { char x[37]; s = ON_UuidToString( uuid, x ); return s.Array(); }