Tag Parser 12.4.0
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
Loading...
Searching...
No Matches
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 (std::string_view path, Diagnostics &diag, AbortableProgressFeedback &progress)
 Constructs a new FileDataBlock with the specified path.
 
 ~FileDataBlock ()
 Destroys the FileDataBlock.
 
const MediaFileInfofileInfo () const
 
- Public Member Functions inherited from TagParser::StreamDataBlock
 StreamDataBlock (const std::function< std::istream &()> &stream, uint64_t startOffset=0, std::ios_base::seekdir startDir=std::ios_base::beg, uint64_t endOffset=0, std::ios_base::seekdir endDir=std::ios_base::end)
 
virtual ~StreamDataBlock ()
 Discards buffered data.
 
std::istream & stream () const
 Returns the associated stream.
 
std::uint64_t startOffset () const
 Returns the absolute start offset of the data block in the stream.
 
std::uint64_t endOffset () const
 Returns the absolute end offset of the data block in the stream.
 
std::uint64_t size () const
 Returns the size of the data block.
 
const std::unique_ptr< char[]> & buffer () const
 Returns the data buffered via makeBuffer().
 
void makeBuffer () const
 Buffers the data block.
 
void discardBuffer ()
 Discards buffered data.
 
void copyTo (std::ostream &stream) const
 Copies the data to the specified stream.
 

Additional Inherited Members

- Protected Member Functions inherited from TagParser::StreamDataBlock
 StreamDataBlock ()
 Constructs a new StreamDataBlock.
 
- Protected Attributes inherited from TagParser::StreamDataBlock
std::function< std::istream &()> m_stream
 
std::uint64_t m_startOffset
 
std::uint64_t 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.

Constructor & Destructor Documentation

◆ FileDataBlock()

TagParser::FileDataBlock::FileDataBlock ( std::string_view path,
Diagnostics & diag,
AbortableProgressFeedback & progress )

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 107 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 124 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: