libebml_ng
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
ebml::ebmlStruct Class Reference

#include <ebmlStruct.h>

Inheritance diagram for ebml::ebmlStruct:
ebml::ebmlElementCRTP< ebmlStructType, ebmlStruct, ebmlMasterElement > ebml::ebmlMasterElement ebml::ebmlElementCRTP< ebmlMasterElementType, ebmlMasterElement > ebml::ebmlElement

Classes

class  _const_iterator
 
class  _iterator
 

Public Member Functions

void setData (const slotArg_l &)
 
void setData (slotArg_l &&)
 
void setData (const slotArg_d &)
 
void setData (slotArg_d &&)
 
void setData (const slotArg_l &, const slotArg_d &)
 
void setData (slotArg_l &&, slotArg_d &&)
 
std::wstring minirepr () const override
 
slot_t operator[] (size_t)
 
slot_t operator[] (const std::string &)
 
const_slot_t operator[] (size_t) const
 
const_slot_t operator[] (const std::string &) const
 
template<typename T >
T & data (size_t)
 
template<typename T >
T & data (const std::string &)
 
template<typename T >
const T & data (size_t) const
 
template<typename T >
const T & data (const std::string &) const
 
- Public Member Functions inherited from ebml::ebmlElementCRTP< ebmlStructType, ebmlStruct, ebmlMasterElement >
 ebmlElementCRTP (const ebmlStructType *cls, Args &&... args)
 
const ebmlStructTypecls () const
 
ebml::ptr< ebmlStructsp ()
 
ebml::ptr< const ebmlStructsp () const
 
ebml::ptr< ebmlElementsp ()
 Returns a shared pointer to the element instance. More...
 
ebml::ptr< const ebmlElementsp () const
 Returns a shared pointer to a const element. More...
 
ebml::ptr< T > sp ()
 
ebml::ptr< T > sp () const
 
ebml::wptr< ebmlStructwp ()
 
ebml::wptr< const ebmlStructwp () const
 
ebml::wptr< ebmlElementwp ()
 
ebml::wptr< const ebmlElementwp () const
 
ebml::wptr< T > wp ()
 
ebml::wptr< T > wp () const
 
ebml::ptr< ebmlStructclone () const
 
- Public Member Functions inherited from ebml::ebmlMasterElement
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
 
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)
 
ebml::ptr< ebmlMasterElementsp ()
 
ebml::ptr< const ebmlMasterElementsp () const
 
ebml::ptr< ebmlElementsp ()
 Returns a shared pointer to the element instance. More...
 
ebml::ptr< const ebmlElementsp () const
 Returns a shared pointer to a const element. More...
 
ebml::ptr< T > sp ()
 
ebml::ptr< T > sp () const
 
ebml::wptr< ebmlMasterElementwp ()
 
ebml::wptr< const ebmlMasterElementwp () const
 
ebml::wptr< ebmlElementwp ()
 
ebml::wptr< const ebmlElementwp () const
 
ebml::wptr< T > wp ()
 
ebml::wptr< T > wp () const
 
ebml::ptr< ebmlMasterElementclone () 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< ebmlElementsp ()
 Returns a shared pointer to the element instance. More...
 
ebml::ptr< const ebmlElementsp () 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< ebmlElementwp ()
 
ebml::wptr< const ebmlElementwp () 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< ebmlMasterElementparent () const
 Retrieve the parent of this element. More...
 
ebml::ptr< const ebmlMasterElementc_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< ebmlElementclone () const
 
virtual std::wstring repr () const
 
seekData_tmakeSeekData ()
 
seekData_tmakeSeekData () 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

 ebmlStruct (const ebmlStructType *)
 
 ebmlStruct (const ebmlStructType *, const slotArg_l &)
 
 ebmlStruct (const ebmlStructType *, slotArg_l &&)
 
 ebmlStruct (const ebmlStructType *, const slotArg_d &)
 
 ebmlStruct (const ebmlStructType *, slotArg_d &&)
 
 ebmlStruct (const ebmlStructType *, const slotArg_l &, const slotArg_d &)
 
 ebmlStruct (const ebmlStructType *, slotArg_l &&, const slotArg_d &)
 
 ebmlStruct (const ebmlStructType *, const slotArg_l &, slotArg_d &&)
 
 ebmlStruct (const ebmlStructType *, slotArg_l &&, slotArg_d &&)
 
 ebmlStruct (const ebmlStruct &)
 
void _clear () override
 Clears all child elements. More...
 
void _validateArgs (const slotArg_l &args)
 
void _validateArgs (const slotArg_d &kwargs)
 
void _validateArgs (const slotArg_l &args, const slotArg_d &kwargs)
 
void _validateData (const slotArg_l &args)
 
void _validateData (const slotArg_d &args)
 
void _setData (const slotArg_l &args)
 
void _setData (slotArg_l &&args)
 
void _setData (const slotArg_d &kwargs)
 
void _setData (slotArg_d &&kwargs)
 
ebmlMasterElement::_iterator_begin () override
 
ebmlMasterElement::_iterator_end () override
 
ebmlMasterElement::_const_iterator_cbegin () const override
 
ebmlMasterElement::_const_iterator_cend () const override
 
void _addChild (const ebmlElement_sp &) override
 Attaches a child element (rvalue version). More...
 
void _addChild (ebmlElement_sp &&) override
 Attaches a child element (move version). More...
 
- Protected Member Functions inherited from ebml::ebmlElementCRTP< ebmlStructType, ebmlStruct, ebmlMasterElement >
ebmlElement_clone () const
 
- Protected Member Functions inherited from ebml::ebmlMasterElement
 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 _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...
 
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...
 
void _clonedata (const ebmlElement *)
 
- 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
 

Friends

class ebmlTypeCRTP< ebmlStructType, ebmlStruct, ebmlMasterElementType >
 
class ebmlElementCRTP< ebmlStructType, ebmlStruct, ebmlMasterElement >
 
class slot_t
 

Additional Inherited Members

- Public Types inherited from ebml::ebmlElementCRTP< ebmlStructType, ebmlStruct, ebmlMasterElement >
using ebmltype = ebmlStructType
 
- Public Types inherited from ebml::ebmlElementCRTP< ebmlMasterElementType, ebmlMasterElement >
using ebmltype = ebmlMasterElementType
 
- Static Protected Member Functions inherited from ebml::ebmlMasterElement
static iterator make_iter (_iterator *)
 
static const_iterator make_iter (_const_iterator *)
 
- Protected Attributes inherited from ebml::ebmlMasterElement
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
 

Constructor & Destructor Documentation

◆ ebmlStruct() [1/10]

ebml::ebmlStruct::ebmlStruct ( const ebmlStructType cls)
protected

◆ ebmlStruct() [2/10]

ebml::ebmlStruct::ebmlStruct ( const ebmlStructType cls,
const slotArg_l args 
)
protected

◆ ebmlStruct() [3/10]

ebml::ebmlStruct::ebmlStruct ( const ebmlStructType cls,
slotArg_l &&  args 
)
protected

◆ ebmlStruct() [4/10]

ebml::ebmlStruct::ebmlStruct ( const ebmlStructType cls,
const slotArg_d kwargs 
)
protected

◆ ebmlStruct() [5/10]

ebml::ebmlStruct::ebmlStruct ( const ebmlStructType cls,
slotArg_d &&  kwargs 
)
protected

◆ ebmlStruct() [6/10]

ebml::ebmlStruct::ebmlStruct ( const ebmlStructType cls,
const slotArg_l args,
const slotArg_d kwargs 
)
protected

◆ ebmlStruct() [7/10]

ebml::ebmlStruct::ebmlStruct ( const ebmlStructType cls,
slotArg_l &&  args,
const slotArg_d kwargs 
)
protected

◆ ebmlStruct() [8/10]

ebml::ebmlStruct::ebmlStruct ( const ebmlStructType cls,
const slotArg_l args,
slotArg_d &&  kwargs 
)
protected

◆ ebmlStruct() [9/10]

ebml::ebmlStruct::ebmlStruct ( const ebmlStructType cls,
slotArg_l &&  args,
slotArg_d &&  kwargs 
)
protected

◆ ebmlStruct() [10/10]

ebml::ebmlStruct::ebmlStruct ( const ebmlStruct orig)
protected

Member Function Documentation

◆ _addChild() [1/2]

void ebml::ebmlStruct::_addChild ( const ebmlElement_sp )
overrideprotectedvirtual

Attaches a child element (rvalue version).

Implements the mechanism for attaching a child element to the parent element.

Parameters
childShared pointer to the child element.

Implements ebml::ebmlMasterElement.

◆ _addChild() [2/2]

void ebml::ebmlStruct::_addChild ( ebmlElement_sp &&  )
overrideprotectedvirtual

Attaches a child element (move version).

Implements the mechanism for moving a child element to the parent element.

Parameters
childRvalue reference to a shared pointer for the child element.

Implements ebml::ebmlMasterElement.

◆ _begin()

ebmlMasterElement::_iterator * ebml::ebmlStruct::_begin ( )
overrideprotectedvirtual

◆ _cbegin()

ebmlMasterElement::_const_iterator * ebml::ebmlStruct::_cbegin ( ) const
overrideprotectedvirtual

◆ _cend()

ebmlMasterElement::_const_iterator * ebml::ebmlStruct::_cend ( ) const
overrideprotectedvirtual

◆ _clear()

void ebml::ebmlStruct::_clear ( )
overrideprotectedvirtual

Clears all child elements.

Removes all currently attached child elements from the master element.

Reimplemented from ebml::ebmlMasterElement.

◆ _end()

ebmlMasterElement::_iterator * ebml::ebmlStruct::_end ( )
overrideprotectedvirtual

◆ _setData() [1/4]

void ebml::ebmlStruct::_setData ( const slotArg_l args)
protected

◆ _setData() [2/4]

void ebml::ebmlStruct::_setData ( slotArg_l &&  args)
protected

◆ _setData() [3/4]

void ebml::ebmlStruct::_setData ( const slotArg_d kwargs)
protected

◆ _setData() [4/4]

void ebml::ebmlStruct::_setData ( slotArg_d &&  kwargs)
protected

◆ _validateArgs() [1/3]

void ebml::ebmlStruct::_validateArgs ( const slotArg_l args)
protected

◆ _validateArgs() [2/3]

void ebml::ebmlStruct::_validateArgs ( const slotArg_d kwargs)
protected

◆ _validateArgs() [3/3]

void ebml::ebmlStruct::_validateArgs ( const slotArg_l args,
const slotArg_d kwargs 
)
protected

◆ _validateData() [1/2]

void ebml::ebmlStruct::_validateData ( const slotArg_l args)
protected

◆ _validateData() [2/2]

void ebml::ebmlStruct::_validateData ( const slotArg_d args)
protected

◆ data() [1/4]

template<typename T >
T& ebml::ebmlStruct::data ( size_t  )

◆ data() [2/4]

template<typename T >
T& ebml::ebmlStruct::data ( const std::string &  )

◆ data() [3/4]

template<typename T >
const T& ebml::ebmlStruct::data ( size_t  ) const

◆ data() [4/4]

template<typename T >
const T& ebml::ebmlStruct::data ( const std::string &  ) const

◆ minirepr()

std::wstring ebml::ebmlStruct::minirepr ( ) const
overridevirtual

Implements ebml::ebmlElement.

◆ operator[]() [1/4]

slot_t ebml::ebmlStruct::operator[] ( size_t  offset)

◆ operator[]() [2/4]

slot_t ebml::ebmlStruct::operator[] ( const std::string &  key)

◆ operator[]() [3/4]

const_slot_t ebml::ebmlStruct::operator[] ( size_t  offset) const

◆ operator[]() [4/4]

const_slot_t ebml::ebmlStruct::operator[] ( const std::string &  key) const

◆ setData() [1/6]

void ebml::ebmlStruct::setData ( const slotArg_l args)

◆ setData() [2/6]

void ebml::ebmlStruct::setData ( slotArg_l &&  args)

◆ setData() [3/6]

void ebml::ebmlStruct::setData ( const slotArg_d kwargs)

◆ setData() [4/6]

void ebml::ebmlStruct::setData ( slotArg_d &&  kwargs)

◆ setData() [5/6]

void ebml::ebmlStruct::setData ( const slotArg_l args,
const slotArg_d kwargs 
)

◆ setData() [6/6]

void ebml::ebmlStruct::setData ( slotArg_l &&  args,
slotArg_d &&  kwargs 
)

Friends And Related Function Documentation

◆ ebmlElementCRTP< ebmlStructType, ebmlStruct, ebmlMasterElement >

◆ ebmlTypeCRTP< ebmlStructType, ebmlStruct, ebmlMasterElementType >

◆ slot_t

friend class slot_t
friend

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