Extensible Binary Meta Language (EBML) is a generalized file format for any kind of data, aiming to be a binary equivalent to XML. It provides a basic framework for storing data in XML-like tags.
SEbmlRead(path)
EBML data reader class. Create an Ebml reader object with a path to an EBML format file from which to read. The header of the file is read on successful opening of the file. The file is closed when the reader is deleted.
Parameters: | path (string) – Full path and file name of the file to read from. |
---|---|
Returns: | EBML data reader object. |
Return type: | SEbmlRead |
SEbmlRead.ebml_version | Get the EBML version of the file. |
SEbmlRead.reader_version | Get the EBML reader version of the file. |
SEbmlRead.max_id_width | Get the maximum ID width of the file. |
SEbmlRead.max_size_width | Get the maximum size width of the file. |
SEbmlRead.doc_type_version | Get the document type version of the file. |
SEbmlRead.doc_type_reader_version | Get the document type reader version of the file. |
SEbmlRead.doc_type(*args) | doctype() |
SEbmlRead.peek_id() | Peek the ID of the next element in the ebml data source. |
SEbmlRead.skip_element() | Skip the current ebml element. |
SEbmlRead.read_uint() | Read current element as an unsigned integer. |
SEbmlRead.read_sint() | Read current element as a signed integer. |
SEbmlRead.read_double() | Read current element as a double. |
SEbmlRead.read_str() | Read current element as a str. |
SEbmlRead.read_object() | Read current element as an object. |
SEbmlRead.open_container() | Open a container element and return it’s ID. |
SEbmlRead.container_exhausted() | Query if all of a currently open container’s elements have been read. |
Get the EBML version of the file. The version of EBML to which the document conforms to.
Returns: | EBML version. |
---|---|
Return type: | int |
Get the EBML reader version of the file. The minimum EBML version a parser has to support in order to read the document.
Returns: | EBML reader version. |
---|---|
Return type: | int |
Get the maximum ID width of the file. The maximum width of the IDs used in this document.
Returns: | maximum ID width. |
---|---|
Return type: | int |
Note : | Speect can not read EBML format file with a ID width greater than 4. |
Get the maximum size width of the file. The maximum width of the size descriptors used in this document.
Returns: | maximum size width. |
---|---|
Return type: | int |
Note : | Speect can not read EBML format file with a size width greater than 4. |
Get the document type version of the file. The version of document type to which the document conforms to.
Returns: | document type version. |
---|---|
Return type: | int |
Get the document type reader version of the file. The minimum doc_type_version version an interpreter has to support in order to read the document.
Returns: | document type reader version. |
---|---|
Return type: | int |
doctype()
Get the document type of the file. An ASCII string that identifies the type of the document.
Returns: | document type. |
---|---|
Return type: | string |
peek_id()
Peek the ID of the next element in the ebml data source.
Returns: | Ebml ID. |
---|---|
Return type: | int |
skip_element()
Skip the current ebml element.
read_uint()
Read current element as an unsigned integer.
Returns: | [ID, element] |
---|---|
Return type: | tuple |
read_sint()
Read current element as a signed integer.
Returns: | [ID, element] |
---|---|
Return type: | tuple |
read_double()
Read current element as a double.
Returns: | [ID, element] |
---|---|
Return type: | tuple |
read_str()
Read current element as a str.
Returns: | [ID, element] |
---|---|
Return type: | tuple |
read_object()
Read current element as an object.
Returns: | [ID, element] |
---|---|
Return type: | tuple |
Note : | The object must have an appropriate serialization formatter defined and registered for the spct_ebml format. If not, then the object can not be read. |
open_container()
Open a container element and return it’s ID.
Returns: | ID |
---|---|
Return type: | int |
container_exhausted()
Query if all of a currently open container’s elements have been read. Thus, if true then the container is ‘exhausted’.
Returns: | True of False. |
---|---|
Return type: | bool |
EBML data writer class. Create an Ebml writer object with a path to the file to write to and EBML header information. The header will be written to file. The file is closed when the reader is deleted.
Parameters: |
|
---|---|
Returns: | EBML data writer object. |
Return type: | SEbmlWrite |
Note : | Speect does not support max_id_width or max_size_width greater than 4. |
SEbmlWrite.write_uint(val, id) | Write an unsigned integer to the EBML data source. |
SEbmlWrite.write_sint(val, id) | Write an signed integer to the EBML data source. |
SEbmlWrite.write_double(val, id) | Write a double value to the EBML data source. |
SEbmlWrite.write_str(*args) | write_string(val, id) |
SEbmlWrite.write_object(val, id) | Write an object to the EBML data source. |
SEbmlWrite.start_container(id) | Start a container element with the given id. |
SEbmlWrite.end_container(id) | End (close) a previously started a container element. |
write_uint(val, id)
Write an unsigned integer to the EBML data source.
Parameters: |
|
---|
write_sint(val, id)
Write an signed integer to the EBML data source.
Parameters: |
|
---|
write_double(val, id)
Write a double value to the EBML data source.
Parameters: |
|
---|
write_string(val, id)
Write a string to the EBML data source.
Parameters: |
|
---|
write_object(val, id)
Write an object to the EBML data source.
Parameters: |
|
---|---|
Note : | The object must have an appropriate serialization formatter defined and registered for the spct_ebml format. If not, then the object can not be written. |
start_container(id)
Start a container element with the given id.
Parameters: | id (int) – The ID of the container. |
---|
end_container(id)
End (close) a previously started a container element.