Tawara  0.1.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tawara::EBMLElement Class Reference

The EBML Header element. More...

#include <tawara/ebml_element.h>

Inheritance diagram for tawara::EBMLElement:
Inheritance graph
[legend]
Collaboration diagram for tawara::EBMLElement:
Collaboration graph
[legend]

Public Member Functions

 EBMLElement (std::string const &doc_type="tawara")
 Create a new Element. More...
 
virtual ~EBMLElement ()
 Destructor. More...
 
unsigned int version () const
 Get the EBML version. More...
 
unsigned int read_version () const
 Get the EBML read version. More...
 
unsigned int max_id_length () const
 Get the maximum ID length. More...
 
void max_id_length (unsigned int max_id_length)
 Set the maximum ID length. More...
 
unsigned int max_size_length () const
 Get the maximum size length. More...
 
void max_size_length (unsigned int max_size_length)
 Set the maximum size length. More...
 
std::string doc_type () const
 Get the document type. More...
 
void doc_type (std::string doc_type)
 Set the document type. More...
 
unsigned int doc_version () const
 Get the document type version. More...
 
void doc_version (unsigned int doc_version)
 Set the document type version. More...
 
unsigned int doc_read_version () const
 Get the minimum document type version to read. More...
 
void doc_read_version (unsigned int doc_read_version)
 Set the minimum required document type version. More...
 
virtual std::streamsize write_body (std::ostream &output)
 Element body writing. More...
 
- Public Member Functions inherited from tawara::MasterElement
 MasterElement (uint32_t id, bool crc=false)
 Create a new MasterElement. More...
 
virtual ~MasterElement ()
 Destructor. More...
 
- Public Member Functions inherited from tawara::Element
 Element (tawara::ids::ID id)
 Create a new Element. More...
 
virtual ~Element ()
 Destructor. More...
 
uint32_t id () const
 Get the element's ID. More...
 
std::streampos offset () const
 Get the element's offset in the byte stream. More...
 
virtual std::streamsize size () const
 Get the total size of the element. More...
 
virtual std::streamsize write (std::ostream &output)
 Element writing. More...
 
virtual std::streamsize read (std::istream &input)
 Element reading. More...
 

Protected Member Functions

virtual std::streamsize body_size () const
 Get the size of the body of this element. More...
 
virtual std::streamsize read_body (std::istream &input, std::streamsize size)
 Element body loading. More...
 
void set_defaults_ ()
 Sets all child elements to their default values. More...
 
- Protected Member Functions inherited from tawara::Element
std::streamsize write_id (std::ostream &output)
 Element ID writing. More...
 
virtual std::streamsize write_size (std::ostream &output)
 Element size writing. More...
 

Protected Attributes

UIntElement ver_
 EBML version. More...
 
UIntElement read_ver_
 EBML minimum-version-to-read. More...
 
UIntElement max_id_length_
 Maximum ID length in bytes. More...
 
UIntElement max_size_length_
 Maximum size length in bytes. More...
 
StringElement doc_type_
 EBML document type. More...
 
UIntElement doc_type_ver_
 Document type version. More...
 
UIntElement doc_type_read_ver_
 Minimum document type version necessary to read. More...
 
- Protected Attributes inherited from tawara::Element
tawara::ids::ID id_
 
std::streampos offset_
 

Detailed Description

The EBML Header element.

This is the Header element as defined in the EBML RFC draft. It is required to be the first element in an EBML document.

The header defines various meta-data about the EBML document to follow.

Definition at line 63 of file ebml_element.h.

Constructor & Destructor Documentation

tawara::EBMLElement::EBMLElement ( std::string const &  doc_type = "tawara")

Create a new Element.

Parameters
[in]doc_typeThe DocType that will be created. When reading, if it is blank, it will be populated. If it is not blank, then the value in the file will be checked against the value specified here and IncorrectDocType will be thrown if they do not match.
virtual tawara::EBMLElement::~EBMLElement ( )
inlinevirtual

Destructor.

Definition at line 77 of file ebml_element.h.

Member Function Documentation

virtual std::streamsize tawara::EBMLElement::body_size ( ) const
protectedvirtual

Get the size of the body of this element.

Implements tawara::Element.

unsigned int tawara::EBMLElement::doc_read_version ( ) const
inline

Get the minimum document type version to read.

This is the minimum document type version that must be readable for a Tawara parser to read this file.

Definition at line 134 of file ebml_element.h.

void tawara::EBMLElement::doc_read_version ( unsigned int  doc_read_version)
inline

Set the minimum required document type version.

Definition at line 137 of file ebml_element.h.

std::string tawara::EBMLElement::doc_type ( ) const
inline

Get the document type.

The document type is the type of EBML document that is read or written.

Definition at line 118 of file ebml_element.h.

void tawara::EBMLElement::doc_type ( std::string  doc_type)
inline

Set the document type.

Definition at line 120 of file ebml_element.h.

unsigned int tawara::EBMLElement::doc_version ( ) const
inline

Get the document type version.

This is the version of the document type contained in the file.

Definition at line 125 of file ebml_element.h.

void tawara::EBMLElement::doc_version ( unsigned int  doc_version)
inline

Set the document type version.

Definition at line 127 of file ebml_element.h.

unsigned int tawara::EBMLElement::max_id_length ( ) const
inline

Get the maximum ID length.

This is the maximum length of IDs that can be used in a file with this header.

Definition at line 98 of file ebml_element.h.

void tawara::EBMLElement::max_id_length ( unsigned int  max_id_length)
inline

Set the maximum ID length.

Definition at line 101 of file ebml_element.h.

unsigned int tawara::EBMLElement::max_size_length ( ) const
inline

Get the maximum size length.

This is the maximum number of bytes that can be used for an element size in a file with this header.

Definition at line 108 of file ebml_element.h.

void tawara::EBMLElement::max_size_length ( unsigned int  max_size_length)
inline

Set the maximum size length.

Definition at line 111 of file ebml_element.h.

virtual std::streamsize tawara::EBMLElement::read_body ( std::istream &  input,
std::streamsize  size 
)
protectedvirtual

Element body loading.

Implements tawara::Element.

unsigned int tawara::EBMLElement::read_version ( ) const
inline

Get the EBML read version.

This property gives the minimum EBML parser version necessary to read the file. It is set internally by the Tawara EBML parser, and read from the file.

Definition at line 92 of file ebml_element.h.

void tawara::EBMLElement::set_defaults_ ( )
protected

Sets all child elements to their default values.

unsigned int tawara::EBMLElement::version ( ) const
inline

Get the EBML version.

The EBML version is the version of the parser used to create the file. It is set internally by the Tawara EBML parser, and read from the file.

Definition at line 85 of file ebml_element.h.

virtual std::streamsize tawara::EBMLElement::write_body ( std::ostream &  output)
virtual

Element body writing.

Implements tawara::Element.

Member Data Documentation

StringElement tawara::EBMLElement::doc_type_
protected

EBML document type.

Definition at line 153 of file ebml_element.h.

UIntElement tawara::EBMLElement::doc_type_read_ver_
protected

Minimum document type version necessary to read.

Definition at line 157 of file ebml_element.h.

UIntElement tawara::EBMLElement::doc_type_ver_
protected

Document type version.

Definition at line 155 of file ebml_element.h.

UIntElement tawara::EBMLElement::max_id_length_
protected

Maximum ID length in bytes.

Definition at line 149 of file ebml_element.h.

UIntElement tawara::EBMLElement::max_size_length_
protected

Maximum size length in bytes.

Definition at line 151 of file ebml_element.h.

UIntElement tawara::EBMLElement::read_ver_
protected

EBML minimum-version-to-read.

Definition at line 147 of file ebml_element.h.

UIntElement tawara::EBMLElement::ver_
protected

EBML version.

Definition at line 145 of file ebml_element.h.


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