Commit Graph
73 Commits
Author SHA1 Message Date
Mike Auty efada8a15f Bring relative_child_offset typing in line with practice. 2018-03-23 16:04:03 +00:00
Mike Auty bc8429a2b0 Convert all helper_ properties to get_ methods. 2018-03-09 00:47:00 +00:00
Mike Auty 69ec16ded3 Fix up the signatures for the overloaded __getitem__ method. 2017-12-13 23:21:31 +00:00
Mike Auty f50a0b715d Add in object type-annotations. 2017-12-13 20:48:52 +00:00
Mike Auty f40fae197d Convert to python3.5 syntax (no local type-annotations). 2017-12-13 20:48:52 +00:00
Mike Auty d7d13eb19c Add type annotations to most of the automagic files. 2017-12-13 20:48:52 +00:00
Mike Auty be1ebf03b0 Don't forget the constants import. 2017-11-09 23:16:46 +00:00
Mike Auty 18b84e31a5 Don't forget the constants import. 2017-11-09 23:16:30 +00:00
Mike Auty 042ff5ca25 Use .vol.count for consistency. 2017-10-09 00:19:05 +01:00
Mike Auty 8dc6401ad8 Add in gentle deprecation warnings about non-helper properties to prevent member confusion. 2017-10-08 23:02:13 +01:00
Mike Auty 71cfec18a6 Add commentary around a potential conflict of method with property. 2017-09-20 09:38:28 +01:00
Mike Auty 5261da780b Allow the size of array to be changed (may override an existing count member). 2017-09-18 23:23:23 +01:00
Mike Auty 255228ecb0 Convert to abc (post python-3.3). 2017-09-18 23:22:08 +01:00
Mike Auty c336a39695 Fix up the Char type (struct.unpack returns a bytes, not a string). 2017-08-10 20:44:21 +01:00
Mike Auty d79d428edc Ensure we use the native dictionary for more recent IFF versions (and correct issues with pointers and chars). 2017-06-23 15:44:58 +01:00
Mike Auty 5e15d522bd Remove automatic IDE-inserted attributions.
They weren't consistent and they show just remind me how slowly
I've been getting vol 3 written!  5:S

There's git commits to track all of that stuff if we need it.
2017-05-14 11:40:49 +01:00
Mike Auty 6603e503c5 Rework enumeration access in symbol tables. 2017-02-04 14:46:46 +00:00
Mike Auty 547a3d94bb Fix up the documentation and leave a note about cast accepting short type names. 2017-01-04 22:10:27 +00:00
Mike Auty 7a1fcec1b5 Change subtype to base_type to match the __init__ parameter name. 2016-12-20 08:31:01 +00:00
Mike Auty 1e6911b753 Create appropriate VolTemplateProxy classes for BitField and Enumeration. 2016-12-20 08:29:41 +00:00
Mike Auty a7d3a95ad0 Fix BitFields (and Enumerations) to accept only Integer basetypes and derive from them properly. 2016-12-20 08:25:55 +00:00
Mike Auty 0f548e864c Add in comment in case of mutability trouble in the Struct TemplateProxy. 2016-12-18 20:52:38 +00:00
Mike Auty be075939d2 Remove flags as a fully-fledged object until it's been discussed 2016-12-18 19:38:05 +00:00
Mike Auty 190bcd7bf1 Include an initial flags object.
This might get removed, given it could be achieve with a wrapper rather
than a fully defined Object.
2016-12-18 16:29:19 +00:00
Mike Auty 54678823f8 Refactor BitField subtype to base_type to match enums (and fix a minor enum typo too). 2016-12-18 16:12:08 +00:00
Mike Auty 45d37bb961 Remove misleading TODO. 2016-12-18 15:52:03 +00:00
Mike Auty efad3362db Reset the string encoding changes, since we were doing it right the first time. 2016-12-18 15:51:27 +00:00
Mike Auty e4905febf9 Ensure all objects can be inherited from. 2016-12-18 15:38:11 +00:00
Mike Auty 6102054bb6 Enable string encoding and emphasize that max_length applies to bytes in memory not to number of characters in the string. 2016-12-18 15:37:05 +00:00
Mike Auty fbb66e6603 Support inverse caching of enumerations. 2016-12-18 02:10:54 +00:00
Mike Auty 4ac682fc42 Rename Enumeration subtype to base_type, since it should always be a primitive. 2016-12-18 02:07:11 +00:00
Mike Auty 884e397836 Update Enumeration objects again, hopefully correctly this time. 2016-12-15 23:04:51 +00:00
Mike Auty bf61357ed2 Don't forget to call super's struct_format. 2016-12-15 09:06:05 +00:00
Mike Auty de58df2363 Fix negation flip that returned entirely the wrong values for arrays. 2016-12-15 02:07:25 +00:00
Mike Auty d3f6a40d66 Change the docstrings to use name rather than entry for enumerations. 2016-12-15 02:07:03 +00:00
Mike Auty de18fe234c Add in an implementation for Enumeration for testing. 2016-12-15 02:02:30 +00:00
Mike Auty b686c65c9e Rework array slicing to piggy-back off python's code. 2016-12-14 23:26:31 +00:00
Mike Auty 2c02df125a Fix the truncation of strings
MHL kindly pointed out that the string wasn't truncating, and it turns
out I misread the struct documentation, which truncates or pads with
\x00s to ensure the appropriate length.  We now truncate to the first
null we find.
2016-12-13 20:41:09 +00:00
Mike Auty 1f6fcd7bad Ensure that the value of pointers always fall within their layer. 2016-12-07 09:52:33 +00:00
Mike Auty 797e51608e Move the masking code into the data layer. 2016-12-07 09:50:59 +00:00
Mike Auty 6cb5d06d6d Ensure all offsets are normalized to fall within their layer's address range. 2016-12-07 00:07:57 +00:00
Mike Auty 1c7de06bd0 Fix up issue with pointer sizes. Since cls is never used we're not losing information. 2016-12-06 02:44:11 +00:00
Mike Auty e4e563ead0 Fix up the array slicing code. 2016-12-03 00:23:00 +00:00
Mike Auty 667014a1fd Attempt to standardize error message display. 2016-10-30 17:51:45 +00:00
Mike Auty 6b405383c4 Refactor targets to subtypes. 2016-10-26 01:24:58 +01:00
Mike Auty e02feed16e Python 3 has a sane super() implementation (no arguments), so convert to using that. 2016-08-14 00:55:02 +01:00
Mike Auty 34b81a5265 Add in Unions
Since a Union is identical to a Struct (and at the moment a struct
doesn't enforce non-overlapping members), these are identical and a
Union is a descendent of Struct.  If this ever becomes a problem there
is a filthy way to fix it, but it's really bad and will likely cause
more subtle and difficult to diagnose problems.  Stick with inheritance.
2016-05-22 12:03:46 +01:00
Mike Auty 2d23c93def Completely refactor constants and structures to symbols and types. 2016-05-22 11:51:06 +01:00
Mike Auty d7aefdce28 Add a comment explaining why we don't truncate strings on \x00. 2016-02-14 02:50:37 +00:00
Mike Auty 0ef389dec9 Tidy up Bytes and String to require all the appropriate parameters. 2016-02-14 02:49:28 +00:00