# eric7.EricXML.XMLStreamReaderBase

Module implementing a base class for all of eric7s XML stream writers.

### Global Attributes

None

### Classes

XMLStreamReaderBase | Class implementing a base class for all of eric7s XML stream readers.

### Functions

None

## XMLStreamReaderBase

Class implementing a base class for all of eric7s XML stream readers.

### Derived from

QXmlStreamReader

### Class Attributes

None

### Class Methods

None

### Methods

XMLStreamReaderBase | Constructor
__readDict | Private method to read a Python dictionary.
__readFrozenset | Private method to read a Python frozenset.
__readList | Private method to read a Python list.
__readSet | Private method to read a Python set.
__readTuple | Private method to read a Python tuple.
_readBasics | Protected method to read an object of a basic Python type.
_skipUnknownElement | Protected method to skip over all unknown elements.
attribute | Public method to read the given attribute of the current tag.
raiseBadValue | Public method to raise an error for a bad value.
raiseUnexpectedStartTag | Public method to raise an error for an unexpected start tag.
raiseUnsupportedFormatVersion | Public method to raise an error for an unsupported file format version.
readXML | Public method to read and parse the XML document.
showErrorMessage | Public method to show an error message.
toBool | Public method to convert the given value to bool.

### Static Methods

None

#### XMLStreamReaderBase (Constructor)

XMLStreamReaderBase(device)

Constructor

device (QIODevice)
  reference to the I/O device to read from

#### XMLStreamReaderBase.__readDict

__readDict()

Private method to read a Python dictionary.

Return:
  Python dictionary

Return Type:
  dict

#### XMLStreamReaderBase.__readFrozenset

__readFrozenset()

Private method to read a Python frozenset.

Return:
  Python frozenset

Return Type:
  frozenset

#### XMLStreamReaderBase.__readList

__readList()

Private method to read a Python list.

Return:
  Python list

Return Type:
  list

#### XMLStreamReaderBase.__readSet

__readSet()

Private method to read a Python set.

Return:
  Python set

Return Type:
  set

#### XMLStreamReaderBase.__readTuple

__readTuple()

Private method to read a Python tuple.

Return:
  Python tuple

Return Type:
  tuple

#### XMLStreamReaderBase._readBasics

_readBasics()

Protected method to read an object of a basic Python type.

Return:
  Python object read

Return Type:
  Any

#### XMLStreamReaderBase._skipUnknownElement

_skipUnknownElement()

Protected method to skip over all unknown elements.

#### XMLStreamReaderBase.attribute

attribute(name, default="")

Public method to read the given attribute of the current tag.

name (str)
  name of the attribute
default (str)
  default value

Return:
  value of the requested tag attribute

Return Type:
  str

#### XMLStreamReaderBase.raiseBadValue

raiseBadValue(value)

Public method to raise an error for a bad value.

value (str)
  bad value

#### XMLStreamReaderBase.raiseUnexpectedStartTag

raiseUnexpectedStartTag(tag)

Public method to raise an error for an unexpected start tag.

tag (str)
  name of the unexpected tag

#### XMLStreamReaderBase.raiseUnsupportedFormatVersion

raiseUnsupportedFormatVersion(version)

Public method to raise an error for an unsupported file format version.

version (str)
  unsupported version

#### XMLStreamReaderBase.readXML

readXML()

Public method to read and parse the XML document.

#### XMLStreamReaderBase.showErrorMessage

showErrorMessage()

Public method to show an error message.

#### XMLStreamReaderBase.toBool

toBool(value)

Public method to convert the given value to bool.

value (str)
  value to be converted ("True", "False", "1", "0")

Return:
  converted value or None in case of an error

Return Type:
  bool

Up