-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create templating system #20
Comments
Some future features to keep in mind when implementing this feature:
|
delet
This
should rather be close to C as possible, so
would be better but i'm uncertain myself so keep this open. |
Deleted second enum declaration, as I agree it's just clutter. I don't want to use # for conditionals because that implies preprocessor, and the if statements that I describe would require live data to evaluate properly. We can hash the specifics of these out in their own issues when this one is complete. |
Template files are C struct-like definitions of a target file's internal structure. Templates should be parsed and made accessable to users in such a way that they can be interacted with like a tree. An example of a template file would look similar to this:
The bare minimum implementation would parse a template file and allow it to be interacted with by the following means:
Field
associated with an offset into the file. Fields should also be capable of representing arrays in template files.Struct
orField
associated with a string identifer (EG: template.get("FILE.header.signature") =Field
object that marks the signature field in the header of the target file)The
Field
andStruct
objects are defined as follows:Struct
: Object that represents a struct in a template file. Should be able to return parent struct, fields/structs that are members of this struct, offset in file, and size.Field
: Object that represents a variable (or data) in the target file. Should be able to return parent struct, type (this should be linked to typesystem, but can just return a string for now), and size. Additionally, it should provide some way to access info about the template array if it is defined as one.Some features that'd be nice to have but aren't required for this issue (we can make them into seperate issues later):
The text was updated successfully, but these errors were encountered: