libSBML C# API  libSBML 5.10.0 C# API
 All Classes Namespaces Files Functions Variables Properties Pages
libsbmlcs.XMLInputStream Class Reference
Inheritance diagram for libsbmlcs.XMLInputStream:
[legend]

Detailed Description

{core}

An interface to an XML input stream.

Public Member Functions

long determineNumberChildren (string elementName)
 Analyses the tokens in the stream and returns the number of child tokens of the given element. More...
 
long determineNumberChildren ()
 Analyses the tokens in the stream and returns the number of child tokens of the given element. More...
 
long determineNumSpecificChildren (string childName, string container)
 Analyses the tokens in the stream and returns the number of child tokens of the specified type within the given element. More...
 
virtual void Dispose ()
 
string getEncoding ()
 Returns the encoding of the XML stream. More...
 
XMLErrorLog getErrorLog ()
 Returns an XMLErrorLog which can be used to log XML parse errors and other validation errors (and messages). More...
 
SBMLNamespaces getSBMLNamespaces ()
 Returns the SBMLNamespaces object attached to this XMLInputStream if it has been set, null otherwise. More...
 
string getVersion ()
 Returns the version of the XML stream. More...
 
bool isEOF ()
 Returns true if end of file (stream) has been reached, false otherwise. More...
 
bool isError ()
 Returns true if a fatal error occurred while reading from this stream. More...
 
bool isGood ()
 Returns true if the stream is in a good state (i.e. More...
 
XMLToken next ()
 Consumes the next XMLToken and return it. More...
 
XMLToken peek ()
 Returns the next XMLToken without consuming it. More...
 
int setErrorLog (XMLErrorLog log)
 Sets the XMLErrorLog this stream will use to log errors. More...
 
void setSBMLNamespaces (SBMLNamespaces sbmlns)
 Sets the SBMLNamespaces object to allow this stream to reference the available SBML namespaces being read. More...
 
void skipPastEnd (XMLToken element)
 Consume zero or more XMLTokens up to and including the corresponding end XML element or EOF. More...
 
void skipText ()
 Consume zero or more XMLTokens up to but not including the next XML element or EOF. More...
 
string toString ()
 Prints a string representation of the underlying token stream, for debugging purposes. More...
 
 XMLInputStream (string content, bool isFile, string library, XMLErrorLog errorLog)
 Creates a new XMLInputStream. More...
 
 XMLInputStream (string content, bool isFile, string library)
 Creates a new XMLInputStream. More...
 
 XMLInputStream (string content, bool isFile)
 Creates a new XMLInputStream. More...
 
 XMLInputStream (string content)
 Creates a new XMLInputStream. More...
 

Protected Attributes

bool swigCMemOwn
 

Constructor & Destructor Documentation

libsbmlcs.XMLInputStream.XMLInputStream ( string  content,
bool  isFile,
string  library,
XMLErrorLog  errorLog 
)

Creates a new XMLInputStream.

content the source of the stream.

isFile bool flag to indicate whether content is a file name. If true, content is assumed to be the file from which the XML content is to be read. If false, content is taken to be a string that is the content to be read.

library the name of the parser library to use.

errorLog the XMLErrorLog object to use.

libsbmlcs.XMLInputStream.XMLInputStream ( string  content,
bool  isFile,
string  library 
)

Creates a new XMLInputStream.

content the source of the stream.

isFile bool flag to indicate whether content is a file name. If true, content is assumed to be the file from which the XML content is to be read. If false, content is taken to be a string that is the content to be read.

library the name of the parser library to use.

errorLog the XMLErrorLog object to use.

libsbmlcs.XMLInputStream.XMLInputStream ( string  content,
bool  isFile 
)

Creates a new XMLInputStream.

content the source of the stream.

isFile bool flag to indicate whether content is a file name. If true, content is assumed to be the file from which the XML content is to be read. If false, content is taken to be a string that is the content to be read.

library the name of the parser library to use.

errorLog the XMLErrorLog object to use.

libsbmlcs.XMLInputStream.XMLInputStream ( string  content)

Creates a new XMLInputStream.

content the source of the stream.

isFile bool flag to indicate whether content is a file name. If true, content is assumed to be the file from which the XML content is to be read. If false, content is taken to be a string that is the content to be read.

library the name of the parser library to use.

errorLog the XMLErrorLog object to use.

Member Function Documentation

long libsbmlcs.XMLInputStream.determineNumberChildren ( string  elementName)

Analyses the tokens in the stream and returns the number of child tokens of the given element.

Parameters
elementNamea string representing the name of the element for which the number of children are to be determined.

This function allows information from the input stream to be determined without the need to actually read and consume the tokens in the stream. This functionality is particularly utilized when reading MathML.

The function will return the number of child elements of the element represented by the elementName supplied, i.e. the number of child elements encountered before the closing tag for the elementname supplied. If the elementName has not been supplied then the function assumes that it is reading an apply element followed by a function element.

Note
This function assumes the stream has been read up to and including the element elementName.
Returns
a long integer giving the number of children of the element specified.
long libsbmlcs.XMLInputStream.determineNumberChildren ( )

Analyses the tokens in the stream and returns the number of child tokens of the given element.

Parameters
elementNamea string representing the name of the element for which the number of children are to be determined.

This function allows information from the input stream to be determined without the need to actually read and consume the tokens in the stream. This functionality is particularly utilized when reading MathML.

The function will return the number of child elements of the element represented by the elementName supplied, i.e. the number of child elements encountered before the closing tag for the elementname supplied. If the elementName has not been supplied then the function assumes that it is reading an apply element followed by a function element.

Note
This function assumes the stream has been read up to and including the element elementName.
Returns
a long integer giving the number of children of the element specified.
long libsbmlcs.XMLInputStream.determineNumSpecificChildren ( string  childName,
string  container 
)

Analyses the tokens in the stream and returns the number of child tokens of the specified type within the given element.

Parameters
childNamea string representing the name of the child element whose number is to be determined.
containera string representing the name of the element for which the number of children are to be determined.

This function allows information from the input stream to be determined without the need to actually read and consume the tokens in the stream. This functionality is particularly utilized when reading MathML.

The function will return the number of child elements of the element represented by the childName supplied within the element specified by the container, i.e. the number of child elements encountered before the closing tag for the container supplied.

Note
This function assumes the stream has been read up to and including the element container.
Returns
a long integer giving the number of children of type childName within the container element specified.
virtual void libsbmlcs.XMLInputStream.Dispose ( )
virtual
string libsbmlcs.XMLInputStream.getEncoding ( )

Returns the encoding of the XML stream.

Returns
the encoding of the XML stream.
XMLErrorLog libsbmlcs.XMLInputStream.getErrorLog ( )

Returns an XMLErrorLog which can be used to log XML parse errors and other validation errors (and messages).

Returns
an XMLErrorLog which can be used to log XML parse errors and other validation errors (and messages).
SBMLNamespaces libsbmlcs.XMLInputStream.getSBMLNamespaces ( )

Returns the SBMLNamespaces object attached to this XMLInputStream if it has been set, null otherwise.

Returns
the SBMLNamespaces object or null if none has been set.
string libsbmlcs.XMLInputStream.getVersion ( )

Returns the version of the XML stream.

Returns
the version of the XML stream.
bool libsbmlcs.XMLInputStream.isEOF ( )

Returns true if end of file (stream) has been reached, false otherwise.

Returns
true if end of file (stream) has been reached, false otherwise.
bool libsbmlcs.XMLInputStream.isError ( )

Returns true if a fatal error occurred while reading from this stream.

Returns
true if a fatal error occurred while reading from this stream.
bool libsbmlcs.XMLInputStream.isGood ( )

Returns true if the stream is in a good state (i.e.

isEOF() and isError() are both false), false otherwise.

Returns
true if the stream is in a good state (i.e. isEOF() and isError() are both false), false otherwise.
XMLToken libsbmlcs.XMLInputStream.next ( )

Consumes the next XMLToken and return it.

Returns
the next XMLToken or EOF (XMLToken.isEOF() == true).
XMLToken libsbmlcs.XMLInputStream.peek ( )

Returns the next XMLToken without consuming it.

A subsequent call to either peek() or next() will return the same token.

Returns
the next XMLToken or EOF (XMLToken.isEOF() == true).
int libsbmlcs.XMLInputStream.setErrorLog ( XMLErrorLog  log)

Sets the XMLErrorLog this stream will use to log errors.

Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
void libsbmlcs.XMLInputStream.setSBMLNamespaces ( SBMLNamespaces  sbmlns)

Sets the SBMLNamespaces object to allow this stream to reference the available SBML namespaces being read.

void libsbmlcs.XMLInputStream.skipPastEnd ( XMLToken  element)

Consume zero or more XMLTokens up to and including the corresponding end XML element or EOF.

void libsbmlcs.XMLInputStream.skipText ( )

Consume zero or more XMLTokens up to but not including the next XML element or EOF.

string libsbmlcs.XMLInputStream.toString ( )

Prints a string representation of the underlying token stream, for debugging purposes.

Member Data Documentation

bool libsbmlcs.XMLInputStream.swigCMemOwn
protected