EbmlMaster Class Reference

Handle all operations on an EBML element that contains other EBML elements. More...

#include <EbmlMaster.h>

Inheritance diagram for EbmlMaster:
Inheritance graph
[legend]
Collaboration diagram for EbmlMaster:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 EbmlMaster (const EbmlSemanticContext &aContext, bool bSizeIsKnown=true)
 EbmlMaster (const EbmlMaster &ElementToClone)
virtual bool ValidateSize () const
virtual ~EbmlMaster ()
filepos_t RenderData (IOCallback &output, bool bForceRender, bool bWithDefault=false)
filepos_t ReadData (IOCallback &input, ScopeMode ReadFully)
filepos_t UpdateSize (bool bWithDefault=false, bool bForceRender=false)
bool SetSizeInfinite (bool aIsInfinite=true)
 Set wether the size is finite (size is known in advance when writing, or infinite size is not known on writing).
bool PushElement (EbmlElement &element)
uint64 GetSize () const
 update the Size of the Data stored
uint64 GetDataStart () const
EbmlElementFindElt (const EbmlCallbacks &Callbacks) const
 find the element corresponding to the ID of the element, NULL if not found
EbmlElementFindFirstElt (const EbmlCallbacks &Callbacks, bool bCreateIfNull)
 find the first element corresponding to the ID of the element
EbmlElementFindFirstElt (const EbmlCallbacks &Callbacks) const
EbmlElementFindNextElt (const EbmlElement &PastElt, bool bCreateIfNull)
 find the element of the same type of PasElt following in the list of elements
EbmlElementFindNextElt (const EbmlElement &PastElt) const
EbmlElementAddNewElt (const EbmlCallbacks &Callbacks)
bool InsertElement (EbmlElement &element, size_t position=0)
 add an element at a specified location
bool InsertElement (EbmlElement &element, const EbmlElement &before)
void Read (EbmlStream &inDataStream, const EbmlSemanticContext &Context, int &UpperEltFound, EbmlElement *&FoundElt, bool AllowDummyElt, ScopeMode ReadFully=SCOPE_ALL_DATA)
 Read the data and keep the known children.
void Sort ()
 sort Data when they can
size_t ListSize () const
EBML_MASTER_ITERATOR begin ()
EBML_MASTER_ITERATOR end ()
EBML_MASTER_RITERATOR rbegin ()
EBML_MASTER_RITERATOR rend ()
EBML_MASTER_CONST_ITERATOR begin () const
EBML_MASTER_CONST_ITERATOR end () const
EBML_MASTER_CONST_RITERATOR rbegin () const
EBML_MASTER_CONST_RITERATOR rend () const
EbmlElementoperator[] (unsigned int position)
const EbmlElementoperator[] (unsigned int position) const
bool IsDefaultValue () const
virtual bool IsMaster () const
bool CheckMandatory () const
 verify that all mandatory elements are present
void Remove (size_t Index)
 Remove an element from the list of the master.
void Remove (EBML_MASTER_ITERATOR &Itr)
void Remove (EBML_MASTER_RITERATOR &Itr)
void RemoveAll ()
 remove all elements, even the mandatory ones
filepos_t WriteHead (IOCallback &output, int SizeLength, bool bWithDefault=false)
 facility for Master elements to write only the head and force the size later
void EnableChecksum (bool bIsEnabled=true)
bool HasChecksum () const
bool VerifyChecksum () const
uint32 GetCrc32 () const
void ForceChecksum (uint32 NewChecksum)
std::vector< std::string > FindAllMissingElements ()
 drill down all sub-elements, finding any missing elements

Protected Attributes

std::vector< EbmlElement * > ElementList
const EbmlSemanticContextContext
bool bChecksumUsed
EbmlCrc32 Checksum

Detailed Description

Handle all operations on an EBML element that contains other EBML elements.


Constructor & Destructor Documentation

EbmlMaster::~EbmlMaster (  )  [virtual]
Warning:
be carefull to clear the memory allocated in the ElementList elsewhere

Member Function Documentation

bool EbmlMaster::CheckMandatory (  )  const

verify that all mandatory elements are present

Note:
usefull after reading or before writing
EbmlElement * EbmlMaster::FindNextElt ( const EbmlElement PastElt,
bool  bCreateIfNull 
)

find the element of the same type of PasElt following in the list of elements

Todo:

only return elements that are from the same type !

the element might be the unique in the context !

bool EbmlMaster::PushElement ( EbmlElement element  ) 
Todo:
We might be able to forbid elements that don't exist in the context
void EbmlMaster::Read ( EbmlStream inDataStream,
const EbmlSemanticContext sContext,
int &  UpperEltFound,
EbmlElement *&  FoundElt,
bool  AllowDummyElt,
ScopeMode  ReadFully = SCOPE_ALL_DATA 
) [virtual]

Read the data and keep the known children.

Method to help reading a Master element and all subsequent children quickly.

Todo:

add an option to discard even unknown elements

handle when a mandatory element is not found

Reimplemented from EbmlElement.

filepos_t EbmlMaster::ReadData ( IOCallback input,
ScopeMode  ReadFully 
) [virtual]
Todo:
this code is very suspicious !

Implements EbmlElement.

filepos_t EbmlMaster::RenderData ( IOCallback output,
bool  bForceRender,
bool  bWithDefault = false 
) [virtual]
Todo:

handle exception on errors

write all the Mandatory elements in the Context, otherwise assert

Implements EbmlElement.

bool EbmlMaster::VerifyChecksum (  )  const

Todo:
remove the Checksum if it's in the list
Todo:
find another way when not all default values are saved or (unknown from the reader !!!)

filepos_t EbmlMaster::WriteHead ( IOCallback output,
int  SizeLength,
bool  bWithDefault = false 
)

facility for Master elements to write only the head and force the size later

Warning:

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Enumerator
Generated on Tue Jun 8 11:06:04 2010 for libebml by  doxygen 1.6.3