File Format Technical Guide

Reading Data Types

Data within a .brf file is stored using a variety of data types. Here's a quick reference to the abbreviations you will see used below:

arbstring - an int32 length header followed by a string of raw text the length specified
string# - a string of raw text # bytes in length
float32 - a 32-bit binary floating point number (single precision) - four bytes
float64 - a 64-bit binary floating point number (double precision) - eight bytes
int32 - a 32-bit binary integer number - four bytes

All binary numbers are standard x86 little-endian; thus, the int32 representation of 12 is 0C 00 00 00.

File Contents

.brf files consist of six main sections: header, sources, authors, impacts, evidence, and images. All elements in the file, including these sections, are run directly together with no breaks (separators are not necessary since the length of each field is either predetermined or specified by the file.)

Below is a complete listing of the contents of a brief:

Header
FSB (string3)
Factsmith version (float32)
Save date/time (float64)
XDF (arbstring)
Author (arbstring)
Club (arbstring)
Region (arbstring)
Brief Information field (arbstring)

Sources
Number of sources (int32)

Repeated for each source:

unused, reserved (arbstring)
URL (arbstring)
Title (arbstring)
Source type (arbstring)
Date (arbstring)
Organization (arbstring)
Publication (arbstring)
Volume/Issue (arbstring)
Raw text (for text-only sources) (arbstring)
Authors (arbstring)

Authors
Number of authors (int32)

Repeated for each author:

Name (arbstring)
Credentials (arbstring)
Credentials URL (arbstring)

Impacts
Number of impacts (int32)

Repeated for each impact:

Impact (arbstring)

Evidence
Number of evidence cards (int32)

Repeated for each card:

Source ID (arbstring)
Tagline (arbstring)
Evidence body (arbstring)
Category (arbstring)
Quality (arbstring)
Page (arbstring)
Impact (arbstring)
Summary (arbstring)

Images
Number of images (int32)

Repeated for each image:

Image data, as PNG (arbstring)


Notes and Details

Source linkage: The first field of each card (Source ID) is the ID of the source the card uses, in ASCII, starting from 1. For example, evidence with the Source ID 2 would be linked to the second source stored in the file.

Author linkage: The Authors field of each source lists the IDs of the authors the source uses, in ASCII. Each ID is followed by the character x01 (character 1). Author IDs start from 1; for example, a source with the Authors field (hex) 02 01 06 01 (author IDs 2 and 6) is linked to the second and sixth authors stored in the file.

Source types: The fourth field of each source (Source type) has two options: the ASCII number 1, which indicates that the source is plain text only (using field 9, Raw text); or the ASCII number 2, which indicates that the source uses the standard multi-field view. In either case, all the data in the fields is preserved, even if it is not used.

Access dates: For maximum compatability, access dates are stored inside the regular date field, in the format: REGULARDATE, accessed ACCESSDATE

Images: In the brief itself, images are referenced with <img#> tags in the evidence body, where # is the index of the image in the image table (starting from 1.) Note that image support was added in v1.3; files saved with previous versions will not include the image table. Some entries on the image table may have no data (if the image at that index was discarded.)


XDF Contents

The XDF (eXtensible Data Field) is used to help maintain forward-compatability; it functions as a standard arbstring that contains additional fields. This allows fields to be added without breaking file-type compability with older versions of Factsmith, which just ignore any internal fields they don't understand. Here is a listing of the contents of the XDF as of Factsmith 1.5:

Revision counter - number of times the file has been saved (int32)