Re: rawRead using a struct with variable leght

2017-06-07 Thread Era Scarecrow via Digitalmars-d-learn
On Wednesday, 7 June 2017 at 18:31:41 UTC, H. S. Teoh wrote: "Structs" with variable size fields have no direct equivalent in D's type system, so you'll probably have a hard time mapping this directly. What you *could* do, though, is to load the data into a ubyte[] buffer, then create a

Re: rawRead using a struct with variable leght

2017-06-07 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jun 07, 2017 at 06:24:22PM +, ade90036 via Digitalmars-d-learn wrote: > On Monday, 5 June 2017 at 16:30:53 UTC, Era Scarecrow wrote: > > On Monday, 5 June 2017 at 16:04:28 UTC, ade90036 wrote: > > > > > Unfortunately the struct doesn't know at compile time what the > > > size of the

Re: rawRead using a struct with variable leght

2017-06-07 Thread ade90036 via Digitalmars-d-learn
On Monday, 5 June 2017 at 16:30:53 UTC, Era Scarecrow wrote: On Monday, 5 June 2017 at 16:04:28 UTC, ade90036 wrote: Unfortunately the struct doesn't know at compile time what the size of the constant_pool array, or at-least was not able to specify it dynamically. It also won't know ahead

Re: rawRead using a struct with variable leght

2017-06-05 Thread Era Scarecrow via Digitalmars-d-learn
On Monday, 5 June 2017 at 16:04:28 UTC, ade90036 wrote: Unfortunately the struct doesn't know at compile time what the size of the constant_pool array, or at-least was not able to specify it dynamically. It also won't know ahead of time how many fields, methods or attributes you have

rawRead using a struct with variable leght

2017-06-05 Thread ade90036 via Digitalmars-d-learn
Hi everyone, I'm trying out Dland, always been and have been a big fan. So to give it a good run i wanted to create is a java class parser, based on the spec released here. ( https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html.) The class file can be represented in the following