1
0
mirror of synced 2024-12-22 01:03:07 +01:00

Added: preliminary DocBook documentation and paged- and single-HTML conversions

This commit is contained in:
Mark van Renswoude 2004-06-23 19:44:16 +00:00
parent a97a491ca2
commit 038fd8e845
17 changed files with 511 additions and 0 deletions

28
Docs/X2Utils-html.xsl Normal file
View File

@ -0,0 +1,28 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<xsl:import href="F:/DocBook/html/chunk.xsl"/>
<xsl:param name="html.stylesheet">html.css</xsl:param>
<xsl:param name="toc.section.depth">3</xsl:param>
<xsl:param name="annotate.toc">0</xsl:param>
<xsl:template match="sect1" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes"
select="sect2|refentry|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="sect2" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes"
select="sect3|refentry|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,28 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version='1.0'>
<xsl:import href="F:/DocBook/html/docbook.xsl"/>
<xsl:param name="html.stylesheet">html.css</xsl:param>
<xsl:param name="toc.section.depth">3</xsl:param>
<xsl:param name="annotate.toc">0</xsl:param>
<xsl:template match="sect1" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes"
select="sect2|refentry|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
<xsl:template match="sect2" mode="toc">
<xsl:param name="toc-context" select="."/>
<xsl:call-template name="subtoc">
<xsl:with-param name="toc-context" select="$toc-context"/>
<xsl:with-param name="nodes"
select="sect3|refentry|bridgehead[$bridgehead.in.toc != 0]"/>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>

100
Docs/X2Utils.xml Normal file
View File

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<book>
<bookinfo>
<author>
<firstname>M.</firstname>
<surname>van Renswoude</surname>
</author>
</bookinfo>
<title>X²Utils</title>
<chapter>
<title>Introduction</title>
<section>
<title>Overview</title>
<para>
X²Utils is an open-source set of utility classes and functions released under the <ulink url="http://www.opensource.org/licenses/zlib-license.php">zlib/libpng license</ulink>, a copy of which is shown below. It's main function is reusability and convenience; anything which is used often deserves a spot in the library, assuming it is written with portability in mind.
</para>
<para>
The official website for X²Utils is located at <ulink url="http://x2utils.kamadev.net/">http://x2utils.kamadev.net/</ulink>. Contributions to the source code are appreciated, and after reviewing will be committed to the Subversion repository.
</para>
</section>
<section>
<title>Documentation</title>
<para>
The documentation for X²Utils is kept both as in-source comments and external docBook format. The in-source comments can be used in combination with <ulink url="http://www.thewsoft.com/">Delphi Component Help Builder</ulink> to generate reference documentation. The docBook sources must be kept in sync manually, but allow for detailed explanation of the various functions.
</para>
</section>
<section>
<title>License</title>
<para>
Copyright (c) 2004 X²Software</para> <para>This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
</para>
<para>
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
</para>
<orderedlist>
<listitem>
The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
</listitem>
<listitem>
Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
</listitem>
<listitem>
This notice may not be removed or altered from any source distribution.
</listitem>
</orderedlist>
</section>
</chapter>
<chapter>
<title>Environment information</title>
<section>
<title>X2UtApp.pas</title>
<para>
Contains a TX2App class which can be initiated as a singleton using the App() function. It provides information related to the application, such as the executable path and version information.
</para>
<para>
Note that you should not free the return value of the App() function, the unit's finalization clause takes care of destroying the object when the application closes. This makes it suitable to use the App() function in a way similar to Delphi's Application object.
</para>
<example>
<title>Using the App function</title>
<para>
MyDataFileLocation := App.Path + <phrase role="codestring">'data.ini'</phrase>;
</para>
</example>
<para>
The version information is accessible through App.Version. It contains the version numbers and various build flags as specified in the project options. You can also access the version strings through App.Version.Strings, which contain information such as the product name and copyright.
</para>
<para>
Useful for display purposes is the App.FormatVersion() function. It returns a string with the version information in the format &quot;vX.X.X&quot;. If the optional Build parameter is set to True (default), "build X" is appended as well.
</para>
</section>
<section>
<title>X2UtOS.pas</title>
<para>
Similar to X2UtApp.pas, this unit contains a TX2OS class which you can access using the OS() function. It provides information about the Operating System the application currently runs on.
</para>
<para>
OS.Version is an enumeration of versions recognized by X2UtOS. Extended information if available through OS.VersionEx, and an OS.FormatVersion() is provided for display purposes as well.
</para>
</section>
</chapter>
</book>

3
Docs/compile-all.bat Normal file
View File

@ -0,0 +1,3 @@
@Echo Off
call compile-html.bat
call compile-singlehtml.bat

6
Docs/compile-html.bat Normal file
View File

@ -0,0 +1,6 @@
@Echo Off
echo Compiling paged HTML documentation...
cd html
xsltproc ..\X2Utils-html.xsl ..\X2Utils.xml
cd ..
copy html.css html

View File

@ -0,0 +1,5 @@
@Echo Off
echo Compiling single-HTML documentation...
xsltproc X2Utils-singlehtml.xsl X2Utils.xml > singlehtml\index.html
cd ..
copy html.css singlehtml

87
Docs/html.css Normal file
View File

@ -0,0 +1,87 @@
body
{
background-color: #ffffff;
color: #000000;
font-family: verdana, tahoma, arial, sans-serif;
font-size: 10pt;
}
td
{
font-size: 10pt;
}
a
{
background-color: transparent;
color: #000080;
text-decoration: underline;
}
a:hover
{
background-color: #f0f0ff;
color: #000080;
}
h1, h2, h3, h4, h5
{
background-color: transparent;
color: #800000;
}
h3
{
font-size: 13pt;
font-weight: bold;
}
h4
{
font-size: 10pt;
font-weight: bold;
}
span.term
{
font-weight: bold;
}
div.sidebar
{
background-color: #f0f0f0;
border-color: gray;
border-style: solid;
border-width: 1px;
color: #000000;
margin: 20px;
padding: 5px;
}
pre.programlisting
{
background-color: #f0f0f0;
border-color: gray;
border-style: solid;
border-width: 1px;
color: #000000;
font-size: 10pt;
padding: 2px;
white-space: pre;
}
span.codestring
{
background-color: transparent;
color: #008000;
}
dl
{
margin-top: 0px;
}
dd
{
margin-left: 20px;
}

5
Docs/html/ch01.html Normal file
View File

@ -0,0 +1,5 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 1. Introduction</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="X²Utils"><link rel="up" href="index.html" title="X²Utils"><link rel="previous" href="index.html" title="X²Utils"><link rel="next" href="ch01s02.html" title="Documentation"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 1. Introduction</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch01s02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id405176"></a>Chapter 1. Introduction</h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="ch01.html#id405182">Overview</a></span></dt><dt><span class="section"><a href="ch01s02.html">Documentation</a></span></dt><dt><span class="section"><a href="ch01s03.html">License</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id405182"></a>Overview</h2></div></div><div></div></div><p>
X²Utils is an open-source set of utility classes and functions released under the <a href="http://www.opensource.org/licenses/zlib-license.php" target="_top">zlib/libpng license</a>, a copy of which is shown below. It's main function is reusability and convenience; anything which is used often deserves a spot in the library, assuming it is written with portability in mind.
</p><p>
The official website for X²Utils is located at <a href="http://x2utils.kamadev.net/" target="_top">http://x2utils.kamadev.net/</a>. Contributions to the source code are appreciated, and after reviewing will be committed to the Subversion repository.
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="index.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch01s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">X²Utils </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Documentation</td></tr></table></div></body></html>

3
Docs/html/ch01s02.html Normal file
View File

@ -0,0 +1,3 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Documentation</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="X²Utils"><link rel="up" href="ch01.html" title="Chapter 1. Introduction"><link rel="previous" href="ch01.html" title="Chapter 1. Introduction"><link rel="next" href="ch01s03.html" title="License"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Documentation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Introduction</th><td width="20%" align="right"> <a accesskey="n" href="ch01s03.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id496442"></a>Documentation</h2></div></div><div></div></div><p>
The documentation for X²Utils is kept both as in-source comments and external docBook format. The in-source comments can be used in combination with <a href="http://www.thewsoft.com/" target="_top">Delphi Component Help Builder</a> to generate reference documentation. The docBook sources must be kept in sync manually, but allow for detailed explanation of the various functions.
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch01s03.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 1. Introduction </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> License</td></tr></table></div></body></html>

11
Docs/html/ch01s03.html Normal file
View File

@ -0,0 +1,11 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>License</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="X²Utils"><link rel="up" href="ch01.html" title="Chapter 1. Introduction"><link rel="previous" href="ch01s02.html" title="Documentation"><link rel="next" href="ch02.html" title="Chapter 2. Environment information"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">License</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s02.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Introduction</th><td width="20%" align="right"> <a accesskey="n" href="ch02.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id496469"></a>License</h2></div></div><div></div></div><p>
Copyright (c) 2004 X²Software</p><p>This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
</p><p>
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
</p><div class="orderedlist"><ol type="1"><li>
The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
</li><li>
Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
</li><li>
This notice may not be removed or altered from any source distribution.
</li></ol></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch01.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Documentation </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 2. Environment information</td></tr></table></div></body></html>

11
Docs/html/ch02.html Normal file
View File

@ -0,0 +1,11 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 2. Environment information</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="X²Utils"><link rel="up" href="index.html" title="X²Utils"><link rel="previous" href="ch01s03.html" title="License"><link rel="next" href="ch02s02.html" title="X2UtOS.pas"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Environment information</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s03.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch02s02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id404045"></a>Chapter 2. Environment information</h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="ch02.html#id404051">X2UtApp.pas</a></span></dt><dt><span class="section"><a href="ch02s02.html">X2UtOS.pas</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id404051"></a>X2UtApp.pas</h2></div></div><div></div></div><p>
Contains a TX2App class which can be initiated as a singleton using the App() function. It provides information related to the application, such as the executable path and version information.
</p><p>
Note that you should not free the return value of the App() function, the unit's finalization clause takes care of destroying the object when the application closes. This makes it suitable to use the App() function in a way similar to Delphi's Application object.
</p><div class="example"><a name="id495415"></a><p class="title"><b>Example 2.1. Using the App function</b></p><p>
MyDataFileLocation := App.Path + <span class="codestring">'data.ini'</span>;
</p></div><p>
The version information is accessible through App.Version. It contains the version numbers and various build flags as specified in the project options. You can also access the version strings through App.Version.Strings, which contain information such as the product name and copyright.
</p><p>
Useful for display purposes is the App.FormatVersion() function. It returns a string with the version information in the format "vX.X.X". If the optional Build parameter is set to True (default), "build X" is appended as well.
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">License </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> X2UtOS.pas</td></tr></table></div></body></html>

5
Docs/html/ch02s02.html Normal file
View File

@ -0,0 +1,5 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>X2UtOS.pas</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="X²Utils"><link rel="up" href="ch02.html" title="Chapter 2. Environment information"><link rel="previous" href="ch02.html" title="Chapter 2. Environment information"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">X2UtOS.pas</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Environment information</th><td width="20%" align="right"> </td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id495457"></a>X2UtOS.pas</h2></div></div><div></div></div><p>
Similar to X2UtApp.pas, this unit contains a TX2OS class which you can access using the OS() function. It provides information about the Operating System the application currently runs on.
</p><p>
OS.Version is an enumeration of versions recognized by X2UtOS. Extended information if available through OS.VersionEx, and an OS.FormatVersion() is provided for display purposes as well.
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> </td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. Environment information </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div></body></html>

87
Docs/html/html.css Normal file
View File

@ -0,0 +1,87 @@
body
{
background-color: #ffffff;
color: #000000;
font-family: verdana, tahoma, arial, sans-serif;
font-size: 10pt;
}
td
{
font-size: 10pt;
}
a
{
background-color: transparent;
color: #000080;
text-decoration: underline;
}
a:hover
{
background-color: #f0f0ff;
color: #000080;
}
h1, h2, h3, h4, h5
{
background-color: transparent;
color: #800000;
}
h3
{
font-size: 13pt;
font-weight: bold;
}
h4
{
font-size: 10pt;
font-weight: bold;
}
span.term
{
font-weight: bold;
}
div.sidebar
{
background-color: #f0f0f0;
border-color: gray;
border-style: solid;
border-width: 1px;
color: #000000;
margin: 20px;
padding: 5px;
}
pre.programlisting
{
background-color: #f0f0f0;
border-color: gray;
border-style: solid;
border-width: 1px;
color: #000000;
font-size: 10pt;
padding: 2px;
white-space: pre;
}
span.codestring
{
background-color: transparent;
color: #008000;
}
dl
{
margin-top: 0px;
}
dd
{
margin-left: 20px;
}

1
Docs/html/index.html Normal file
View File

@ -0,0 +1 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>X²Utils</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="X²Utils"><link rel="next" href="ch01.html" title="Chapter 1. Introduction"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">X²Utils</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch01.html">Next</a></td></tr></table><hr></div><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id395713"></a>X²Utils</h1></div><div><div class="author"><h3 class="author"><span class="firstname">M.</span> <span class="surname">van Renswoude</span></h3></div></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="ch01.html">1. Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="ch01.html#id405182">Overview</a></span></dt><dt><span class="section"><a href="ch01s02.html">Documentation</a></span></dt><dt><span class="section"><a href="ch01s03.html">License</a></span></dt></dl></dd><dt><span class="chapter"><a href="ch02.html">2. Environment information</a></span></dt><dd><dl><dt><span class="section"><a href="ch02.html#id404051">X2UtApp.pas</a></span></dt><dt><span class="section"><a href="ch02s02.html">X2UtOS.pas</a></span></dt></dl></dd></dl></div><div class="list-of-examples"><p><b>List of Examples</b></p><dl><dt>2.1. <a href="ch02.html#id495415">Using the App function</a></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> Chapter 1. Introduction</td></tr></table></div></body></html>

13
Docs/readme.txt Normal file
View File

@ -0,0 +1,13 @@
To build the documentation:
- Download the docBook XSL stylesheets from:
http://docbook.sourceforge.net/projects/xsl/index.html
- Download XSLTProc, Windows version available at:
http://www.zlatkovic.com/libxml.en.html
- Modify the XSL files and point the include directive
to the path where you extracted the docBook files.
- Run compile-html-chunk.bat for the multi-page output or
compile-html.bat for a single-page output.

87
Docs/singlehtml/html.css Normal file
View File

@ -0,0 +1,87 @@
body
{
background-color: #ffffff;
color: #000000;
font-family: verdana, tahoma, arial, sans-serif;
font-size: 10pt;
}
td
{
font-size: 10pt;
}
a
{
background-color: transparent;
color: #000080;
text-decoration: underline;
}
a:hover
{
background-color: #f0f0ff;
color: #000080;
}
h1, h2, h3, h4, h5
{
background-color: transparent;
color: #800000;
}
h3
{
font-size: 13pt;
font-weight: bold;
}
h4
{
font-size: 10pt;
font-weight: bold;
}
span.term
{
font-weight: bold;
}
div.sidebar
{
background-color: #f0f0f0;
border-color: gray;
border-style: solid;
border-width: 1px;
color: #000000;
margin: 20px;
padding: 5px;
}
pre.programlisting
{
background-color: #f0f0f0;
border-color: gray;
border-style: solid;
border-width: 1px;
color: #000000;
font-size: 10pt;
padding: 2px;
white-space: pre;
}
span.codestring
{
background-color: transparent;
color: #008000;
}
dl
{
margin-top: 0px;
}
dd
{
margin-left: 20px;
}

View File

@ -0,0 +1,31 @@
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>X²Utils</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id178130"></a>X²Utils</h1></div><div><div class="author"><h3 class="author"><span class="firstname">M.</span> <span class="surname">van Renswoude</span></h3></div></div></div><div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="#id476507">1. Introduction</a></span></dt><dd><dl><dt><span class="section"><a href="#id476513">Overview</a></span></dt><dt><span class="section"><a href="#id475447">Documentation</a></span></dt><dt><span class="section"><a href="#id475475">License</a></span></dt></dl></dd><dt><span class="chapter"><a href="#id476595">2. Environment information</a></span></dt><dd><dl><dt><span class="section"><a href="#id476601">X2UtApp.pas</a></span></dt><dt><span class="section"><a href="#id385108">X2UtOS.pas</a></span></dt></dl></dd></dl></div><div class="list-of-examples"><p><b>List of Examples</b></p><dl><dt>2.1. <a href="#id476633">Using the App function</a></dt></dl></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id476507"></a>Chapter 1. Introduction</h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id476513">Overview</a></span></dt><dt><span class="section"><a href="#id475447">Documentation</a></span></dt><dt><span class="section"><a href="#id475475">License</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id476513"></a>Overview</h2></div></div><div></div></div><p>
X²Utils is an open-source set of utility classes and functions released under the <a href="http://www.opensource.org/licenses/zlib-license.php" target="_top">zlib/libpng license</a>, a copy of which is shown below. It's main function is reusability and convenience; anything which is used often deserves a spot in the library, assuming it is written with portability in mind.
</p><p>
The official website for X²Utils is located at <a href="http://x2utils.kamadev.net/" target="_top">http://x2utils.kamadev.net/</a>. Contributions to the source code are appreciated, and after reviewing will be committed to the Subversion repository.
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id475447"></a>Documentation</h2></div></div><div></div></div><p>
The documentation for X²Utils is kept both as in-source comments and external docBook format. The in-source comments can be used in combination with <a href="http://www.thewsoft.com/" target="_top">Delphi Component Help Builder</a> to generate reference documentation. The docBook sources must be kept in sync manually, but allow for detailed explanation of the various functions.
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id475475"></a>License</h2></div></div><div></div></div><p>
Copyright (c) 2004 X²Software</p><p>This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
</p><p>
Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
</p><div class="orderedlist"><ol type="1"><li>
The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
</li><li>
Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
</li><li>
This notice may not be removed or altered from any source distribution.
</li></ol></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id476595"></a>Chapter 2. Environment information</h2></div></div><div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id476601">X2UtApp.pas</a></span></dt><dt><span class="section"><a href="#id385108">X2UtOS.pas</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id476601"></a>X2UtApp.pas</h2></div></div><div></div></div><p>
Contains a TX2App class which can be initiated as a singleton using the App() function. It provides information related to the application, such as the executable path and version information.
</p><p>
Note that you should not free the return value of the App() function, the unit's finalization clause takes care of destroying the object when the application closes. This makes it suitable to use the App() function in a way similar to Delphi's Application object.
</p><div class="example"><a name="id476633"></a><p class="title"><b>Example 2.1. Using the App function</b></p><p>
MyDataFileLocation := App.Path + <span class="codestring">'data.ini'</span>;
</p></div><p>
The version information is accessible through App.Version. It contains the version numbers and various build flags as specified in the project options. You can also access the version strings through App.Version.Strings, which contain information such as the product name and copyright.
</p><p>
Useful for display purposes is the App.FormatVersion() function. It returns a string with the version information in the format "vX.X.X". If the optional Build parameter is set to True (default), "build X" is appended as well.
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id385108"></a>X2UtOS.pas</h2></div></div><div></div></div><p>
Similar to X2UtApp.pas, this unit contains a TX2OS class which you can access using the OS() function. It provides information about the Operating System the application currently runs on.
</p><p>
OS.Version is an enumeration of versions recognized by X2UtOS. Extended information if available through OS.VersionEx, and an OS.FormatVersion() is provided for display purposes as well.
</p></div></div></div></body></html>