QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlTlvList< TAG, LENGTH, ORDER > Class Template Reference

A template class for lists of TLV items (Tag / Length / Value). More...

Inheritance diagram for QtlTlvList< TAG, LENGTH, ORDER >:

Classes

class  TagDefinition
 Internal structure to hold a tag definition. More...
 

Public Types

typedef QList< TlvSuperClass
 Type name for the superclass. More...
 
typedef QtlTlv< TAG, LENGTH, ORDER > Tlv
 Type name for a TLV item in the list. More...
 

Public Member Functions

 QtlTlvList ()
 Default constructor. More...
 
 QtlTlvList (const QtlTlvList &other)
 Copy constructor. More...
 
void addTagDefinition (TAG tag, int minCount, int maxCount, int minSize, int maxSize)
 Add a tag definition for the list. More...
 
void appendTo (QtlByteBlock &data) const
 Serialize the TLV list at end of a given byte block. More...
 
void clearTagDefinitions ()
 Clear the list of tag definitions. More...
 
bool readAt (const QtlByteBlock &data, int &index, int end=-1)
 Deserialize the TLV list from a given byte block. More...
 
int tagDefinitionsCount () const
 Get the number of tag definitions. More...
 
bool validate () const
 Validate the TLV list according to its tags definitions. More...
 

Private Types

typedef QMap< TAG, TagDefinitionTagDefinitionMap
 A map of tag definitions, index by tag value. More...
 

Private Attributes

TagDefinitionMap _tagMap
 The map of tag definitions. More...
 

Detailed Description

template<typename TAG, typename LENGTH, QtlByteBlock::ByteOrder ORDER>
class QtlTlvList< TAG, LENGTH, ORDER >

A template class for lists of TLV items (Tag / Length / Value).

Template Parameters
TAGAn integer type representing tag fields.
LENGTHAn integer type representing length fields.
ORDERByte order to use for serialization.

Member Typedef Documentation

◆ Tlv

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
typedef QtlTlv<TAG,LENGTH,ORDER> QtlTlvList< TAG, LENGTH, ORDER >::Tlv

Type name for a TLV item in the list.

◆ SuperClass

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
typedef QList<Tlv> QtlTlvList< TAG, LENGTH, ORDER >::SuperClass

Type name for the superclass.

◆ TagDefinitionMap

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
typedef QMap<TAG,TagDefinition> QtlTlvList< TAG, LENGTH, ORDER >::TagDefinitionMap
private

A map of tag definitions, index by tag value.

Constructor & Destructor Documentation

◆ QtlTlvList() [1/2]

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
QtlTlvList< TAG, LENGTH, ORDER >::QtlTlvList ( )
inline

Default constructor.

◆ QtlTlvList() [2/2]

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
QtlTlvList< TAG, LENGTH, ORDER >::QtlTlvList ( const QtlTlvList< TAG, LENGTH, ORDER > &  other)
inline

Copy constructor.

Parameters
[in]otherOther instance to copy.

Member Function Documentation

◆ appendTo()

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
void QtlTlvList< TAG, LENGTH, ORDER >::appendTo ( QtlByteBlock data) const

Serialize the TLV list at end of a given byte block.

Parameters
[in,out]dataThe byte block to use. Its size is increased to include the TLV list.

◆ readAt()

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
bool QtlTlvList< TAG, LENGTH, ORDER >::readAt ( const QtlByteBlock data,
int &  index,
int  end = -1 
)

Deserialize the TLV list from a given byte block.

The deserialized TLV items are appended to this object.

Parameters
[in]dataThe byte block to use.
[in,out]indexIndex in the byte block where to read the TLV list. index is updated to point after the read TLV list.
[in]endNext index after last byte to read. If negative, use the end of byte block.
Returns
True on success, false on error (incorrect data, block too short). In case of error, some TLV items may have been read into this object and index point after the last successfully read TLV item.

◆ addTagDefinition()

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
void QtlTlvList< TAG, LENGTH, ORDER >::addTagDefinition ( TAG  tag,
int  minCount,
int  maxCount,
int  minSize,
int  maxSize 
)
inline

Add a tag definition for the list.

See also
validate()
Parameters
[in]tagThe tag value.
[in]minCountMinimum number of items with this tag.
[in]maxCountMaximum number of items with this tag.
[in]minSizeMinimum size in bytes of the value of items with this tag.
[in]maxSizeMaximum size in bytes of the value of items with this tag.

◆ clearTagDefinitions()

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
void QtlTlvList< TAG, LENGTH, ORDER >::clearTagDefinitions ( )
inline

Clear the list of tag definitions.

◆ tagDefinitionsCount()

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
int QtlTlvList< TAG, LENGTH, ORDER >::tagDefinitionsCount ( ) const
inline

Get the number of tag definitions.

Returns
The number of tag definitions.

◆ validate()

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
bool QtlTlvList< TAG, LENGTH, ORDER >::validate ( ) const

Validate the TLV list according to its tags definitions.

Returns
True if the list matches the tag definitions, false otherwise.

Member Data Documentation

◆ _tagMap

template<typename TAG , typename LENGTH , QtlByteBlock::ByteOrder ORDER>
TagDefinitionMap QtlTlvList< TAG, LENGTH, ORDER >::_tagMap
private

The map of tag definitions.


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