OpenQuizz
Une application de gestion des contenus pédagogiques
HTMLUnicodeInputStream Class Reference
Inheritance diagram for HTMLUnicodeInputStream:
Collaboration diagram for HTMLUnicodeInputStream:

Public Member Functions

def __init__ (self, source)
 
def reset (self)
 
def openStream (self, source)
 
def position (self)
 
def char (self)
 
def readChunk (self, chunkSize=None)
 
def characterErrorsUCS4 (self, data)
 
def characterErrorsUCS2 (self, data)
 
def charsUntil (self, characters, opposite=False)
 
def unget (self, char)
 

Data Fields

 reportCharacterErrors
 
 newLines
 
 charEncoding
 
 dataStream
 
 chunk
 
 chunkSize
 
 chunkOffset
 
 errors
 
 prevNumLines
 
 prevNumCols
 

Detailed Description

Provides a unicode stream of characters to the HTMLTokenizer.

This class takes care of character encoding and removing or replacing
incorrect byte-sequences and also provides column and line tracking.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  source 
)
Initialises the HTMLInputStream.

HTMLInputStream(source, [encoding]) -> Normalized stream from source
for use by html5lib.

source can be either a file-object, local filename or a string.

The optional encoding parameter must be a string that indicates
the encoding.  If specified, that encoding will be used,
regardless of any BOM or later declaration (such as in a meta
element)

Member Function Documentation

◆ char()

def char (   self)
Read one character from the stream or queue if available. Return
    EOF when EOF is reached.

◆ characterErrorsUCS2()

def characterErrorsUCS2 (   self,
  data 
)

◆ characterErrorsUCS4()

def characterErrorsUCS4 (   self,
  data 
)

◆ charsUntil()

def charsUntil (   self,
  characters,
  opposite = False 
)
Returns a string of characters from the stream up to but not
including any character in 'characters' or EOF. 'characters' must be
a container that supports the 'in' method and iteration over its
characters.

◆ openStream()

def openStream (   self,
  source 
)
Produces a file object from source.

source can be either a file object, local filename or a string.

Reimplemented in HTMLBinaryInputStream.

◆ position()

def position (   self)
Returns (line, col) of the current position in the stream.

◆ readChunk()

def readChunk (   self,
  chunkSize = None 
)

◆ reset()

def reset (   self)

Reimplemented in HTMLBinaryInputStream.

◆ unget()

def unget (   self,
  char 
)

Field Documentation

◆ charEncoding

charEncoding

◆ chunk

chunk

◆ chunkOffset

chunkOffset

◆ chunkSize

chunkSize

◆ dataStream

dataStream

◆ errors

errors

◆ newLines

newLines

◆ prevNumCols

prevNumCols

◆ prevNumLines

prevNumLines

◆ reportCharacterErrors

reportCharacterErrors

The documentation for this class was generated from the following file: