mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-10 01:08:35 +02:00

svn+ssh://svn.freepascal.org/FPC/svn/fpc/branches/resources ........ r9694 | michael | 2008-01-09 21:31:18 +0100 (Wed, 09 Jan 2008) | 1 line * Initial check-in ........ r9695 | michael | 2008-01-09 21:35:58 +0100 (Wed, 09 Jan 2008) | 1 line * New version from Giulio Bernardi ........ r9697 | michael | 2008-01-09 21:41:54 +0100 (Wed, 09 Jan 2008) | 1 line * Patch from Giulio Bernardi with resource support ........ r9698 | michael | 2008-01-09 21:46:33 +0100 (Wed, 09 Jan 2008) | 1 line * Patch from Giulio Bernardi to add more resource testing ........ r9699 | michael | 2008-01-09 21:57:26 +0100 (Wed, 09 Jan 2008) | 1 line * New tool from Giulio Bernardi ........ r9700 | michael | 2008-01-09 21:58:23 +0100 (Wed, 09 Jan 2008) | 1 line * New tool from Giulio Bernardi ........ r9701 | michael | 2008-01-09 22:01:54 +0100 (Wed, 09 Jan 2008) | 1 line * Added fcl-res ........ r9702 | michael | 2008-01-09 22:01:58 +0100 (Wed, 09 Jan 2008) | 1 line * Added fcl-res ........ r9703 | michael | 2008-01-10 08:54:26 +0100 (Thu, 10 Jan 2008) | 1 line * Fixed double code ........ r9704 | jonas | 2008-01-10 10:59:20 +0100 (Thu, 10 Jan 2008) | 2 lines - removed duplicate code ........ r9705 | jonas | 2008-01-10 11:25:21 +0100 (Thu, 10 Jan 2008) | 2 lines + added missing fcl-res dependencies ........ r9706 | jonas | 2008-01-10 11:58:30 +0100 (Thu, 10 Jan 2008) | 2 lines + dependencies for fpintres and fpextres ........ r9707 | yury | 2008-01-10 12:47:51 +0100 (Thu, 10 Jan 2008) | 3 lines * Fixed compilation of resource, which is included in a unit located in different folder than main source. * .res files must be copied to units output folder, otherwise .res files will not be found when only compiled units path is available and compiler does not know anything about sources folder. * Improved resource related error messages. ........ r9708 | michael | 2008-01-10 12:52:13 +0100 (Thu, 10 Jan 2008) | 1 line * Removed double source after end. ........ r9709 | michael | 2008-01-10 12:52:48 +0100 (Thu, 10 Jan 2008) | 1 line * No longer needed ........ r9710 | tom_at_work | 2008-01-10 22:09:08 +0100 (Thu, 10 Jan 2008) | 1 line * properly align FPC_RESLOCATION so that linking does not fail on some architectures (e.g. ppc64) ........ r9711 | tom_at_work | 2008-01-10 23:53:12 +0100 (Thu, 10 Jan 2008) | 1 line * fix splitting of 64 bit load/stores from/to unaligned memory locations into multiple load/stores, which in some cases generated wrong code ........ r9712 | michael | 2008-01-11 11:00:08 +0100 (Fri, 11 Jan 2008) | 1 line * Fixed bug in BSS section on 64-bit platforms ........ r9720 | giulio | 2008-01-12 10:02:04 +0100 (Sat, 12 Jan 2008) | 1 line Updated fcl-res documentation: occurrences of reslib changed to fcl-res. ........ r9740 | giulio | 2008-01-13 19:36:44 +0100 (Sun, 13 Jan 2008) | 3 lines - Don't try to compile resources on systems with a non windows-like resource support. - Don't add the .or file to the list of object files if resource compiling failed. ........ r10201 | giulio | 2008-02-04 11:35:44 +0100 (Mon, 04 Feb 2008) | 5 lines * resource compiling supported on OS/2 via wrc * CompileResourceFiles and CollectResourceFiles don't do target-specific checks anymore * refactored a bit ........ r10389 | giulio | 2008-02-25 21:32:52 +0100 (Mon, 25 Feb 2008) | 2 lines Deleted test file which was committed by mistake ........ r10472 | giulio | 2008-03-10 12:22:18 +0100 (Mon, 10 Mar 2008) | 2 lines changed define FPC_HAS_RESOURCES to FPC_HAS_WINLIKERESOURCES ........ git-svn-id: trunk@10481 -
261 lines
11 KiB
XML
261 lines
11 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
<fpdoc-descriptions>
|
|
<package name="fcl-res">
|
|
|
|
<!--
|
|
====================================================================
|
|
resdatastream
|
|
====================================================================
|
|
-->
|
|
|
|
<module name="resdatastream">
|
|
<short>Contains stream classes to provide copy-on-write functionality</short>
|
|
<descr>
|
|
<p>This unit contains various streams that are used to provide copy-on-write mechanism for <link id="resource.TAbstractResource.RawData">TAbstractResource.RawData</link>, via more levels of indirection.</p>
|
|
<p>Main class is <link id="TResourceDataStream"/>, which is the stream used for <link id="resource.TAbstractResource.RawData">TAbstractResource.RawData</link>. This class uses an underlying stream, to which it redirects operations.</p>
|
|
<p>At a lower level, a <link id="TCachedDataStream"/> descendant provides a layer between the original stream and the <link id="TResourceDataStream"/>.</p>
|
|
</descr>
|
|
|
|
<!-- unresolved type reference Visibility: default -->
|
|
<element name="Classes">
|
|
</element>
|
|
|
|
<!-- unresolved type reference Visibility: default -->
|
|
<element name="SysUtils">
|
|
</element>
|
|
|
|
<!-- unresolved type reference Visibility: default -->
|
|
<element name="resource">
|
|
</element>
|
|
|
|
<!-- object Visibility: default -->
|
|
<element name="TCachedDataStream">
|
|
<short>Base cached stream class</short>
|
|
<descr>
|
|
<p>This abstract class provides basic cached stream functionalities.</p>
|
|
<p>A cached stream is a read-only stream that operates on a portion of another stream. That is, it creates a "window" on the original stream from which to read data. Since it is a read-only stream, trying to write to the stream or to set its size cause an EInvalidOperation exception to be raised.</p>
|
|
<p>This class is used by <link id="TResourceDataStream"/> to access the raw data of a resource. When an attempt to write to the stream is detected, <link id="TResourceDataStream"/> replaces it with a memory stream and copies the contents of the cached stream to the memory one, thus providing a copy-on-write mechanism.</p>
|
|
<remark>An object of this class should never be directly instantiated: use a descendant class instead.</remark>
|
|
</descr>
|
|
<seealso>
|
|
<link id="TResourceDataStream"/>
|
|
<link id="TCachedResourceDataStream"/>
|
|
</seealso>
|
|
</element>
|
|
|
|
<!-- variable Visibility: protected -->
|
|
<element name="TCachedDataStream.fStream">
|
|
<short>The original stream</short>
|
|
<descr>
|
|
<p>This protected member is provided to let descendant classes access the original stream.</p>
|
|
</descr>
|
|
</element>
|
|
|
|
<!-- variable Visibility: protected -->
|
|
<element name="TCachedDataStream.fSize">
|
|
<short>The size of the cached stream</short>
|
|
<descr>
|
|
<p>This protected member is provided to let descendant classes access the size of the cached stream.</p>
|
|
</descr>
|
|
</element>
|
|
|
|
<!-- variable Visibility: protected -->
|
|
<element name="TCachedDataStream.fPosition">
|
|
<short>The position from the cached stream perspective</short>
|
|
<descr>
|
|
<p>This protected member is provided to let descendant classes access the position of the cached stream.</p>
|
|
</descr>
|
|
</element>
|
|
|
|
<!-- constructor Visibility: public -->
|
|
<element name="TCachedDataStream.Create">
|
|
<short>Creates a new object</short>
|
|
<descr>
|
|
<p>A new cached stream is created on top of the <var>aStream</var> stream.</p>
|
|
</descr>
|
|
<seealso>
|
|
<link id="TCachedDataStream"/>
|
|
<link id="TResourceDataStream"/>
|
|
<link id="TResourceDataStream.Create"/>
|
|
</seealso>
|
|
</element>
|
|
|
|
<!-- argument Visibility: default -->
|
|
<element name="TCachedDataStream.Create.aStream">
|
|
<short>The stream from which to read data</short>
|
|
</element>
|
|
|
|
<!-- argument Visibility: default -->
|
|
<element name="TCachedDataStream.Create.aResource">
|
|
<short>The resource whose data must be read</short>
|
|
</element>
|
|
|
|
<!-- argument Visibility: default -->
|
|
<element name="TCachedDataStream.Create.aSize">
|
|
<short>The size of the resource data</short>
|
|
</element>
|
|
|
|
<!-- object Visibility: default -->
|
|
<element name="TCachedResourceDataStream">
|
|
<short>An implementation of a cached stream</short>
|
|
<descr>
|
|
<p>This class provides an implementation of <link id="TCachedDataStream"/>.</p>
|
|
<p>Usually resource readers create a <link id="TResourceDataStream"/> with a TCachedResourceDataStream as the underlying stream.</p>
|
|
</descr>
|
|
<seealso>
|
|
<link id="TCachedDataStream"/>
|
|
<link id="TResourceDataStream"/>
|
|
</seealso>
|
|
</element>
|
|
|
|
<!-- "class of" type Visibility: default -->
|
|
<element name="TCachedStreamClass">
|
|
<short>Cached stream metaclass</short>
|
|
</element>
|
|
|
|
<!-- enumeration type Visibility: default -->
|
|
<element name="TUnderlyingStreamType">
|
|
<short>The type of the underlying stream of TResourceDataStream</short>
|
|
<seealso>
|
|
<link id="TResourceDataStream"/>
|
|
</seealso>
|
|
</element>
|
|
|
|
<!-- enumeration value Visibility: default -->
|
|
<element name="TUnderlyingStreamType.usCached">
|
|
<short>The underlying stream is a TCachedResourceDataStream descendant</short>
|
|
</element>
|
|
|
|
<!-- enumeration value Visibility: default -->
|
|
<element name="TUnderlyingStreamType.usMemory">
|
|
<short>The underlying stream is a memory stream</short>
|
|
</element>
|
|
|
|
<!-- enumeration value Visibility: default -->
|
|
<element name="TUnderlyingStreamType.usCustom">
|
|
<short>The underlying stream is a custom stream</short>
|
|
</element>
|
|
|
|
<!-- object Visibility: default -->
|
|
<element name="TResourceDataStream">
|
|
<short>Stream class that provides copy-on-write functionality</short>
|
|
<descr>
|
|
<p>This class provides the copy-on-write mechanism of <link id="resource.TAbstractResource.RawData">TAbstractResource.RawData</link>, via more levels of indirection.</p>
|
|
<p>It uses an underlying stream, to which it redirects operations.</p>
|
|
<p>The underlying stream can be a <link id="TCachedDataStream"/> descendant, a memory stream or a custom stream. Usually when a resource is loaded from a stream, the underlying stream is a <link id="TCachedDataStream"/> descendant, which provides a read-only stream-like interface over a portion of the original stream (that is, the part of the original stream where resource data resides). When <link id="TResourceDataStream"/> is requested to write data, it replaces the underlying stream with a memory stream, whose contents are copied from the previous underlying stream: this way, copy-on-write functionality can be achieved.</p>
|
|
<p>As said before, third possibility is to have a custom stream as the underlying stream: a user can set this stream via <link id="resource.TAbstractResource.SetCustomRawDataStream">TAbstractResource.SetCustomRawDataStream</link> method, which in turn calls <link id="TResourceDataStream.SetCustomStream"/></p>
|
|
<p><b>Figure</b>: Levels of indirection</p>
|
|
<pre>
|
|
.
|
|
TResourceDataStream
|
|
|
|
|
_______________________|_______________________________
|
|
| | |
|
|
TMemoryStream TCachedDataStream descendant custom stream
|
|
/ \
|
|
_______________________|_____________|______________________________
|
|
| o r i g|i n a l s t|r e a m |
|
|
|_______________________|_____________|______________________________|
|
|
|
|
</pre>
|
|
</descr>
|
|
<seealso>
|
|
<link id="TCachedDataStream"/>
|
|
<link id="TResourceDataStream.Create"/>
|
|
<link id="TResourceDataStream.SetCustomStream"/>
|
|
</seealso>
|
|
</element>
|
|
|
|
<!-- constructor Visibility: public -->
|
|
<element name="TResourceDataStream.Create">
|
|
<short>Creates a new object</short>
|
|
<descr>
|
|
<p>A new <link id="TResourceDataStream"/> object is created.</p>
|
|
<p>If <var>aStream</var> is <var>nil</var>, the underlying stream is a memory stream. Otherwise, a cached stream of the class specified in <var>aClass</var> is created and set as the underlying stream.</p>
|
|
</descr>
|
|
<seealso>
|
|
<link id="TResourceDataStream"/>
|
|
<link id="TCachedDataStream"/>
|
|
<link id="TResourceDataStream.SetCustomStream"/>
|
|
</seealso>
|
|
</element>
|
|
|
|
<!-- argument Visibility: default -->
|
|
<element name="TResourceDataStream.Create.aStream">
|
|
<short>The stream which resource data must be read from. It can be <var>nil</var></short>
|
|
</element>
|
|
|
|
<!-- argument Visibility: default -->
|
|
<element name="TResourceDataStream.Create.aResource">
|
|
<short>The resource whose data must be read</short>
|
|
</element>
|
|
|
|
<!-- argument Visibility: default -->
|
|
<element name="TResourceDataStream.Create.aSize">
|
|
<short>The size of the resource data</short>
|
|
</element>
|
|
|
|
<!-- argument Visibility: default -->
|
|
<element name="TResourceDataStream.Create.aClass">
|
|
<short>The class to use to create the underlying cached stream</short>
|
|
</element>
|
|
|
|
<!-- function Visibility: public -->
|
|
<element name="TResourceDataStream.Compare">
|
|
<short>Compares the stream to another one</short>
|
|
<descr>
|
|
<p>This methods compares the stream with <var>aStream</var>. If they are of the same length and their contents are the same, <var>true</var> is returned, <var>false</var> otherwise.</p>
|
|
</descr>
|
|
<seealso>
|
|
<link id="resource.TAbstractResource.CompareContents">TAbstractResource.CompareContents</link>
|
|
</seealso>
|
|
</element>
|
|
|
|
<!-- function result Visibility: default -->
|
|
<element name="TResourceDataStream.Compare.Result">
|
|
<short>True if the contents of the two streams are the same</short>
|
|
</element>
|
|
|
|
<!-- argument Visibility: default -->
|
|
<element name="TResourceDataStream.Compare.aStream">
|
|
<short>The stream to compare to this one. It can be <var>nil</var></short>
|
|
</element>
|
|
|
|
<!-- procedure Visibility: public -->
|
|
<element name="TResourceDataStream.SetCustomStream">
|
|
<short>Sets a custom stream as the underlying stream</short>
|
|
<descr>
|
|
<p>This method sets a custom stream as the underlying stream.</p>
|
|
<p>If <var>aStream</var> is <var>nil</var>, a new memory stream is used as the underlying stream. This can be used to remove a previously set custom stream as the underlying stream.</p>
|
|
<p>Usually it is called by <link id="resource.TAbstractResource.SetCustomRawDataStream">TAbstractResource.SetCustomRawDataStream</link>.</p>
|
|
</descr>
|
|
<seealso>
|
|
<link id="TResourceDataStream"/>
|
|
<link id="resource.TAbstractResource.SetCustomRawDataStream">TAbstractResource.SetCustomRawDataStream</link>
|
|
</seealso>
|
|
</element>
|
|
|
|
<!-- argument Visibility: default -->
|
|
<element name="TResourceDataStream.SetCustomStream.aStream">
|
|
<short>The stream to use as the underlying stream. It can be <var>nil</var></short>
|
|
</element>
|
|
|
|
<!-- property Visibility: public -->
|
|
<element name="TResourceDataStream.Cached">
|
|
<short>Controls the copy-on-write behaviour of the stream</short>
|
|
<descr>
|
|
<p>When this property is set to <var>true</var>, a cached stream is used as the underlying stream for read operations. If it is set to <var>false</var>, no caching is performed and data is always copied to a memory stream.</p>
|
|
<p>Note that this property does nothing if the underlying stream is a custom stream.</p>
|
|
<p>By default this property is true.</p>
|
|
</descr>
|
|
<seealso>
|
|
<link id="TResourceDataStream"/>
|
|
<link id="resource.TAbstractResource.CacheData">TAbstractResource.CacheData</link>
|
|
</seealso>
|
|
</element>
|
|
|
|
</module> <!-- resdatastream -->
|
|
|
|
</package>
|
|
</fpdoc-descriptions>
|