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

Represents a parsed EBML file segment. More...

#include <io.h>

Classes

class  iterator
 Iterator class for parseFile. More...
 

Public Member Functions

 parseFile (ioBase &)
 
 parseFile (ioBase &, parseFile &)
 
 parseFile (ioBase &, off_t)
 
 parseFile (ioBase &, off_t, parseFile &)
 
off_t dataOffset () const
 
off_t endOffset () const
 
size_t read (char *) const
 
size_t read (char *, size_t) const
 
size_t read (char *, off_t, size_t) const
 
off_t seek (off_t) const
 
off_t tell () const
 
size_t outerSize () const
 
template<typename T >
unpack () const
 Template method to unpack data from the element read from file. More...
 
iterator begin () const
 

Public Attributes

ebmlID_t ebmlID
 
unsigned char ebmlIDWidth
 
size_t dataSize
 
unsigned char sizeWidth
 
off_t offset
 
off_t parentOffset = 0
 
parseFileparent
 

Protected Member Functions

 parseFile (ioBase *, ebmlID_t, unsigned char, size_t, unsigned char, off_t)
 
 parseFile (ioBase *, ebmlID_t, unsigned char, size_t, unsigned char, off_t, parseFile &)
 

Friends

class parseFile::iterator
 

Detailed Description

Represents a parsed EBML file segment.

The parseFile class encapsulates the data read from an IO interface (ioBase) for an EBML element. It stores the EBML ID, widths, data size, file offset, and parent relations. Underlying IO operations (such as seek, read, write, or truncate) may throw exceptions derived from std::ios_base::failure (or other exceptions such as ebmlUnexpectedEndOfData and ebmlDecodeError) if errors occur in the IO operations.

Exceptions
std::ios_base::failureThrown if seeking, reading, writing, or truncating fails due to an underlying IO error.
std::invalid_argumentThrown by the specialized IO implementations (such as when no read, write, or append flag is specified).
ebml::ebmlUnexpectedEndOfDataThrown if a parsed element header indicates more data than available.
ebml::ebmlDecodeErrorThrown if there is an error in decoding the EBML header fields.

Constructor & Destructor Documentation

◆ parseFile() [1/6]

ebml::parseFile::parseFile ( ioBase file)

◆ parseFile() [2/6]

ebml::parseFile::parseFile ( ioBase file,
parseFile parent 
)

◆ parseFile() [3/6]

ebml::parseFile::parseFile ( ioBase file,
off_t  offset 
)

◆ parseFile() [4/6]

ebml::parseFile::parseFile ( ioBase file,
off_t  offset,
parseFile parent 
)

◆ parseFile() [5/6]

ebml::parseFile::parseFile ( ioBase file,
ebmlID_t  ebmlID,
unsigned char  ebmlIDWidth,
size_t  dataSize,
unsigned char  sizeWidth,
off_t  offset 
)
protected

◆ parseFile() [6/6]

ebml::parseFile::parseFile ( ioBase file,
ebmlID_t  ebmlID,
unsigned char  ebmlIDWidth,
size_t  dataSize,
unsigned char  sizeWidth,
off_t  offset,
parseFile parent 
)
protected

Member Function Documentation

◆ begin()

parseFile::iterator ebml::parseFile::begin ( ) const

◆ dataOffset()

off_t ebml::parseFile::dataOffset ( ) const

◆ endOffset()

off_t ebml::parseFile::endOffset ( ) const

◆ outerSize()

size_t ebml::parseFile::outerSize ( ) const

◆ read() [1/3]

size_t ebml::parseFile::read ( char *  dest) const

◆ read() [2/3]

size_t ebml::parseFile::read ( char *  dest,
size_t  size 
) const

◆ read() [3/3]

size_t ebml::parseFile::read ( char *  dest,
off_t  offset,
size_t  size 
) const

◆ seek()

off_t ebml::parseFile::seek ( off_t  offset) const

◆ tell()

off_t ebml::parseFile::tell ( ) const

◆ unpack()

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

Template method to unpack data from the element read from file.

This method reads the element's data into a temporary buffer and then converts it to a value of the requested type using ebml::unpack.

Template Parameters
TThe target type.
Returns
The unpacked value of type T.
Exceptions
std::ios_base::failureif an IO error occurs during the read.

Friends And Related Function Documentation

◆ parseFile::iterator

friend class parseFile::iterator
friend

Member Data Documentation

◆ dataSize

size_t ebml::parseFile::dataSize

◆ ebmlID

ebmlID_t ebml::parseFile::ebmlID

◆ ebmlIDWidth

unsigned char ebml::parseFile::ebmlIDWidth

◆ offset

off_t ebml::parseFile::offset

◆ parent

parseFile* ebml::parseFile::parent

◆ parentOffset

off_t ebml::parseFile::parentOffset = 0

◆ sizeWidth

unsigned char ebml::parseFile::sizeWidth

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