Add an SDBasic type for ResourceId.

* This type is core enum and used globally (not API specific) that it
  merits becoming a specific structured data type
This commit is contained in:
baldurk
2018-02-15 10:21:52 +00:00
parent a1c104f6f8
commit 64406b47a3
9 changed files with 109 additions and 71 deletions
+2 -2
View File
@@ -682,8 +682,7 @@ void addStructuredObjects(RDTreeWidgetItem *parent, const StructuredObjectList &
// that for the best raw structured data representation instead of flattening those out to just
// "ResourceId", and we also don't want to store two types ('fake' and 'real'), so instead we
// check the custom string.
if((obj->type.flags & SDTypeFlags::HasCustomString) &&
!strncmp(obj->data.str.c_str(), "ResourceId", 10))
if(obj->type.basetype == SDBasic::ResourceId)
{
ResourceId id;
static_assert(sizeof(id) == sizeof(obj->data.basic.u), "ResourceId is no longer uint64_t!");
@@ -715,6 +714,7 @@ void addStructuredObjects(RDTreeWidgetItem *parent, const StructuredObjectList &
case SDBasic::Null: param = lit("NULL"); break;
case SDBasic::Buffer: param = lit("(%1 bytes)").arg(obj->type.byteSize); break;
case SDBasic::String: param = obj->data.str; break;
case SDBasic::ResourceId:
case SDBasic::Enum:
case SDBasic::UnsignedInteger: param = Formatter::Format(obj->data.basic.u); break;
case SDBasic::SignedInteger: param = Formatter::Format(obj->data.basic.i); break;