libebml_ng
Classes | Public Member Functions | Public Attributes | List of all members
ebml::parseString Class Reference

Represents a parsed EBML string segment. More...

#include <string.h>

Classes

class  iterator
 Iterator for parseString objects. More...
 

Public Member Functions

 parseString ()
 
 parseString (const parseString &)
 
 parseString (parseString &&)
 
parseStringoperator= (const parseString &)
 
parseStringoperator= (parseString &&)
 
 parseString (const char *, size_t)
 Construct from a raw buffer. More...
 
 parseString (const char *, size_t, off_t)
 Construct from a raw buffer with an offset parameter. More...
 
 parseString (ebmlID_t, vintWidth_t, size_t, vintWidth_t, off_t, const char *)
 Main constructor that initializes all fields. More...
 
 parseString (const parseFile &, char *)
 Construct a parseString directly from a parseFile object. More...
 
parseString::iterator begin () const
 Returns an iterator to the beginning of the contained EBML elements. More...
 
unsigned long long outerSize () const
 Returns the outer size (header + data) of the element. More...
 
template<typename T >
unpack () const
 Template method to unpack data from the element's payload. More...
 

Public Attributes

ebmlID_t ebmlID
 
vintWidth_t ebmlIDWidth
 
size_t dataSize
 
vintWidth_t sizeWidth
 
off_t offset
 
const char * data
 
parseStringparent
 

Detailed Description

Represents a parsed EBML string segment.

A parseString holds the parsed details for an EBML element extracted from a raw buffer. It stores the EBML ID, the widths used for encoding, the size of the data, and a pointer into the raw data. It may also reference a "parent" parseString for nested elements.

Public members:

It also defines an iterator for sequential parsing of nested EBML elements.

Note
The class provides a template member function unpack<T>() that uses the externally defined function ebml::unpack<T>().

Constructor & Destructor Documentation

◆ parseString() [1/7]

ebml::parseString::parseString ( )

◆ parseString() [2/7]

ebml::parseString::parseString ( const parseString other)

◆ parseString() [3/7]

ebml::parseString::parseString ( parseString &&  other)

◆ parseString() [4/7]

ebml::parseString::parseString ( const char *  data,
size_t  size 
)

Construct from a raw buffer.

Parameters
dataPointer to raw data containing EBML element.
sizeTotal number of bytes available in the data.

◆ parseString() [5/7]

ebml::parseString::parseString ( const char *  data,
size_t  size,
off_t  offset 
)

Construct from a raw buffer with an offset parameter.

Parameters
dataPointer to raw data.
sizeTotal size in bytes.
offsetOffset relative to the parent element.

◆ parseString() [6/7]

ebml::parseString::parseString ( ebmlID_t  ,
vintWidth_t  ,
size_t  ,
vintWidth_t  ,
off_t  ,
const char *   
)

Main constructor that initializes all fields.

Parameters
ebmlIDThe EBML ID.
ebmlIDWidthNumber of bytes used to encode ebmlID.
dataSizeSize of the element data in bytes.
sizeWidthNumber of bytes used to encode dataSize.
offsetOffset relative to the containing parent's data.
dataPointer to the actual element data.

◆ parseString() [7/7]

ebml::parseString::parseString ( const parseFile parsed,
char *  buffer 
)

Construct a parseString directly from a parseFile object.

Parameters
parsedA parseFile object.
bufferA character buffer to hold the data.

Member Function Documentation

◆ begin()

parseString::iterator ebml::parseString::begin ( ) const

Returns an iterator to the beginning of the contained EBML elements.

This iterator walks through the child elements contained in the data.

Returns
An iterator for this parseString.

◆ operator=() [1/2]

parseString & ebml::parseString::operator= ( const parseString other)

◆ operator=() [2/2]

parseString & ebml::parseString::operator= ( parseString &&  other)

◆ outerSize()

unsigned long long ebml::parseString::outerSize ( ) const

Returns the outer size (header + data) of the element.

Returns
Total size in bytes of the element including EBML ID and size fields.

◆ unpack()

template<typename T >
T ebml::parseString::unpack ( ) const
inline

Template method to unpack data from the element's payload.

This function calls the global function ebml::unpack<T>() on the element's data.

Template Parameters
TThe target type to unpack.
Returns
The unpacked value of type T.

Member Data Documentation

◆ data

const char* ebml::parseString::data

Pointer to the beginning of the element data.

◆ dataSize

size_t ebml::parseString::dataSize

The size (in bytes) of the element data.

◆ ebmlID

ebmlID_t ebml::parseString::ebmlID

The EBML ID for the element.

◆ ebmlIDWidth

vintWidth_t ebml::parseString::ebmlIDWidth

The width (in bytes) of the EBML ID.

◆ offset

off_t ebml::parseString::offset

Offset relative to start of parent data.

◆ parent

parseString* ebml::parseString::parent

Pointer to the parent parseString (if any).

◆ sizeWidth

vintWidth_t ebml::parseString::sizeWidth

The width (in bytes) of the size field.


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