Skip to content

Latest commit

 

History

History
287 lines (172 loc) · 11 KB

File metadata and controls

287 lines (172 loc) · 11 KB

Trifling.Common

BoxedByteArrayComparer

A comparer for comparing the content of two byte arrays.

Compare(x, y)

Compares two objects as byte arrays and returns their relative position.

Name Description
x System.Object
The first byte array to compare.
y System.Object
The second byte array to compare.

Returns

Returns -1 if x is before y. Returns 0 if they are equal. Otherwise returns 1.

Default

Gets the default instance of the BoxedByteArrayComparer.

ByteArrayComparer

A comparer for comparing the content of two byte arrays.

Compare(a, b)

Compares two objects as byte arrays and returns their relative position.

Name Description
a System.Byte[]
The first byte array to compare.
b System.Byte[]
The second byte array to compare.

Returns

Returns -1 if a is before b. Returns 0 if they are equal. Otherwise returns 1.

Default

Gets the default instance of the ByteArrayComparer.

CompressorConfiguration

The configuration options for the compressor implementation.

Constructor

Initialises a new instance of the CompressorConfiguration class with the default options.

Remarks

Default CompressorConfiguration.MinimumSizeToCompress is 200 and default CompressorConfiguration.CompressionLevel is Fastest.

Constructor(minimumSizeToCompress, compressionLevel)

Initialises a new instance of the CompressorConfiguration class with the given property values.

Name Description
minimumSizeToCompress System.Int32
The minimum input size which will be considered valid for compression. Any value less than this value will not be compressed but will be returned unchanged.
compressionLevel System.IO.Compression.CompressionLevel
The level of compression that the implementation will use when performing the compression.

CompressionLevel

Gets or sets the level of compression that the implementation will use when performing the compression.

Equals(obj)

Determines, based on property values, whether or not this instance equals the given instance.

Name Description
obj System.Object
The instance to which the current instance is being compared.

Returns

Returns true if both have the same values, otherwise false.

Equals(other)

Determines, based on property values, whether or not this instance equals the given instance.

Name Description
other Trifling.Compression.CompressorConfiguration
The instance to which the current instance is being compared.

Returns

Returns true if both have the same values, otherwise false.

GetHashCode

Calculates the hash code for this instance based on the values of the properties.

Returns

Returns an integer hash code.

MinimumSizeToCompress

Gets or sets the minimum input size which will be considered valid for compression. Any value less than this value will not be compressed but will be returned unchanged.

LoggingTextWriter

Provides a System.IO.TextWriter to write text to a Microsoft.Extensions.Logging.ILogger.

Constructor(targetLogger, outputLogLevel)

Initialises a new instance of the LoggingTextWriter class with the given instance of a target logger to receive written messages.

Name Description
targetLogger Microsoft.Extensions.Logging.ILogger
An instance of an Microsoft.Extensions.Logging.ILogger to which log entries are written.
outputLogLevel Microsoft.Extensions.Logging.LogLevel
The log level at which all output log entries will be written. Default: Trace.

buffer

A short-term buffer of characters not yet written to the target logger.

ClearBuffer

Clears the current buffer of characters waiting to be logged.

Dispose(disposing)

Flushes any buffered values to the target logger before disposing of this object.

Name Description
disposing System.Boolean
Indicator of whether this is final disposal.

Encoding

Gets the encoding used for this text writer (Unicode).

Flush

Flushes the current buffer contents to the target logger.

FlushAsync

Asynchronously flushes the current buffer contents to the target logger.

Returns

Returns a System.Threading.Tasks.Task for the flush operation.

FormatProvider

Gets the format provider used for string formatting (Invariant).

previousWasNewline

Indicates if the previous character received was a newline character. Multiple newline characters are ignored.

Write(value)

Writes a character to the buffer before it is written out to the target logger. The buffer is written whenever newline characters are encountered or when on of the many LoggingTextWriter.WriteLine methods are called.

Name Description
value System.Char
The character value to write to the logger.

Write(format, arg0, arg1, arg2)

Writes a formatted value to the buffer before it is written out to the target logger. The buffer is written when on of the many LoggingTextWriter.WriteLine methods are called.

Name Description
format System.String
The format string to write.
arg0 System.Object
The first argument to substitute in the format string.
arg1 System.Object
The second argument to substitute in the format string.
arg2 System.Object
The third argument to substitute in the format string.

Write(format, arg0, arg1)

Writes a formatted value to the buffer before it is written out to the target logger. The buffer is written when on of the many LoggingTextWriter.WriteLine methods are called.

Name Description
format System.String
The format string to write.
arg0 System.Object
The first argument to substitute in the format string.
arg1 System.Object
The second argument to substitute in the format string.

Write(format, arg0)

Writes a formatted value to the buffer before it is written out to the target logger. The buffer is written when on of the many LoggingTextWriter.WriteLine methods are called.

Name Description
format System.String
The format string to write.
arg0 System.Object
An argument to substitute in the format string.

Write(format, arg)

Writes a formatted value to the buffer before it is written out to the target logger. The buffer is written when on of the many LoggingTextWriter.WriteLine methods are called.

Name Description
format System.String
The format string to write.
arg System.Object[]
All of the arguments to substitute in the format string.

Write(value)

Writes a string value to the buffer before it is written out to the target logger. The buffer is written when on of the many LoggingTextWriter.WriteLine methods are called.

Name Description
value System.String
The unformatted string value to write to the log.

WriteBuffer

Writes the current content of the buffer to the target logger with the logging level defined in LoggingTextWriter._outputLogLevel.

WriteLine

Writes the current contents of the buffer to the target logger. If the buffer is empty then no log entry is written to the target logger.

WriteLine(format, arg0, arg1, arg2)

Writes the current contents of the buffer (with the given formatted string appended) to the target logger. If the string is empty then nothing is written to the target logger.

Name Description
format System.String
The format string to write.
arg0 System.Object
The first argument to substitute in the format string.
arg1 System.Object
The second argument to substitute in the format string.
arg2 System.Object
The third argument to substitute in the format string.

WriteLine(format, arg0, arg1)

Writes the current contents of the buffer (with the given formatted string appended) to the target logger. If the string is empty then nothing is written to the target logger.

Name Description
format System.String
The format string to write.
arg0 System.Object
The first argument to substitute in the format string.
arg1 System.Object
The second argument to substitute in the format string.

WriteLine(format, arg0)

Writes the current contents of the buffer (with the given formatted string appended) to the target logger. If the string is empty then nothing is written to the target logger.

Name Description
format System.String
The format string to write.
arg0 System.Object
An argument to substitute in the format string.

WriteLine(format, arg)

Writes the current contents of the buffer (with the given formatted string appended) to the target logger. If the string is empty then nothing is written to the target logger.

Name Description
format System.String
The format string to write.
arg System.Object[]
All arguments to substitute in the format string.

WriteLine(value)

Writes the current contents of the buffer (with the given unformatted string appended) to the target logger. If the string is empty then nothing is written to the target logger.

Name Description
value System.String
The unformatted string value to write to the logger.

WriteString(format, args)

Writes a full formatted string to the target logger with the logging level defined in LoggingTextWriter._outputLogLevel.

Name Description
format System.String
The format string which defines where the args will appear in the string.
args System.Object[]
The argument values used when constructing a format string.

WriteString(value)

Writes an unformatted string to the target logger with the logging level defined in LoggingTextWriter._outputLogLevel.

Name Description
value System.String
The unformatted string value to write to the logger.