[Matroska-devel] EbmlMaster...

Steve Lhomme steve.lhomme at free.fr
Fri Jul 25 09:30:11 CEST 2003

> Hi.
> robux, I need a way to create an EbmlMaster, but that Master must not
> create its mandatory children. I need that for tag parsing.
> Now I've though about adding a "bool bCreateMandatory = false" to
> EbmlMaster's ctor, but that won't work with GetChild. Problem is that
> FindFirstElt uses the Create method to create the elements, which of
> course can't pass the bCreateMandatory through...
> Why do I need this?

The mandatory elements are created at every creation even if you don't want
them (enforce the law). If you don't want them after creation, just clear()
the list of elements. If a method to do this doesn't exist in EbmlMaster, it
can be created easily.

> Well when reading the XML document I create the elements on the fly. So
> e.g. I encounter <MultiDate>, <Date> and then <DateType>. When I've
> encountered <Data> I create a KaxTagDate. Later, when I encounter
> <DateType>, I use FindElt<KaxTagMultiDateType>(date) to see if such an
> element already exists. Of course it does - because it was automatically
> created. But I'd like to show my user a nice error message, like 'sorry,
> only one instance of DateType allowed under Date'. This is not possible
> now - or only with double book keeping on my side. This will enlarge my
> code by 150%, and I cannot do that before the release.

See above, if you create the elements manually, you could remove everything
after creation and start with that... Mandatory elements will still be
checked on writing.

More information about the Matroska-devel mailing list