2
0
Эх сурвалжийг харах

+ More stream documentation.

michael 25 жил өмнө
parent
commit
b5731bb818
1 өөрчлөгдсөн 62 нэмэгдсэн , 29 устгасан
  1. 62 29
      docs/classes.xml

+ 62 - 29
docs/classes.xml

@@ -4805,9 +4805,12 @@ file, and thus the valid range depends on the value of <var>Origin</var>.
 </tr>
 </tr>
 </table>
 </table>
 <p>
 <p>
-<var>Seek</var> returns the new position in the file.
+<var>Seek</var> returns the new position in the file, or -1 on error.
 </p>
 </p>
 </descr>
 </descr>
+<errors>
+On error, -1 is returned, and the position is not changed.
+</error>
 <seealso>
 <seealso>
 <link id="TStream.Position"/>
 <link id="TStream.Position"/>
 <link id="TStream.Size"/>
 <link id="TStream.Size"/>
@@ -4817,8 +4820,13 @@ file, and thus the valid range depends on the value of <var>Origin</var>.
 <element name="TFileStream.FileName">  <!-- Property -->
 <element name="TFileStream.FileName">  <!-- Property -->
 <short>The filename of the stream.</short>
 <short>The filename of the stream.</short>
 <descr>
 <descr>
+<var>FileName</var> is the name of the file that the stream reads from or writes
+to. It is the name as passed in the constructor of the stream; it cannot be
+changed. To write to another file, the stream must be freed and created
+again with the new filename.
 </descr>
 </descr>
 <seealso>
 <seealso>
+<link id="TFileStream.Create"/>
 </seealso>
 </seealso>
 </element>
 </element>
 
 
@@ -4831,61 +4839,86 @@ file, and thus the valid range depends on the value of <var>Origin</var>.
 <element name="TCustomMemoryStream">  <!-- Class -->
 <element name="TCustomMemoryStream">  <!-- Class -->
 <short>Abstract stream that stores its data in memory.</short>
 <short>Abstract stream that stores its data in memory.</short>
 <descr>
 <descr>
+<p>
+<var>TCustomMemoryStream</var> is the parent class for streams that stored
+their data in memory. It introduces all needed functions to handle reading
+from and navigating through the memory, and introduces a 
+<link id="TCustomMemoryStream.Memory">Memory</link> property which points to
+the memory area where the stream data is kept. 
+</p>
+<p>
+The only thing which <var>TCustomMemoryStream</var> does not do is obtain 
+memory to store data when writing data  or the writing of data. This
+functionality is implemented in descendent streams such as <link
+id='TMemoryData'/>. The reason for this approach is that this way it is
+possible to create e.g. read-only descendents of
+<var>TCustomMemoryStream</var> that point to a fixed part in memory which
+can be read from, but not written to. 
 </descr>
 </descr>
 <seealso>
 <seealso>
-</seealso>
-</element>
-
-<element name="TCustomMemoryStream.FMemory">  <!-- Variable -->
-<short></short>
-<descr>
-</descr>
-<seealso>
-</seealso>
-</element>
-
-<element name="TCustomMemoryStream.FSize">  <!-- Variable -->
-<short></short>
-<descr>
-</descr>
-<seealso>
-</seealso>
-</element>
-
-<element name="TCustomMemoryStream.FPosition">  <!-- Variable -->
-<short></short>
-<descr>
-</descr>
-<seealso>
+<link id="TMemoryStream"/>
 </seealso>
 </seealso>
 </element>
 </element>
 
 
 <element name="TCustomMemoryStream.SetPointer">  <!-- Procedure -->
 <element name="TCustomMemoryStream.SetPointer">  <!-- Procedure -->
-<short></short>
+<short>Sets the internal memory pointer and size of the memory block.</short>
 <descr>
 <descr>
+<p>
+<var>SetPointer</var> updates the internal memory pointer and the size of
+the memory area pointed to.  
+</p>
+<p>
+Descendent memory streams should call this method whenever they set or reset
+the memory the stream should read from or write to.
+</p>
 </descr>
 </descr>
 <seealso>
 <seealso>
 </seealso>
 </seealso>
 </element>
 </element>
 
 
 <element name="TCustomMemoryStream.Read">  <!-- Function -->
 <element name="TCustomMemoryStream.Read">  <!-- Function -->
-<short></short>
+<short>Reads <var>Count</var> bytes from the stream into <var>buffer</var>.</short>
 <descr>
 <descr>
+<p>
+<var>Read</var> reads <var>Count</var> bytes from the stream into the memory
+pointed to by <var>buffer</var>. It returns the number of bytes actually
+read.
+</p>
+<p>
+This method overrides the abstract <link id="TStream.Read"/> method of <link
+id="TStream"/>. It will read as much bytes as are still available in the
+memory area pointer to by <link id="TCustomMemoryStream.Memory">Memory</link>.
+After the bytes are read, the internal stream position is updated.
+</p>
 </descr>
 </descr>
 <seealso>
 <seealso>
+<link id="TCustomMemoryStream.Memory"/>
+<link id="TStream.Read"/>
 </seealso>
 </seealso>
 </element>
 </element>
 
 
 <element name="TCustomMemoryStream.Seek">  <!-- Function -->
 <element name="TCustomMemoryStream.Seek">  <!-- Function -->
-<short></short>
+<short>Sets a new position in the stream.</short>
 <descr>
 <descr>
+<var>Seek</var> overrides the abstract <link id="TStream.Seek"/> method.
+It simply updates the internal stream position, and returns the new
+position.
 </descr>
 </descr>
+<errors>
+No checking is done whether the new position is still a valid position, i.e.
+whether the position is still within the range <var>0..Size</var>.
+Attempting a seek outside the valid memory range of the stream may result in
+an exception at the next read or write operation.
+</errors>
 <seealso>
 <seealso>
+<link id="TStream.Position"/>
+<link id="TStream.Size"/>
+<link id="TCustomMemoryStream.Memory"/>
 </seealso>
 </seealso>
 </element>
 </element>
 
 
 <element name="TCustomMemoryStream.SaveToStream">  <!-- Procedure -->
 <element name="TCustomMemoryStream.SaveToStream">  <!-- Procedure -->
-<short></short>
+<short>Writes the contents of the memory stream to another stream.</short>
 <descr>
 <descr>
 </descr>
 </descr>
 <seealso>
 <seealso>