<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
* CodeSnip File Format Documentation: Configuration Files
*
* $Rev$
* $Date$
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>
CodeSnip File Format Documentation - Configuration Files
</title>
<link
rel="stylesheet"
type="text/css"
media="screen"
href="main.css"
/>
</head>
<body>
<div class="title">
<div>
DelphiDabbler CodeSnip
</div>
<div class="subtitle">
File Format Documentation
</div>
</div>
<h1>
Configuration Files
</h1>
<p class="todo">
<strong>TODO:</strong>
Add list of links to sections of this document and to other related documents.
</p>
<h2>
Introduction
</h2>
<p>
CodeSnip uses two config files – one system wide application file named
<code>Common.config</code> and another per-user file named
<code>User.config</code>. There will be a different one of the latter for each
user account on the system where CodeSnip is used.
</p>
<p>
Config files use the standard .ini file format and are written and read using
Windows API calls.
</p>
<h2>
Encoding
</h2>
<p>
From CodeSnip v4 config files are little endian Unicode text files with a byte
order mark. This encoding is used because the international support is
required and because the Windows API, which is used to read and write the
files, understands this file format.
</p>
<p>
On earlier versions of CodeSnip the config files were ANSI text files using
the system's default encoding. The installer takes care of converting the
older files to Unicode.
</p>
<h2>
File Format
</h2>
<h3>
Common Config File
</h3>
<p>
This file stores information about CodeSnip that is common to all users. There
is just one file named <code>Common.config</code> that is stored in the
<code>%ProgramData%\DelphiDabbler\CodeSnip.4</code> directory.
</p>
<p>
There have been several versions of this file. The current one is version 6.
The change to version 6 came with CodeSnip v4 and the change to Unicode
encoding.
</p>
<p>
The file is in INI file format. It has the following sections.
</p>
<h4>
[Description] section
</h4>
<p>
Describes the current installation.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>Key</strong> (String)
</dt>
<dd>
Unique application ID. String of 32 hex digits.
</dd>
<dt>
<strong>RegCode</strong> (String)
</dt>
<dd>
Registration code. String of 32 hex digits. May be empty string or missing
if application not registered.
</dd>
<dt>
<strong>RegName</strong> (String)
</dt>
<dd>
Name of person who registered program. May be empty string or missing if
application not registered.
</dd>
<dt>
<strong>Version</strong> (String)
</dt>
<dd>
Version of installed program as dotted quad string.
</dd>
</dl>
<h4>
[IniFile] section
</h4>
<p>
Provides information about the config file itself.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>Version</strong> (Integer)
</dt>
<dd>
<div class="half-spaced">
Version number of file. Incremented whenever the config file format
changes. If this section or this value is missing then the default value
is 1. The installer takes care of converting earlier file versions and
stamping config file with the correct version number.
</div>
<div class="half-spaced">
Current value is <strong>6</strong>.
</div>
</dd>
</dl>
<h3>
Per User Config File
</h3>
<p>
This file records configuration information that is unique to each user of the
application. Some sections correspond to user preferences while others record
details of previous operations or the layout of the GUI. The file is named
<code>User.config</code> and is stored in the logged on user's
<code>%AppData%\DelphiDabbler\CodeSnip.4</code> directory.
</p>
<p>
There have been several versions of this file. The current one is version 8.
The change to version 8 came with CodeSnip v4 and the change to Unicode
encoding.</p>
<p>
The file is in INI file format. It has the following sections.
</p>
<h4>
[Cmp:<em>XXX</em>] sections
</h4>
<p>
There is one of these section for each compiler known to CodeSnip. Each
section describes how CodeSnip should use the compiler, or indicates that the
compiler is not available.
</p>
<p>
The actual name of a section is found by replacing <em>XXX</em> with one of
the following values:
</p>
<ul>
<li>
<em>D2</em> – Delphi 2
</li>
<li>
<em>D3</em> – Delphi 3
</li>
<li>
<em>D4</em> – Delphi 4
</li>
<li>
<em>D5</em> – Delphi 5
</li>
<li>
<em>D6</em> – Delphi 6
</li>
<li>
<em>D2005w32</em> – Windows 32 personality of Delphi 2005
</li>
<li>
<em>D2006w32</em> – Windows 32 personality of Delphi 2006
</li>
<li>
<em>D2007</em> – Windows 32 personality of Delphi 2007
</li>
<li>
<em>D2009w32</em> – Windows 32 personality of Delphi 2009
</li>
<li>
<em>D2010</em> – Delphi 2010
</li>
<li>
<em>DXE</em> – Delphi XE
</li>
<li>
<em>DXE2</em> – Delphi XE2
</li>
<li>
<em>FPC</em> – Free Pascal
</li>
</ul>
<p>
Name / Value pairs (same for all sections):
</p>
<dl class="indent">
<dt>
<strong>ExePath</strong> (String)
</dt>
<dd>
Path to compiler. Empty string if compiler not configured.
</dd>
<dt>
<strong>Prefix0</strong> (String)
</dt>
<dd>
Double quoted prefix to text output by the compiler to indicate fatal
compiler errors. If not present the default is "Fatal: ".
</dd>
<dt>
<strong>Prefix1</strong> (String)
</dt>
<dd>
Double quoted prefix to text output by the compiler to indicate standard
compiler errors. If not present the default is "Error: ".
</dd>
<dt>
<strong>Prefix2</strong> (String)
</dt>
<dd>
Double quoted prefix to text output by the compiler to indicate warnings. If
not present the default is "Warning: ".
</dd>
<dt>
<strong>Switches</strong> (String)
</dt>
<dd>
Comma separated list of compiler switches. Empty string value ⇒ use
default switches for compiler. A missing value is the same as an empty
string value.
</dd>
<dt>
<strong>SearchDirCount</strong> (Integer)
</dt>
<dd>
Count of number of search directories configured for compiler.
</dd>
<dt>
<strong>SearchDir<em>XXX</em></strong> (String)
</dt>
<dd>
<div class="half-spaced">
Once entry for each search directory configured for compiler where
<em>XXX</em> ranges from 0 to <strong>SearchDirCount</strong> - 1.
</div>
<div class="half-spaced">
Each entry contains a fully specified directory path.
</div>
</dd>
</dl>
<h4>
[FindCompiler] section
</h4>
<p>
Provides information about the last compiler search that was run.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>D2</strong> (Boolean)
</dt>
<dd>
Indicates whether Delphi 2 was included in search.
</dd>
<dt>
<strong>D3</strong> (Boolean)
</dt>
<dd>
Indicates whether Delphi 3 was included in search.
</dd>
<dt>
<strong>D4</strong> (Boolean)
</dt>
<dd>
Indicates whether Delphi 4 was included in search.
</dd>
<dt>
<strong>D5</strong> (Boolean)
</dt>
<dd>
Indicates whether Delphi 5 was included in search.
</dd>
<dt>
<strong>D6</strong> (Boolean)
</dt>
<dd>
Indicates whether Delphi 6 was included in search.
</dd>
<dt>
<strong>D7</strong> (Boolean)
</dt>
<dd>
Indicates whether Delphi 7 was included in search.
</dd>
<dt>
<strong>D2005w32</strong> (Boolean)
</dt>
<dd>
Indicates whether the Win32 personality of Delphi 2005 was included in
search.
</dd>
<dt>
<strong>D2006w32</strong> (Boolean)
</dt>
<dd>
Indicates whether the Win32 personality of Delphi 2006 was included in
search.
</dd>
<dt>
<strong>D2007</strong> (Boolean)
</dt>
<dd>
Indicates whether the Win32 personality of Delphi 2007 was included in
search.
</dd>
<dt>
<strong>D2009w32</strong> (Boolean)
</dt>
<dd>
Indicates whether the Win32 personality of Delphi 2009 was included in
search.
</dd>
<dt>
<strong>D2010</strong> (Boolean)
</dt>
<dd>
Indicates whether Delphi 2010 was included in search.
</dd>
<dt>
<strong>DXE</strong> (Boolean)
</dt>
<dd>
Indicates whether Delphi XE was included in search.
</dd>
<dt>
<strong>DXE2</strong> (Boolean)
</dt>
<dd>
Indicates whether Delphi XE2 was included in search.
</dd>
<dt>
<strong>FPC</strong> (Boolean)
</dt>
<dd>
Indicates whether Free Pascal was included in search.
</dd>
<dt>
<strong>Option</strong> (Integer)
</dt>
<dd>
Code that describes the kind of compilation result to be searched for: 0
⇒ snippet compiles OK; 1 ⇒ snippet compiles without warnings; 2
⇒ snippet compiles with warning(s); 3 ⇒ snippet fails to compile;
4 ⇒ snippet not tested.
</dd>
<dt>
<dt>
<strong>Logic</strong> (Integer)
</dt>
<dd>
Code that describes search logic to use: 0 ⇒ "and"; 1 ⇒
"or".
</dd>
</dl>
<h4>
[FindText] section
</h4>
<p>
Provides information about last the last text search that was run and records
a history of search terms.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>HistoryCount</strong> (Integer)
</dt>
<dd>
Count of items in search term history.
</dd>
<dt>
<strong>History<em>XXX</em></strong> (String)
</dt>
<dd>
<div class="half-spaced">
One entry for each search term in history where <em>XXX</em> ranges from 0
to <strong>HistoryCount</strong> - 1.
</div>
<div class="half-spaced">
Each entry contains one or more spaced separated search words.
</div>
</dd>
<dt>
<strong>MatchCase</strong> (Boolean)
</dt>
<dd>
One of the search options. Indicates whether searches are case sensitive.
</dd>
<dt>
<strong>WholeWord</strong> (Boolean)
</dt>
<dd>
One of the search options. Indicates whether searches match whole words
only.
</dd>
<dt>
<strong>Logic</strong> (Integer)
</dt>
<dd>
Code that describes search logic to use: 0 ⇒ "and"; 1 ⇒
"or".
</dd>
</dl>
<h4>
[FindXRefs] section
</h4>
<p>
Provides information about the last snippet cross reference search that was
run.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>IncludeRoutine</strong> (Boolean)
</dt>
<dd>
Indicates whether to include the snippet for which the search is being
performed in the search result.
</dd>
<dt>
<strong>Required</strong> (Boolean)
</dt>
<dd>
Indicates whether to include snippets that are required to compile the
selected snippet are included in search result.
</dd>
<dt>
<strong>RequiredRecurse</strong> (Boolean)
</dt>
<dd>
Indicates whether to recurse required snippets to search for required
snippets of each required snippet and so on. Ignored if
<strong>Required</strong> = False.
</dd>
<dt>
<strong>SeeAlso</strong> (Boolean)
</dt>
<dd>
Indicates whether to include snippets that are cross referenced by the
selected snippet in search results.
</dd>
<dt>
<strong>SeeAlsoRecurse</strong> (Boolean)
</dt>
<dd>
Indicates whether to recurse cross-referenced snippets to search for their
own cross references and so on. Ignored if <strong>SeeAlso</strong> = False.
</dd>
</dl>
<h4>
[IniFile] section
</h4>
<p>
Provides information about the config file itself.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>Version</strong> (Integer)
</dt>
<dd>
<div class="half-spaced">
Version number of file. Incremented whenever the config file format
changes. If this section or this value is missing then the default value
is 1. The installer takes care of converting earlier file versions and
stamping config file with the correct version number.
</div>
<div class="half-spaced">
Current value is <strong>8</strong>.
</div>
</dd>
</dl>
<h4>
[MainWindow] section
</h4>
<p>
Records the state and size of the main window and some of its UI controls.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>Left</strong> (Integer)
</dt>
<dd>
Location of left side of window on screen in pixels.
</dd>
<dt>
<strong>Top</strong> (Integer)
</dt>
<dd>
Location of top of window on screen in pixels.
</dd>
<dt>
<strong>Width</strong> (Integer)
</dt>
<dd>
Width of window in pixels.
</dd>
<dt>
<strong>Height</strong> (Integer)
</dt>
<dd>
Height of window in pixels.
</dd>
<dt>
<strong>State</strong> (Integer)
</dt>
<dd>
Value of that describes state of window: 0 ⇒ normal state; 1 ⇒
minimized; 2 ⇒ maximized.
</dd>
<dt>
<strong>SplitterPos</strong> (Integer)
</dt>
<dd>
Position of vertical splitter control in main window, in pixels from left of
window client area.
</dd>
<dt>
<strong>OverviewTab</strong> (Integer)
</dt>
<dd>
Index of selected tab in overview pane.
</dd>
<dt>
<strong>DetailTab</strong> (Integer)
</dt>
<dd>
Unused. Will only be present if this config file was copied from an earlier
config file version by the program installer. This value is neither read nor
written by CodeSnip v4 and later.
</dd>
</dl>
<h4>
[Prefs:CodeGen] section
</h4>
<p>
Stores source code generation preferences. Used in test compilations or when
generating user defined units.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>SwitchOffWarnings</strong> (Boolean)
</dt>
<dd>
Flag indicating whether directives are emitted to switch off specified
warnings.
</dd>
<dt>
<strong>WarningCount</strong> (Integer)
</dt>
<dd>
Number of warnings supported.
</dd>
<dt>
<strong>Warning<em>XXX</em>.Symbol</strong> (String).
</dt>
<dd>
<div class="half-spaced">
One entry for each supported warning where <em>XXX</em> ranges from 0 to
<strong>WarningCount</strong> - 1.
</div>
<div class="half-spaced">
Each entry contains the symbol representing a warning as used in Delphi's
$WARN directive.
</div>
</dd>
<dt>
<strong>Warning<em>XXX</em>.MinCompiler</strong> (Float)
</dt>
<dd>
<div class="half-spaced">
One entry for each supported warning where <em>XXX</em> ranges from 0 to
<strong>WarningCount</strong> - 1.
</div>
<div class="half-spaced">
Records the earliest version of Delphi that supports the warning. This
version number is a decimal value containing compiler version number as
specified by Delphi's <var>CompilerVersion</var> constant. Must be 14.0
(Delphi 6) or higher.
</div>
</dd>
</dl>
<h4>
[Prefs:General] section
</h4>
<p>
Stores general application preferences.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>Units</strong> (Integer)
</dt>
<dd>
A code that records the units of measurement used by the application: 0
⇒ inches; 1 ⇒ millimeters.
</dd>
<dt>
<strong>OverviewStartState</strong> (Integer)
</dt>
<dd>
Code that indicates the desired start state of the overview pane treeview:
0 ⇒ fully expanded; 1 ⇒ fully collapsed.
</dd>
<dt>
<strong>ShowEmptySections</strong> (Boolean)
</dt>
<dd>
Flag that specifies whether empty sections should be displayed in overview
pane. True ⇒ display empty sections; False ⇒ hide empty
sections.
</dd>
<dt>
<strong>ShowNewSnippetsInNewTabs</strong> (Boolean)
</dt>
<dd>
Flag that specifies how newly created snippets and categories are displayed
in detail pane. True ⇒ new tab created for each new item; False ⇒
new items overwrite item in selected tab.
</dd>
</dl>
<h4>
[Prefs:Hiliter] section
</h4>
<p>
Stores preferences that configure the syntax highlighter and record some
information about the custom colours available when configuring the
highlighter.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>FontSize</strong> (Integer)
</dt>
<dd>
Size of highlighter font in points.
</dd>
<dt>
<strong>FontName</strong> (String)
</dt>
<dd>
Name of highlighter font.
</dd>
<dt>
<strong>Elem<em>XXX</em>.Color</strong> (Integer)
</dt>
<dd>
<div class="half-spaced">
One entry for each of the 12 source code elements recognised by the syntax
highlighter. <em>XXX</em> ranges from 0 to 11.
</div>
<div class="half-spaced">
Colour of highlight element. Integer representation of a Delphi
<var>TColor</var> value. If the colour is not specified the value is the
integer representation of clNone.
</div>
</dd>
<dt>
<strong>Elem<em>XXX</em>.Style</strong> (Integer)
</dt>
<dd>
<div class="half-spaced">
One entry for each of the 12 source code elements recognised by the syntax
highlighter. <em>XXX</em> ranges from 0 to 11.
</div>
<div class="half-spaced">
Bitmask representing the font styles used for the highlighter element.
</div>
</dd>
<dt>
<strong>CustomColourCount</strong> (Integer)
</dt>
<dd>
Number of recorded custom colours.
</dd>
<dl>
<strong>CustomColour<em>XXX</em></strong> (String)
</dl>
<dd>
<div class="half-spaced">
One entry for each recorded custom colour, where <em>XXX</em> ranges from
0 to <strong>CustomColourCount</strong> - 1.
</div>
<div class="half-spaced">
The value is a definition of a custom colour in the format used by the
Color dialogue box. This format is <em>ColourID</em>=<em>ColourNum</em>
where <em>ColourID</em> is a value from "ColorA" to
"ColorP" and <em>ColourNum</em> is the hex representation of the
colour.
</div>
</dd>
</dl>
<h4>
[Prefs:News] section
</h4>
<p>
Stores preferences that determine how items from the CodeSnip news feed are
displayed.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>MaxAge</strong> (Integer)
</dt>
<dd>
Maximum age of a news item that can appear in CodeSnip News dialogue box in
days. Default is 92 days.
</dd>
</dl>
<h4>
[Prefs:Printing] section
</h4>
<p>
Stores preferences that determine printing defaults.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>UseColor</strong> (Boolean)
</dt>
<dd>
Flag that indicates whether printing is to be in colour.
</dd>
<dt>
<strong>SyntaxPrint</strong> (Boolean)
</dt>
<dd>
Flag that indicates whether source code in printed output is to be syntax
highlighted.
</dd>
<dt>
<strong>LeftMargin</strong> (Double)
</dt>
<dd>
Size of printed page's left margin in mm.
</dd>
<dt>
<strong>TopMargin</strong> (Double)
</dt>
<dd>
Size of printed page's top margin in mm.
</dd>
<dt>
<strong>RightMargin</strong> (Double)
</dt>
<dd>
Size of printed page's right margin in mm.
</dd>
<dt>
<strong>BottomMargin</strong> (Double)
</dt>
<dd>
Size of printed page's bottom margin in mm.
</dd>
</dl>
<h4>
[Prefs:SourceCode] section
</h4>
<p>
Stores preferences that govern the way source code is stored in exported
documents by default.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>FileType</strong> (Integer)
</dt>
<dd>
Code that determines type of exported files: 0 ⇒ plain text; 1 ⇒
Pascal; 2 ⇒ HTML; 3 ⇒ rich text (RTF).
</dd>
<dt>
<strong>CommentStyle</strong> (Integer)
</dt>
<dd>
Code that determines style of commenting used for documentation of snippets
in output files: 0 ⇒ no documentation comment; 1 ⇒ description of
snippet between prototype and body; 2 ⇒ description of snippet
immediately precedes snippet.
</dd>
<dt>
<strong>UseSyntaxHiliting</strong> (Boolean)
</dt>
<dd>
Flag indicating whether source code is to be syntax highlighted.
</dd>
</dl>
<h4>
[ProxyServer] section
</h4>
<p>
Stores information about any proxy internet server that is to be used.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>UseProxy</strong> (Boolean)
</dt>
<dd>
Flag that indicates whether to use a proxy server or not. If false the
remaining name / value pairs in this section are ignored.
</dd>
<dt>
<strong>IPAddress</strong> (String)
</dt>
<dd>
IP address of proxy server in dotted quad format, e.g. 127.0.0.1.
</dd>
<dt>
<strong>Port</strong> (Integer)
</dt>
<dd>
Port on which to access proxy server.
</dd>
<dt>
<strong>UserName</strong> (String)
</dt>
<dd>
Username for proxy server access. Empty if server doesn't require a user
name.
</dd>
<dt>
<strong>Password</strong> (String)
</dt>
<dd>
Encrypted form of any password required to access proxy server. Empty if no
password is required. This value is a hex representation of the bytes of
the encrypted password.
</dd>
</dl>
<h4>
[UserInfo] section
</h4>
<p>
Stores personal information about the user.
</p>
<p>
Name / Value pairs:
</p>
<dl class="indent">
<dt>
<strong>Name</strong> (String)
</dt>
<dd>
User's name.
</dd>
<dt>
<strong>Email</strong> (String)
</dt>
<dd>
User's email address.
</dd>
</dl>
</body>
</html>