|
libebml_ng
|
Abstract base class for EBML master element instances.This class provides the functionality to manage child elements, perform encoding/decoding, and traverse child elements through iterators. It uses CRTP to enable type safety. More...
#include <ebmlMasterElement.h>
Classes | |
| class | _const_iterator |
| class | _iterator |
| class | const_iterator |
| class | iterator |
Public Member Functions | |
| size_t | dataSize () const |
| sizetree_t | sizetree () const |
| Generates the size tree for the element hierarchy. More... | |
| size_t | encode (char *, const sizetree_t &) const |
| Encodes the element using a precomputed size tree. More... | |
| iterator | begin () |
| iterator | end () |
| const_iterator | cbegin () const |
| const_iterator | cend () const |
Element Encoding Overloads | |
Provides a set of overloaded methods for encoding an EBML master element. The default implementations of | |
| size_t | encode (char *) const |
| std::string | encode () const |
| size_t | encode (ioBase &) const |
| size_t | encode (ioBase &, off_t) const |
Public Member Functions inherited from ebml::ebmlElementCRTP< ebmlMasterElementType, ebmlMasterElement > | |
| ebmlElementCRTP (const ebmlMasterElementType *cls, Args &&... args) | |
| const ebmlMasterElementType & | cls () const |
| ebml::ptr< ebmlMasterElement > | sp () |
| ebml::ptr< const ebmlMasterElement > | sp () const |
| ebml::ptr< ebmlElement > | sp () |
| Returns a shared pointer to the element instance. More... | |
| ebml::ptr< const ebmlElement > | sp () const |
| Returns a shared pointer to a const element. More... | |
| ebml::ptr< T > | sp () |
| ebml::ptr< T > | sp () const |
| ebml::wptr< ebmlMasterElement > | wp () |
| ebml::wptr< const ebmlMasterElement > | wp () const |
| ebml::wptr< ebmlElement > | wp () |
| ebml::wptr< const ebmlElement > | wp () const |
| ebml::wptr< T > | wp () |
| ebml::wptr< T > | wp () const |
| ebml::ptr< ebmlMasterElement > | clone () const |
Public Member Functions inherited from ebml::ebmlElement | |
| virtual | ~ebmlElement () |
| ebmlID_t | ebmlID () const |
| Retrieve the EBML ID of the element. More... | |
| template<typename T = ebmlElement> | |
| T & | as () |
| Dynamically cast the element to the requested type. More... | |
| template<typename T = ebmlElement> | |
| T & | as () const |
| Const version of the dynamic cast. More... | |
| ebml::ptr< ebmlElement > | sp () |
| Returns a shared pointer to the element instance. More... | |
| ebml::ptr< const ebmlElement > | sp () const |
| Returns a shared pointer to a const element. More... | |
| template<typename T > | |
| ebml::ptr< T > | sp () |
| template<typename T > | |
| ebml::ptr< T > | sp () const |
| ebml::wptr< ebmlElement > | wp () |
| ebml::wptr< const ebmlElement > | wp () const |
| template<typename T > | |
| ebml::wptr< T > | wp () |
| template<typename T > | |
| ebml::wptr< T > | wp () const |
| bool | parent_is_const () const |
| Check if the element's parent is a const object. More... | |
| ebml::ptr< ebmlMasterElement > | parent () const |
| Retrieve the parent of this element. More... | |
| ebml::ptr< const ebmlMasterElement > | c_parent () const |
| Retrieve a const shared pointer to the parent element. More... | |
| ebmlElement_sp | root () const |
| c_ebmlElement_sp | c_root () const |
| ebmlDocument_sp | document () const |
| bool | hasParent () const |
| unsigned char | headSize () const |
| unsigned char | headSize (size_t) const |
| unsigned char | sizeWidth () const |
| unsigned char | sizeWidth (size_t) const |
| size_t | outerSize () const |
| size_t | outerSize (size_t) const |
| off_t | offsetInParent () const |
| off_t | offsetInFile () const |
| off_t | dataOffsetInParent () const |
| off_t | dataOffsetInFile () const |
| ebml::ptr< ebmlElement > | clone () const |
| virtual std::wstring | minirepr () const =0 |
| virtual std::wstring | repr () const |
| seekData_t * | makeSeekData () |
| seekData_t * | makeSeekData () const |
| std::string | encode () const |
Encodes the element and returns it as a std::string. More... | |
| size_t | encode (char *) const |
| Encodes the element into a pre-allocated buffer. More... | |
| size_t | encode (ioBase &) const |
| Encodes the element and writes it to a generic I/O stream. More... | |
| size_t | encode (ioBase &, off_t) const |
| Encodes the element and writes it to a specific offset in a stream. More... | |
| size_t | encode (char *, size_t) const |
| Encodes the element using a pre-computed size. More... | |
Protected Member Functions | |
| ebmlMasterElement (const ebmlMasterElementType *) | |
| void | _init (const parseString &) |
| Initializes the element from a parsed EBML string. More... | |
| void | _init (const parseFile &) |
| Initializes the element from parsed file data. More... | |
| void | _cinit (const parseString &) |
| Const initialization from a parsed EBML string. More... | |
| void | _cinit (const parseFile &) |
| Const initialization from parsed file data. More... | |
| ebmlElement * | _decodeChild (const parseString &) const |
| Decodes a child element from a parsed string. More... | |
| ebmlElement * | _decodeChild (const parseFile &) const |
| Decodes a child element from parsed file data. More... | |
| ebmlElement * | _cdecodeChild (const parseString &) const |
| Const version: Decodes a child element from a parsed string. More... | |
| ebmlElement * | _cdecodeChild (const parseFile &) const |
| Const version: Decodes a child element from parsed file data. More... | |
| size_t | _encode (char *) const |
| size_t | _encode (char *, const sizetree_t &) const |
| Encodes the element using a precomputed size tree. More... | |
| virtual void | _clear () |
| Clears all child elements. More... | |
| virtual void | _decodeChildren (parseString::iterator &) |
| Decodes child elements from a parseString iterator. More... | |
| virtual void | _cdecodeChildren (parseString::iterator &) |
| Const version of _decodeChildren. More... | |
| virtual void | _scanChildren (parseFile::iterator &) |
| Scans for child elements from a parseFile iterator. More... | |
| virtual void | _cscanChildren (parseFile::iterator &) |
| Scans for child elements from a parseFile iterator. (const version) More... | |
| virtual void | _handleParseFile (const parseFile &) |
| Handles the parsing of seek data for a child element. More... | |
| virtual void | _chandleParseFile (const parseFile &) |
| Handles the parsing of seek data for a child element. (const version) More... | |
| virtual void | _addChild (const ebmlElement_sp &)=0 |
| Attaches a child element (rvalue version). More... | |
| virtual void | _addChild (ebmlElement_sp &&)=0 |
| Attaches a child element (move version). More... | |
| void | _attachChild (const ebmlElement_sp &child, bool weak=true) const |
| Attaches a child element to the master element. More... | |
| void | _detachChild (const ebmlElement_sp &child) const |
| Detaches a child element. More... | |
| void | _attachChildren (const ebmlElement_l &elems, bool weak=true) const |
| Const version of _attachChildren. More... | |
| void | _detachChildren (const ebmlElement_l &elems) const |
| Detaches multiple child elements. More... | |
| virtual ebmlMasterElement::_iterator * | _begin ()=0 |
| virtual ebmlMasterElement::_iterator * | _end ()=0 |
| virtual ebmlMasterElement::_const_iterator * | _cbegin () const =0 |
| virtual ebmlMasterElement::_const_iterator * | _cend () const =0 |
| void | _clonedata (const ebmlElement *) |
Protected Member Functions inherited from ebml::ebmlElementCRTP< ebmlMasterElementType, ebmlMasterElement > | |
| ebmlElement * | _clone () const |
Protected Member Functions inherited from ebml::ebmlElement | |
| ebmlElement (const ebmlElementType *) | |
| Protected constructor. More... | |
| void | _validate () |
| void | _setParent (const ebml::ptr< ebmlMasterElement > &parent, bool weak=true) |
| void | _setParent (const ebml::ptr< const ebmlMasterElement > &parent, bool weak=true) |
| void | _setParent (ebml::ptr< ebmlMasterElement > &&parent, bool weak=true) |
| void | _setParent (ebml::ptr< const ebmlMasterElement > &&parent, bool weak=true) |
| void | _setParent (ebmlMasterElement &parent, bool weak=true) |
| void | _setParent (const ebmlMasterElement &parent, bool weak=true) |
| void | _detach () |
| size_t | _encode_head (char *, size_t) const |
Static Protected Member Functions | |
| static iterator | make_iter (_iterator *) |
| static const_iterator | make_iter (_const_iterator *) |
Protected Attributes | |
| occur_d | ebmlIDCount |
Protected Attributes inherited from ebml::ebmlElement | |
| const ebmlElementType * | _cls |
| Pointer to the companion element type (an ebmlElementClass subclass). More... | |
| wptr< ebmlElement > | _self |
| Custom weak pointer to self (used for shared-from-this semantics). More... | |
| ebmlDocument_wp | _document |
| vintWidth_t | _sizeWidth = 0 |
| off_t | _offsetInParent = -1 |
Friends | |
| class | ebmlMasterElementType |
| class | std::shared_ptr< ebmlMasterElement::_iterator > |
| class | std::shared_ptr< ebmlMasterElement::_const_iterator > |
| template<typename T > | |
| class | childSlot_t |
| std::shared_ptr< ebmlMasterElement::_iterator > | std::make_shared () |
| std::shared_ptr< ebmlMasterElement::_const_iterator > | std::make_shared () |
Additional Inherited Members | |
Public Types inherited from ebml::ebmlElementCRTP< ebmlMasterElementType, ebmlMasterElement > | |
| using | ebmltype = ebmlMasterElementType |
Abstract base class for EBML master element instances.
This class provides the functionality to manage child elements, perform encoding/decoding, and traverse child elements through iterators. It uses CRTP to enable type safety.
|
protected |
|
protectedpure virtual |
Attaches a child element (rvalue version).
Implements the mechanism for attaching a child element to the parent element.
| child | Shared pointer to the child element. |
Implemented in ebml::ebmlStruct, ebml::ebmlLazyLoad, ebml::ebmlLazyLoad, ebml::ebmlPair< K, V >, ebml::ebmlMap< K, V, H, E, A, B >, and ebml::ebmlList.
|
protectedpure virtual |
Attaches a child element (move version).
Implements the mechanism for moving a child element to the parent element.
| child | Rvalue reference to a shared pointer for the child element. |
Implemented in ebml::ebmlStruct, ebml::ebmlLazyLoad, ebml::ebmlLazyLoad, ebml::ebmlPair< K, V >, ebml::ebmlMap< K, V, H, E, A, B >, and ebml::ebmlList.
|
protected |
Attaches a child element to the master element.
Manages the parent-child relationship by attaching the provided child element, with an option for a weak reference.
| child | Shared pointer to the child element. |
| weak | If true, attaches the child as a weak reference. |
|
protected |
Const version of _attachChildren.
Attaches multiple child elements in a const context.
| elems | List of child elements. |
| weak | If true, attaches children as weak references. |
|
protectedpure virtual |
|
protectedpure virtual |
|
inlineprotected |
Const version: Decodes a child element from a parsed string.
| parsed | The parsed EBML string. |
|
inlineprotected |
Const version: Decodes a child element from parsed file data.
| parsed | The parsed file data. |
|
protectedvirtual |
Const version of _decodeChildren.
Default implementation iterates through the given parseString iterator to decode and attach child elements in decoding to a const ebml::ebmlMasterElement instance.
| iter | Iterator over the parseString. |
|
protectedpure virtual |
|
protectedvirtual |
Handles the parsing of seek data for a child element. (const version)
Processes the parsed file data corresponding to a child element. Default implementation decodes child and attaches it through _addChild.
| parsed | Parsed file data for a child element. |
|
protected |
Const initialization from a parsed EBML string.
| parsed | The parsed EBML string. |
|
protected |
Const initialization from parsed file data.
| parsed | The parsed file data. |
|
protectedvirtual |
Clears all child elements.
Removes all currently attached child elements from the master element.
Reimplemented in ebml::ebmlStruct, ebml::ebmlPair< K, V >, ebml::ebmlMap< K, V, H, E, A, B >, and ebml::ebmlList.
|
protected |
|
protectedvirtual |
Scans for child elements from a parseFile iterator. (const version)
Default implementation iterates over the ebml::parseFile::iterator and passes each dereferenced ebml::parseFile to _chandleParseFile in decoding to a const ebml::ebmlMasterElement instance.
| iter | Iterator over the parseFile. |
|
inlineprotected |
Decodes a child element from a parsed string.
| parsed | The parsed EBML string. |
|
inlineprotected |
Decodes a child element from parsed file data.
| parsed | The parsed file data. |
|
protectedvirtual |
Decodes child elements from a parseString iterator.
Default implementation terates through the given parseString iterator to decode and attach child elements.
| iter | Iterator over the parseString. |
|
protected |
Detaches a child element.
Removes the association between the master element and the specified child element.
| child | Shared pointer to the child element to detach. |
|
protected |
Detaches multiple child elements.
Iterates through the provided list and detaches each child element from the master element.
| elems | List of child elements to detach. |
|
protectedvirtual |
Implements ebml::ebmlElement.
|
protected |
Encodes the element using a precomputed size tree.
| dest | Pointer to the destination buffer. |
| _sizetree | A precomputed sizetree_t for the element. |
|
protectedpure virtual |
|
protectedvirtual |
Handles the parsing of seek data for a child element.
Processes the parsed file data corresponding to a child element. Default implementation decodes child and attaches it through _addChild.
| parsed | Parsed file data for a child element. |
Reimplemented in ebml::ebmlLazyLoad, and ebml::ebmlLazyLoad.
|
protected |
Initializes the element from a parsed EBML string.
| parsed | The parsed EBML string. |
|
protected |
Initializes the element from parsed file data.
| parsed | The parsed file data. |
|
protectedvirtual |
Scans for child elements from a parseFile iterator.
Default implementation iterates over the ebml::parseFile::iterator and passes each dereferenced ebml::parseFile to _handleParseFile in decoding to an ebml::ebmlMasterElement instance.
| iter | Iterator over the parseFile. |
| ebmlMasterElement::iterator ebml::ebmlMasterElement::begin | ( | ) |
| ebmlMasterElement::const_iterator ebml::ebmlMasterElement::cbegin | ( | ) | const |
| ebmlMasterElement::const_iterator ebml::ebmlMasterElement::cend | ( | ) | const |
|
virtual |
Implements ebml::ebmlElement.
Reimplemented in ebml::ebmlLazyLoad, and ebml::ebmlLazyLoad.
| size_t ebml::ebmlMasterElement::encode | ( | char * | dest | ) | const |
| std::string ebml::ebmlMasterElement::encode | ( | ) | const |
| size_t ebml::ebmlMasterElement::encode | ( | ioBase & | dest | ) | const |
| size_t ebml::ebmlMasterElement::encode | ( | ioBase & | dest, |
| off_t | offset | ||
| ) | const |
| size_t ebml::ebmlMasterElement::encode | ( | char * | dest, |
| const sizetree_t & | _sizetree | ||
| ) | const |
Encodes the element using a precomputed size tree.
| dest | Pointer to the destination buffer. |
| _sizetree | A precomputed sizetree_t for the element. |
| ebmlMasterElement::iterator ebml::ebmlMasterElement::end | ( | ) |
|
staticprotected |
|
staticprotected |
| sizetree_t ebml::ebmlMasterElement::sizetree | ( | ) | const |
Generates the size tree for the element hierarchy.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
1.8.14