Generic FileFormat Data Types

From Bohemia Interactive Community
Revision as of 06:23, 3 August 2009 by Mikero (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Intro

This is a generic list of data types encountered in all file formats. Not all of which will be used in a specific file format.

They are listed here, rather than repetitive typing in each of file format's documentation.

Endian

Little endian byte order, lsb first for numeric values, text is stored in Big endian byte order.

Data Types

Type Description
byte 8 bit (1 byte)
short 16 bit signed short (2 bytes)
ushort 16 bit unsigned short (2 bytes)
ulong 32 bit unsigned integer (4 bytes)
float 32 bit signed single precision floating point value (4 bytes)
double 64 bit signed single precision floating point value (8 bytes)
asciiz Null terminated (0x00) variable length ascii string
ascii fixed length ascii string(UTF-8)


Note that the use of the word 'int' is bad policy. An int is machine and compiler and language dependent. BI use floats to represent signed values unsigned integers for indexes and string counts.