Objects: Ensure string template objects return the right size.

This commit is contained in:
Mike Auty
2020-01-13 01:41:57 +00:00
parent 3977a3c356
commit 0f49673aa0
+7
View File
@@ -254,6 +254,13 @@ class String(PrimitiveObject, str):
value = value[:value.find('\x00')]
return value
class VolTemplateProxy(interfaces.objects.ObjectInterface.VolTemplateProxy):
@classmethod
def size(cls, template: interfaces.objects.Template) -> int:
"""Returns the size of the templated object."""
return template.vol.max_length
class Pointer(Integer):
"""Pointer which points to another object."""