Tag Parser  6.2.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Public Member Functions | List of all members
Media::FileDataBlock Class Reference

The FileDataBlock class is a reference to a certain data block of a file stream. More...

#include <abstractattachment.h>

Inheritance diagram for Media::FileDataBlock:
[legend]
Collaboration diagram for Media::FileDataBlock:
[legend]

Public Member Functions

 FileDataBlock (const std::string &path)
 Constructs a new FileDataBlock with the specified path. More...
 
const MediaFileInfofileInfo () const
 
- Public Member Functions inherited from Media::StreamDataBlock
 StreamDataBlock (const std::function< std::istream &()> &stream, std::istream::off_type startOffset=0, std::ios_base::seekdir startDir=std::ios_base::beg, std::istream::off_type endOffset=0, std::ios_base::seekdir endDir=std::ios_base::end)
 
std::istream & stream () const
 Returns the associated stream. More...
 
std::istream::pos_type startOffset () const
 Returns the absolute start offset of the data block in the stream. More...
 
std::istream::pos_type endOffset () const
 Returns the absolute end offset of the data block in the stream. More...
 
std::istream::pos_type size () const
 Returns the size of the data block. More...
 
const std::unique_ptr< char[]> & buffer () const
 Returns the data buffered via makeBuffer(). More...
 
void makeBuffer () const
 Buffers the data block. More...
 
void discardBuffer ()
 Discards buffered data. More...
 
void copyTo (std::ostream &stream) const
 Copies the data to the specified stream. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Media::StreamDataBlock
 StreamDataBlock ()
 Constructs a new StreamDataBlock. More...
 
- Protected Attributes inherited from Media::StreamDataBlock
std::function< std::istream &()> m_stream
 
std::istream::pos_type m_startOffset
 
std::istream::pos_type m_endOffset
 
std::unique_ptr< char[]> m_buffer
 

Detailed Description

The FileDataBlock class is a reference to a certain data block of a file stream.

Definition at line 90 of file abstractattachment.h.

Constructor & Destructor Documentation

◆ FileDataBlock()

Media::FileDataBlock::FileDataBlock ( const std::string &  path)

Constructs a new FileDataBlock with the specified path.

Opens a file stream with the specified path.

Exceptions
Throwsios_base::failure when an IO error occurs.

Definition at line 95 of file abstractattachment.cpp.

Member Function Documentation

◆ fileInfo()

const MediaFileInfo * Media::FileDataBlock::fileInfo ( ) const
inline

Definition at line 100 of file abstractattachment.h.


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