C# Class SIL.Utils.TextWriterStream

Implementation of the COM IStream interface that wraps a C# TextWriter object. This is useful for calling the ITsString.WriteAsXml method from C# code.
Inheritance: IStream
Afficher le fichier Open project: sillsdev/FieldWorks Class Usage Examples

Méthodes publiques

Méthode Description
Clone ( IStream &pstm ) : void

Creates a new stream object with its own seek pointer that references the same bytes as the original stream.

Commit ( int grfCommitFlags ) : void

Ensures that any changes made to a stream object opened in transacted mode are reflected in the parent storage object. If the stream object is opened in direct mode, this method has no effect other than flushing all memory buffers to the next level storage object. The OLE compound file implementation of streams does not support opening streams in transacted mode.

CopyTo ( IStream pstm, long cb, System pcbRead, System pcbWritten ) : void

Copies a specified number of bytes from the current seek pointer in the stream to the current seek pointer in another stream.

LockRegion ( System.Int64 libOffset, System.Int64 cb, int dwLockType ) : void

Restricts access to a specified range of bytes in the stream. Supporting this functionality is optional because some file systems do not provide it.

Read ( byte pv, int cb, System pcbRead ) : void

Reads a specified number of bytes from the stream object into memory, starting at the current seek pointer.

Revert ( ) : void

Discards all changes that have been made to a transacted stream since the last IStream::Commit call. This method has no effect on streams open in direct mode and streams using the OLE compound file implementation of IStream::Revert.

Seek ( long dlibMove, int dwOrigin, System plibNewPosition ) : void

Changes the seek pointer to a new location relative to the current seek pointer or the beginning or end of the stream.

SetSize ( long libNewSize ) : void

Resizes of the stream object.

Stat ( STATSTG &pstatstg, int grfStatFlag ) : void

Retrieves the STATSTG structure for this stream object.

TextWriterStream ( TextWriter writer ) : System

Constructor.

UnlockRegion ( long libOffset, long cb, int dwLockType ) : void

Removes the access restriction on a range of bytes previously restricted with IStream::LockRegion.

Write ( byte pv, int cb, System pcbWritten ) : void

Writes a specified number of bytes into the stream object starting at the current seek pointer.

Method Details

Clone() public méthode

Creates a new stream object with its own seek pointer that references the same bytes as the original stream.
public Clone ( IStream &pstm ) : void
pstm IStream
Résultat void

Commit() public méthode

Ensures that any changes made to a stream object opened in transacted mode are reflected in the parent storage object. If the stream object is opened in direct mode, this method has no effect other than flushing all memory buffers to the next level storage object. The OLE compound file implementation of streams does not support opening streams in transacted mode.
public Commit ( int grfCommitFlags ) : void
grfCommitFlags int
Résultat void

CopyTo() public méthode

Copies a specified number of bytes from the current seek pointer in the stream to the current seek pointer in another stream.
public CopyTo ( IStream pstm, long cb, System pcbRead, System pcbWritten ) : void
pstm IStream
cb long
pcbRead System
pcbWritten System
Résultat void

LockRegion() public méthode

Restricts access to a specified range of bytes in the stream. Supporting this functionality is optional because some file systems do not provide it.
public LockRegion ( System.Int64 libOffset, System.Int64 cb, int dwLockType ) : void
libOffset System.Int64
cb System.Int64
dwLockType int
Résultat void

Read() public méthode

Reads a specified number of bytes from the stream object into memory, starting at the current seek pointer.
public Read ( byte pv, int cb, System pcbRead ) : void
pv byte
cb int
pcbRead System
Résultat void

Revert() public méthode

Discards all changes that have been made to a transacted stream since the last IStream::Commit call. This method has no effect on streams open in direct mode and streams using the OLE compound file implementation of IStream::Revert.
public Revert ( ) : void
Résultat void

Seek() public méthode

Changes the seek pointer to a new location relative to the current seek pointer or the beginning or end of the stream.
public Seek ( long dlibMove, int dwOrigin, System plibNewPosition ) : void
dlibMove long
dwOrigin int
plibNewPosition System
Résultat void

SetSize() public méthode

Resizes of the stream object.
public SetSize ( long libNewSize ) : void
libNewSize long
Résultat void

Stat() public méthode

Retrieves the STATSTG structure for this stream object.
public Stat ( STATSTG &pstatstg, int grfStatFlag ) : void
pstatstg System.Runtime.InteropServices.ComTypes.STATSTG
grfStatFlag int
Résultat void

TextWriterStream() public méthode

Constructor.
public TextWriterStream ( TextWriter writer ) : System
writer System.IO.TextWriter
Résultat System

UnlockRegion() public méthode

Removes the access restriction on a range of bytes previously restricted with IStream::LockRegion.
public UnlockRegion ( long libOffset, long cb, int dwLockType ) : void
libOffset long
cb long
dwLockType int
Résultat void

Write() public méthode

Writes a specified number of bytes into the stream object starting at the current seek pointer.
public Write ( byte pv, int cb, System pcbWritten ) : void
pv byte
cb int
pcbWritten System
Résultat void