Tag Parser  9.4.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Public Member Functions | List of all members
TagParser::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 TagParser::FileDataBlock:
[legend]
Collaboration diagram for TagParser::FileDataBlock:
[legend]

Public Member Functions

 FileDataBlock (const std::string &path, Diagnostics &diag)
 Constructs a new FileDataBlock with the specified path. More...
 
 ~FileDataBlock ()
 Destroys the FileDataBlock. More...
 
const MediaFileInfofileInfo () const
 
- Public Member Functions inherited from TagParser::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)
 
virtual ~StreamDataBlock ()
 Discards buffered data. More...
 
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 TagParser::StreamDataBlock
 StreamDataBlock ()
 Constructs a new StreamDataBlock. More...
 
- Protected Attributes inherited from TagParser::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()

TagParser::FileDataBlock::FileDataBlock ( const std::string &  path,
Diagnostics diag 
)

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 103 of file abstractattachment.cpp.

◆ ~FileDataBlock()

TagParser::FileDataBlock::~FileDataBlock ( )

Destroys the FileDataBlock.

Remarks
This method is needed although it is empty. Otherwise the default d'tor would be inlined where FileDataBlock is used creating a dependency to MediaFileInfo which therefore couldn't be opaque anymore.

Definition at line 120 of file abstractattachment.cpp.

Member Function Documentation

◆ fileInfo()

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

Definition at line 100 of file abstractattachment.h.


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