DelphiDabbler CodeSnip
File Format Documentation

# Selection Files

## Introduction

CodeSnip uses this file format when it saves the selection / search result set 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 Selections v1 ◄

Immediately following the header line comes a list of information about the snippets included in the saved selection. Each snippet's information occupies a line and is comprised of the snippet name, followed by a tab character, followed by a 0 if the snippet is from the main (on-line) database or a 1 if it is user defined.

Lines are separated by a CR / LF pair.

The header line must be the first line in the file and there must be at least one snippet line. Blank lines are allowed anywhere after the header line and are ignored. However blank lines are not written by the program.

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