DelphiDabbler CodeSnip
File Format Documentation

# Favourites Files

## Introduction

CodeSnip uses this file format when it saves the current user's favourite snippets to disk. The files use a custom format.

## Encoding

This is a simple plain text file format encoded as UTF-8 with byte order mark.

## File Format

The file is introduced by a header line, which must occupy the first line. This line must be:

    ► CodeSnip Favourites v1 ◄

Immediately following the header line comes a list of information about the user's favourite snippets. Information about each favourite occupies a single line. The information comprises three fields, separated by TAB characters. The fields are:

1. Snippet name as a UTF-8 string.
2. A flag indicating whether the snippet is user defined or not. The text "True" indicates a user defined snippet and "False" signifies a snippet from the main database.
3. The date and time the snippet was last accessed. The date information is formatted according to the current locale.

Lines are separated by a CR / LF pair.

If there are no favourites then the file contains only the header line.

Blank lines are permitted anywhere except before the header line. Such lines are ingored.

NOTE: The ► and ◄ characters were chosen for the header line because they encode in a unique way in UTF-8 – ANSI files will not encode them correctly. This provides a second check for the correct file format in addition to the byte order mark.