Class TStorageStream (unit CompDoc)

Inherits from

TStream

A descendant of TStream with all its behaviors (CopyFrom, } { ReadBuffer, etc.). Note that storage streams cannot be } { opened in transacted mode.

Constructors


constructor CloneFrom(CDStream : TStorageStream);

Constructs a stream another stream such that both have } { live access to the same data but at different offsets.

constructor Create(Name : string; ParentStorage : TStorage; AccessMode : TAccessMode; CreateNew : boolean);

Creates (CreateNew = true) or opens (CreateNew = false) } { a stream within a storage.


Functions

destructor Destroy;

Closes the stream writing any changes to the parent } { storage.

function Read(var Buffer; Count : longint) : longint;


function Seek(Offset : longint; Origin : word) : longint;


function Write(const Buffer; Count : longint) : longint;


procedure CheckError(msg : string);


function GetName : string;


procedure SetSize(NewSize : longint);


Properties

property LastError : HResult


property Name : string

The Name of the stream.

property ParentStorage : TStorage

The storage whgich contains this stream.

Events

Variables

FName : string;


FParent : TStorage;


FThis : IStream;


hr : HResult;



Constructors


constructor CloneFrom(CDStream : TStorageStream);

Constructs a stream another stream such that both have } { live access to the same data but at different offsets. } { The initial offset matches that of the other stream. } { Changes written to one stream are immediately visible } { to the other.


constructor Create(Name : string; ParentStorage : TStorage; AccessMode : TAccessMode; CreateNew : boolean);

Creates (CreateNew = true) or opens (CreateNew = false) } { a stream within a storage. Fails if ParentStorage is } { nil. If creating a new stream, Name is null (''), a } { self-deleting temporary stream is created. } { Note that streams can only be opened for exclusivey.


Functions


destructor Destroy;

Closes the stream writing any changes to the parent } { storage.


function Read(var Buffer; Count : longint) : longint;


function Seek(Offset : longint; Origin : word) : longint;


function Write(const Buffer; Count : longint) : longint;


procedure CheckError(msg : string);


function GetName : string;


procedure SetSize(NewSize : longint);


Properties


property LastError : HResult


property Name : string

The Name of the stream. If the stream was created as } { temporary the actual name will be retrieved. Read-only.


property ParentStorage : TStorage

The storage whgich contains this stream. Read-only.


Events


Variables


FName : string;


FParent : TStorage;


FThis : IStream;


hr : HResult;