C# Class Pchp.Core.BufferedOutput

Inheritance: System.IO.TextWriter
Afficher le fichier Open project: iolevel/peachpie Class Usage Examples

Méthodes publiques

Méthode Description
BufferedOutput ( bool enableBuffering, TextWriter charSink, Stream byteSink, Encoding encoding ) : System

Creates buffered output with specified sinks.

Clean ( ) : void

Discards data on the current level of buffering.

DecreaseLevel ( bool flush ) : int

Destroys the top level of buffering.

Returns the current level index after decreasing.

FindLevelByFilter ( Delegate filter ) : int

Find level index by the filter callback.

Flush ( ) : void

Flushes data on current level of buffering to sinks or to the previous level and discards them.

FlushAll ( ) : void

Flushes all data from all buffers to sinks. Discards all data and all levels of buffering. Disables output buffering.

GetContent ( ) : PhpValue

Gets a content of buffers on current buffering level.

GetContentAsString ( ) : string

Gets a content of buffers on current buffering level converted to string regardless of its type.

GetFilter ( ) : Delegate

Gets the filtering callback defined on the current level of buffering.

GetFilter ( int levelIndex ) : Delegate

Gets the filtering callback defined on the specified level of buffering.

GetLevelInfo ( int levelIndex, Delegate &filter, int &size ) : void

Gets some information about a specified level.

GetLevelName ( int levelIndex ) : string

Get the name of the level. If the level name is null, the filter.ToString() is used.

IncreaseLevel ( ) : int

Adds a new level of buffering on the top of the levels stack.

Returns the new level index.

SetFilter ( Delegate filter ) : void

Assignes the filtering callback to the current level of buffering.

Data are filtered when flushed.

SetFilter ( Delegate filter, int levelIndex ) : void

Assignes the filtering callback to the specified level of buffering.

Data are filtered when flushed.

SetLevelName ( int levelIndex, string levelName ) : void

Set the level name.

SetUserData ( object data ) : void

Assignes the arbitrary data to the current level of buffering.

Data are filtered when flushed.

SetUserData ( object data, int levelIndex ) : void

Assignes an arbitrary data to the specified level of buffering.

Data are filtered when flushed.

ThrowIfDisabled ( ) : void

Checks output buffer is not disabled.

Write ( char value ) : void

Writes a subarray of characters to the output buffer.

Write ( char value, int index, int count ) : void

Writes a subarray of characters to the output buffer.

Write ( string value ) : void

Writes a string value to the output buffer.

WriteBytes ( byte value ) : void

Writes an array of bytes to the output buffer.

WriteBytes ( byte value, int index, int count ) : void

Writes a subarray of bytes to the output buffer.

Private Methods

Méthode Description
AllocateBuffer ( int sizeNeeded, bool binary, System &buffer, int &position ) : int

Gets a buffer where data of requested size and type can be stored.

The buffer may already exist or new one may be created. Works on the current level of buffering.

InternalFlush ( ) : void

Flushes data on current level of buffering to the sinks or to the previous level. The current level clean up MUST follow this method's call.

WriteInternal ( Array value, bool binary, int index, int count ) : void

Writes a subarray to the output buffer.

Method Details

BufferedOutput() public méthode

Creates buffered output with specified sinks.
public BufferedOutput ( bool enableBuffering, TextWriter charSink, Stream byteSink, Encoding encoding ) : System
enableBuffering bool Whether to immediately enable buffering, i.e. increase the level.
charSink System.IO.TextWriter A writer through which character data will be written.
byteSink Stream A stream through which binary data will be written.
encoding System.Text.Encoding A encoding used to transform binary data to strings.
Résultat System

Clean() public méthode

Discards data on the current level of buffering.
public Clean ( ) : void
Résultat void

DecreaseLevel() public méthode

Destroys the top level of buffering.
Returns the current level index after decreasing.
public DecreaseLevel ( bool flush ) : int
flush bool Whether to flush data on the current level. Data will be discarded if not set.
Résultat int

FindLevelByFilter() public méthode

Find level index by the filter callback.
public FindLevelByFilter ( Delegate filter ) : int
filter System.Delegate
Résultat int

Flush() public méthode

Flushes data on current level of buffering to sinks or to the previous level and discards them.
public Flush ( ) : void
Résultat void

FlushAll() public méthode

Flushes all data from all buffers to sinks. Discards all data and all levels of buffering. Disables output buffering.
public FlushAll ( ) : void
Résultat void

GetContent() public méthode

Gets a content of buffers on current buffering level.
public GetContent ( ) : PhpValue
Résultat PhpValue

GetContentAsString() public méthode

Gets a content of buffers on current buffering level converted to string regardless of its type.
public GetContentAsString ( ) : string
Résultat string

GetFilter() public méthode

Gets the filtering callback defined on the current level of buffering.
Output buffering is disabled.
public GetFilter ( ) : Delegate
Résultat System.Delegate

GetFilter() public méthode

Gets the filtering callback defined on the specified level of buffering.
is out of range.
public GetFilter ( int levelIndex ) : Delegate
levelIndex int The level of buffering which the filter to associate with.
Résultat System.Delegate

GetLevelInfo() public méthode

Gets some information about a specified level.
public GetLevelInfo ( int levelIndex, Delegate &filter, int &size ) : void
levelIndex int Level index starting from 1.
filter System.Delegate Filtering callback (if any).
size int Data size.
Résultat void

GetLevelName() public méthode

Get the name of the level. If the level name is null, the filter.ToString() is used.
public GetLevelName ( int levelIndex ) : string
levelIndex int Index of the level from 1.
Résultat string

IncreaseLevel() public méthode

Adds a new level of buffering on the top of the levels stack.
Returns the new level index.
public IncreaseLevel ( ) : int
Résultat int

SetFilter() public méthode

Assignes the filtering callback to the current level of buffering.
Data are filtered when flushed.
Output buffering is disabled.
public SetFilter ( Delegate filter ) : void
filter System.Delegate The filter. Null reference means no filter.
Résultat void

SetFilter() public méthode

Assignes the filtering callback to the specified level of buffering.
Data are filtered when flushed.
is out of range.
public SetFilter ( Delegate filter, int levelIndex ) : void
filter System.Delegate The filter. Null reference means no filter.
levelIndex int The level of buffering which the filter to associate with.
Résultat void

SetLevelName() public méthode

Set the level name.
public SetLevelName ( int levelIndex, string levelName ) : void
levelIndex int Index of the level from 1.
levelName string New name of the level.
Résultat void

SetUserData() public méthode

Assignes the arbitrary data to the current level of buffering.
Data are filtered when flushed.
public SetUserData ( object data ) : void
data object The reference to data.
Résultat void

SetUserData() public méthode

Assignes an arbitrary data to the specified level of buffering.
Data are filtered when flushed.
public SetUserData ( object data, int levelIndex ) : void
data object Null reference clears assigned data.
levelIndex int The level of buffering which the filter to associate with.
Résultat void

ThrowIfDisabled() public méthode

Checks output buffer is not disabled.
When buffering is disabled ( is null).
public ThrowIfDisabled ( ) : void
Résultat void

Write() public méthode

Writes a subarray of characters to the output buffer.
public Write ( char value ) : void
value char Characters to be written.
Résultat void

Write() public méthode

Writes a subarray of characters to the output buffer.
public Write ( char value, int index, int count ) : void
value char The value to be written.
index int Starting index in the array.
count int The number of characters to write.
Résultat void

Write() public méthode

Writes a string value to the output buffer.
public Write ( string value ) : void
value string The value to be written.
Résultat void

WriteBytes() public méthode

Writes an array of bytes to the output buffer.
public WriteBytes ( byte value ) : void
value byte Bytes to be written.
Résultat void

WriteBytes() public méthode

Writes a subarray of bytes to the output buffer.
public WriteBytes ( byte value, int index, int count ) : void
value byte Bytes to be written.
index int Starting index in the array.
count int The number of characters to write.
Résultat void