Subject: [ruby-ffi] Using enums in InlineArray |
From: edek |
Date: 12/6/10 10:52 AM |
To: ruby-ffi |
Hi, in my project I've got complex structure, that contains an array of enums. So I define named enum type and pass it to my struct layout. This structure is referenced in another structure. When I read my structure, FFI automatically creates object of type FFI::Struct::InlineArray. Unfortunately, when I try to read its contents I got following error: `each': get not supported for FFI::Enum (ArgumentError) It works well when I switch type to :uint32 - I can read integers. Is there any way to use enums in this place? That would be obviously much more ellegant. If it is not supported yet, could you give me any advice where I can extend FFI's functionality in this matter? Thank you, Marcin