Rename 'ResourceId' structured data type to just 'Resource'

This commit is contained in:
baldurk
2018-02-24 23:21:04 +00:00
parent 4ee9443f52
commit 3fe8ad4e3f
6 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -682,7 +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.basetype == SDBasic::ResourceId)
if(obj->type.basetype == SDBasic::Resource)
{
ResourceId id;
static_assert(sizeof(id) == sizeof(obj->data.basic.u), "ResourceId is no longer uint64_t!");
@@ -714,7 +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::Resource:
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;
+4 -4
View File
@@ -82,7 +82,7 @@ DOCUMENT(R"(The basic irreducible type of an object. Every other more complex ty
A single byte character. Wide/multi-byte characters are not supported (these would be stored as a
string with 1 character and multiple bytes in UTF-8).
.. data:: ResourceId
.. data:: Resource
A ResourceId. Equivalent to (and stored as) an 8-byte unsigned integer, but specifically contains
the unique Id of a resource in a capture.
@@ -101,7 +101,7 @@ enum class SDBasic : uint32_t
Float,
Boolean,
Character,
ResourceId,
Resource,
};
DECLARE_REFLECTION_ENUM(SDBasic);
@@ -395,7 +395,7 @@ struct SDObject
case SDBasic::Enum:
case SDBasic::UnsignedInteger: return QVariant(qulonglong(data.basic.u));
case SDBasic::SignedInteger: return QVariant(qlonglong(data.basic.i));
case SDBasic::ResourceId: return (QVariant)data.basic.id;
case SDBasic::Resource: return (QVariant)data.basic.id;
case SDBasic::Float: return data.basic.d;
case SDBasic::Boolean: return data.basic.b;
case SDBasic::Character: return data.basic.c;
@@ -545,7 +545,7 @@ DOCUMENT("Make a structured object out of a ResourceId");
inline SDObject *makeSDObject(const char *name, ResourceId val)
{
SDObject *ret = new SDObject(name, "ResourceId");
ret->type.basetype = SDBasic::ResourceId;
ret->type.basetype = SDBasic::Resource;
ret->type.byteSize = 8;
ret->data.basic.id = val;
return ret;
+1 -1
View File
@@ -48,7 +48,7 @@ std::string DoStringise(const ResourceId &el)
return StringFormat::Fmt("ResourceId::%llu", el);
}
BASIC_TYPE_SERIALISE_STRINGIFY(ResourceId, (uint64_t &)el, SDBasic::ResourceId, 8);
BASIC_TYPE_SERIALISE_STRINGIFY(ResourceId, (uint64_t &)el, SDBasic::Resource, 8);
INSTANTIATE_SERIALISE_TYPE(ResourceId);
+4 -4
View File
@@ -191,7 +191,7 @@ static void Obj2XML(pugi::xml_node &parent, SDObject &child)
if(child.type.basetype == SDBasic::UnsignedInteger ||
child.type.basetype == SDBasic::SignedInteger || child.type.basetype == SDBasic::Float ||
child.type.basetype == SDBasic::ResourceId)
child.type.basetype == SDBasic::Resource)
{
obj.append_attribute("width") = child.type.byteSize;
}
@@ -241,7 +241,7 @@ static void Obj2XML(pugi::xml_node &parent, SDObject &child)
switch(child.type.basetype)
{
case SDBasic::ResourceId:
case SDBasic::Resource:
case SDBasic::Enum:
case SDBasic::UnsignedInteger: obj.text() = child.data.basic.u; break;
case SDBasic::SignedInteger: obj.text() = child.data.basic.i; break;
@@ -416,7 +416,7 @@ static SDObject *XML2Obj(pugi::xml_node &obj)
}
if(ret->type.basetype == SDBasic::UnsignedInteger || ret->type.basetype == SDBasic::SignedInteger ||
ret->type.basetype == SDBasic::Float || ret->type.basetype == SDBasic::ResourceId)
ret->type.basetype == SDBasic::Float || ret->type.basetype == SDBasic::Resource)
{
ret->type.byteSize = obj.attribute("width").as_uint();
}
@@ -471,7 +471,7 @@ static SDObject *XML2Obj(pugi::xml_node &obj)
switch(ret->type.basetype)
{
case SDBasic::ResourceId:
case SDBasic::Resource:
case SDBasic::Enum:
case SDBasic::UnsignedInteger: ret->data.basic.u = obj.text().as_ullong(); break;
case SDBasic::SignedInteger: ret->data.basic.i = obj.text().as_llong(); break;
+1 -1
View File
@@ -668,7 +668,7 @@ void DoSerialise(SerialiserType &ser, SDObject *el)
}
case SDBasic::Boolean: ser.Serialise("", el->data.basic.b); break;
case SDBasic::Character: ser.Serialise("", el->data.basic.c); break;
case SDBasic::ResourceId: ser.Serialise("", el->data.basic.id); break;
case SDBasic::Resource: ser.Serialise("", el->data.basic.id); break;
case SDBasic::UnsignedInteger:
if(el->type.byteSize == 1)
{
+1 -1
View File
@@ -1352,7 +1352,7 @@ public:
case SDBasic::Null: RDCFATAL("Cannot call SerialiseValue for type %d!", type); break;
case SDBasic::String: RDCFATAL("eString should be specialised!"); break;
case SDBasic::Enum:
case SDBasic::ResourceId:
case SDBasic::Resource:
case SDBasic::UnsignedInteger:
if(byteSize == 1)
current.data.basic.u = (uint64_t)(uint8_t)el;