!XT (BREAK-16) (Sandbox) Remove double-newlines at the end of files.
[CRYENGINE.git] / Code / Sandbox / EditorQt / Include / Serialization / GUID.h
blob74b1ceb71349930fd5fb980569d062b856b2126c
1 // Copyright 2001-2018 Crytek GmbH / Crytek Group. All rights reserved.
3 #pragma once
4 #include <CrySerialization/IArchive.h>
5 #include <CrySerialization/STL.h>
7 // FIXME: this should be replaced by CryGUID instead of using Windows-specific type
8 // from guiddef.h
9 #ifndef GUID_DEFINED
10 #define GUID_DEFINED
11 typedef struct _GUID
13 unsigned long Data1;
14 unsigned short Data2;
15 unsigned short Data3;
16 unsigned char Data4[8];
17 } GUID;
18 #endif
19 // ^^^^
21 #include <CryCore/ToolsHelpers/GuidUtil.h>
23 inline bool Serialize(Serialization::IArchive& ar, GUID& guid, const char* name, const char* label)
25 string str = GuidUtil::ToString(guid);
26 if (!ar(str, name, label))
27 return false;
28 if (ar.isInput())
29 guid = GuidUtil::FromString(str.c_str());
30 return true;