# FixNative Documentation

Back to summary

`import "native/native";`

## StructLayout class

This class computes native layout of a struct.

Subclasses: UnionLayout

### Initialization

`static function create(): StructLayout`
  Creates a new struct layout.

### Properties

`function get_size(): Integer`
  Returns the size of struct in bytes.
`function get_align(): Integer`
  Returns the alignment of the struct in bytes.

### Definition

`function add_byte(): Integer
function add_short(): Integer
function add_int(): Integer
function add_long(): Integer
function add_float(): Integer
function add_double(): Integer
function add_pointer(): Integer
function add_nlong(): Integer
function add_struct(struct: StructLayout): Integer
function add_struct(size: Integer, align: Integer): Integer
`
  Adds a field of given type.
`function add_byte_array(len: Integer): Integer
function add_short_array(len: Integer): Integer
function add_int_array(len: Integer): Integer
function add_long_array(len: Integer): Integer
function add_float_array(len: Integer): Integer
function add_double_array(len: Integer): Integer
function add_pointer_array(len: Integer): Integer
function add_nlong_array(len: Integer): Integer
function add_struct_array(struct: StructLayout, len: Integer): Integer
function add_struct_array(size: Integer, align: Integer, len: Integer): Integer
`
  Adds an embedded array of given type.