M
Markus Fischer
Hi,
I'm using the bit-struct [1] (which is just awesome, btw) and wondering
how I can realize arrays of members.
I'm reading binary data from pre-existing files which are based on C
structs which look similar to this basic example:
struct {
int vector[5];
...
} vector_t;
My current solution is to just write:
class Vector < BitStruct
default_options :endian => :little
signed vector_1, 32
signed vector_2, 32
signed vector_3, 32
....
I would prefer to use an array. I couldn't figure out how to do it,
there's no example with it and I start to think it's not possible ... ?
thanks,
- Markus
[1] http://redshift.sourceforge.net/bit-struct/
I'm using the bit-struct [1] (which is just awesome, btw) and wondering
how I can realize arrays of members.
I'm reading binary data from pre-existing files which are based on C
structs which look similar to this basic example:
struct {
int vector[5];
...
} vector_t;
My current solution is to just write:
class Vector < BitStruct
default_options :endian => :little
signed vector_1, 32
signed vector_2, 32
signed vector_3, 32
....
I would prefer to use an array. I couldn't figure out how to do it,
there's no example with it and I start to think it's not possible ... ?
thanks,
- Markus
[1] http://redshift.sourceforge.net/bit-struct/