Class AStreamBookmarkSpan
Unit
classwork
Declaration
type AStreamBookmarkSpan = class(AStreamBookmark)
Description
This class represents a string bookmark that specifies a span: that is, a block of bytes within a stream. The bookmark tracks not only the position of the span, where it begins, but also its size in bytes.
To mark the beginning of a span, simply call AStreamBookmarkSpan.setPosition. To mark the end of a span, call AStreamBookmarkSpan.setEndPosition and the bookmark will automatically calculate the size of the span.
Hierarchy
Overview
Fields
Methods
Description
Fields
Methods
|
function init: boolean; override; |
Initializer
|
|
function selfStreamingLength: TStreamIOSize; override; |
Calculate the number of bytes required to stream the bookmark.
This method builds upon the behavior inherited from AStreamBookmark.selfStreamingLength: it calls the inherited routine, then adds the number of bytes required to store the length of the span.
|
|
function toString: AnsiString; override; |
Construct a string representation of the bookmark, suitable for output to a text-based device, such as a console.
This method overrides the behavior inherited from AStreamBookmark.toString. It returns a string that is constructed based on the format specified by either sbspStringRepresentationPlural or sbspStringRepresentationSingular, depending on the value of Self.length. In the default implementation of this method, this string will contain the name of the span as well as the positions in the stream where it begins and ends, and its length.
|
|
function length: TStreamLength; virtual; |
Retrieve the size of the span, in bytes.
|
|
function endPosition: TStreamOffset; virtual; |
Retrieve the position in the stream at which the span comes to an end.
This method calculates the value returned by adding the value of Self.position to the value of Self.length.
|
|
function setEndPosition(const thisPosition: TStreamOffset): TStreamOffset; virtual; |
Set the position in the stream at which the span comes to an end.
thisPosition must be a positive value which specifies the offset, in bytes, from the beginning of the stream where the span comes to an end. The beginning of the stream is always at offset zero (0 ). If thisPosition is negative, this routine will do nothing.
If thisPosition represents a position in the stream that is less than the value of Self.position, this method will do nothing.
Returns
The previous value of AStreamBookmarkSpan.endPosition. |
|
function setEndToCurrentPositionIn(const Source: AStream): TStreamOffset; virtual; |
Use the current position in the specified stream as the point at which the span comes to an end.
If Source is valid (not Nil ), then this method calls AStream.position on it and stores the result.
Returns
The previous value of AStreamBookmarkSpan.endPosition. |
Generated by PasDoc 0.13.0 on 2015-06-23 19:40:11
|