C# Class Microsoft.CodeAnalysis.Sarif.Converters.SparseReader

A Fast XML Reader that reads only the requested entities and uses delegates to create objects along the way
Inheritance: IDisposable
Exibir arquivo Open project: Microsoft/sarif-sdk Class Usage Examples

Public Methods

Method Description
CreateFromStream ( SparseReaderDispatchTable dispatchTable, Stream stream ) : SparseReader

Creates a new SparseReader pointing to a System.IO.Stream rather than a System.Xml.XmlReader.

CreateFromStream ( SparseReaderDispatchTable dispatchTable, Stream stream, XmlSchemaSet schemaSet ) : SparseReader

Creates a new SparseReader pointing to a System.IO.Stream rather than a System.Xml.XmlReader.

Dispose ( ) : void

Destroys this SparseReader (and the underlying _xmlReader).

ReadAttributeBool ( string attributeName ) : bool?

Reads an attribute value as a boolean.

ReadAttributeInt ( string attributeName ) : int?

Reads an attribute value as an integer.

ReadAttributeString ( string attributeName ) : string

Reads an attribute value as a string.

ReadChildren ( string tagName, object parent ) : void

Reads the children of M:XmlReader.

ReadElementContentAsDouble ( ) : double

Reads the current element's content as a double and consumes the element.

ReadElementContentAsDoubleOrDefault ( ) : double

Attempts to the current element's content as a double and consumes the element.

ReadElementContentAsInt32 ( ) : int

Reads the current element's content as an integer and consumes the element.

ReadElementContentAsInt32OrDefault ( ) : int

Read's the current element's content and attempts to convert it to an integer. Consumes the element.

ReadElementContentAsString ( ) : string

Reads the current element's content as a string and consumes the element.

Skip ( ) : void

Skips the element on which this SparseReader is currently positioned.

SparseReader ( SparseReaderDispatchTable dispatchTable, XmlReader xmlReader ) : System

Initializes a new instance of the SparseReader class.

Private Methods

Method Description
IsEndState ( string expectedTagName ) : bool
IsMatchingState ( string expectedTagName, bool isStartState = true ) : bool
ReadEndElement ( string expectedTagName ) : void
ReadStartElement ( ) : void

Method Details

CreateFromStream() public static method

Creates a new SparseReader pointing to a System.IO.Stream rather than a System.Xml.XmlReader.
public static CreateFromStream ( SparseReaderDispatchTable dispatchTable, Stream stream ) : SparseReader
dispatchTable SparseReaderDispatchTable The dispatch table used to fire delegates for XML elements on /// this instance.
stream Stream The stream from which XML shall be retrieved. The SparseReader takes /// ownership of this stream and is responsible for destroying it.
return SparseReader

CreateFromStream() public static method

Creates a new SparseReader pointing to a System.IO.Stream rather than a System.Xml.XmlReader.
public static CreateFromStream ( SparseReaderDispatchTable dispatchTable, Stream stream, XmlSchemaSet schemaSet ) : SparseReader
dispatchTable SparseReaderDispatchTable The dispatch table used to fire delegates for XML elements on /// this instance.
stream Stream The stream from which XML shall be retrieved. The SparseReader takes /// ownership of this stream and is responsible for destroying it.
schemaSet System.Xml.Schema.XmlSchemaSet The xml schema to validate the input against
return SparseReader

Dispose() public method

Destroys this SparseReader (and the underlying _xmlReader).
public Dispose ( ) : void
return void

ReadAttributeBool() public method

Reads an attribute value as a boolean.
public ReadAttributeBool ( string attributeName ) : bool?
attributeName string Name of the attribute to read.
return bool?

ReadAttributeInt() public method

Reads an attribute value as an integer.
public ReadAttributeInt ( string attributeName ) : int?
attributeName string Name of the attribute to read.
return int?

ReadAttributeString() public method

Reads an attribute value as a string.
public ReadAttributeString ( string attributeName ) : string
attributeName string Name of the attribute to read.
return string

ReadChildren() public method

Reads the children of M:XmlReader.
public ReadChildren ( string tagName, object parent ) : void
tagName string Name of the tag.
parent object The parent.
return void

ReadElementContentAsDouble() public method

Reads the current element's content as a double and consumes the element.
public ReadElementContentAsDouble ( ) : double
return double

ReadElementContentAsDoubleOrDefault() public method

Attempts to the current element's content as a double and consumes the element.
public ReadElementContentAsDoubleOrDefault ( ) : double
return double

ReadElementContentAsInt32() public method

Reads the current element's content as an integer and consumes the element.
public ReadElementContentAsInt32 ( ) : int
return int

ReadElementContentAsInt32OrDefault() public method

Read's the current element's content and attempts to convert it to an integer. Consumes the element.
public ReadElementContentAsInt32OrDefault ( ) : int
return int

ReadElementContentAsString() public method

Reads the current element's content as a string and consumes the element.
public ReadElementContentAsString ( ) : string
return string

Skip() public method

Skips the element on which this SparseReader is currently positioned.
public Skip ( ) : void
return void

SparseReader() public method

Initializes a new instance of the SparseReader class.
public SparseReader ( SparseReaderDispatchTable dispatchTable, XmlReader xmlReader ) : System
dispatchTable SparseReaderDispatchTable The dispatch table used to fire delegates for XML elements on /// this instance.
xmlReader XmlReader The reader from which XML shall be retrieved. This SparseReader takes /// ownership of this XML reader and destroys it upon destruction.
return System